Skip to content

Instantly share code, notes, and snippets.

@ktaragorn
Created September 30, 2015 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktaragorn/6bc783586a093ba83ab2 to your computer and use it in GitHub Desktop.
Save ktaragorn/6bc783586a093ba83ab2 to your computer and use it in GitHub Desktop.
Ansible playbook to deploy by git and restart service, service specified by upstart
---
- name: Deploy Code
hosts: all
tasks:
- name: Deploy latest code from git
git:
repo: <<repo>>
dest: <<dest>>
accept_hostkey: true
version: master
- name: Restart the webservice
service: name=<<service>> state=restarted
sudo: yes
#for upstart
start on startup
chdir <<code path>>
exec <<cmd>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment