1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/examples/playbook.yml
Michael DeHaan d308254eae A basic service module with 'ensure' idempotence semantics. Playbook updated to use service
module vs command module for restarting.  May be some bugs and requires the service to implement 'status' -- and probably some better error handling (i.e. return JSON with "failed" element if failed).

Improvements welcome.
2012-02-25 20:27:11 -05:00

27 lines
617 B
YAML

- pattern: '*'
hosts: '/etc/ansible/hosts'
tasks:
- do:
- configure template & module variables
- setup a=2 b=3 c=4
- do:
- copy a file
- copy /srv/a /srv/b
notify:
- restart apache
- do:
- template from local file template.j2 to remote location /srv/file.out
- template /srv/template.j2 /srv/file.out
notify:
- restart apache
- quack like a duck
- do:
- something that will fail
- command /bin/false
handlers:
- do:
- restart apache
- service name=httpd ensure=restarted
- do:
- quack like a duck
- command /bin/true