Last active
August 29, 2015 14:07
-
-
Save mrwilson/27bfe23281d1d7eec025 to your computer and use it in GitHub Desktop.
Executable ansible manifests
This file contains hidden or 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
#!/usr/bin/env ansible-playbook | |
- hosts: blog | |
sudo: yes | |
gather_facts: false | |
tasks: | |
- name: Copy blog across | |
synchronize: src=./blog dest=/var/www/blog | |
notify: | |
- Restart nginx | |
handlers: | |
- name: Restart nginx | |
service: name=nginx state=restarted |
This file contains hidden or 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
$ ./example.yml | |
PLAY [blog] ******************************************************************* | |
TASK: [Copy blog across] ****************************************************** | |
changed: [example.probablyfine.co.uk] | |
NOTIFIED: [Restart nginx] ***************************************************** | |
changed: [example.probablyfine.co.uk] | |
PLAY RECAP ******************************************************************** | |
example.probablyfine.co.uk : ok=2 changed=2 unreachable=0 failed=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment