Created
September 30, 2015 09:38
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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