playbook2.yml 644 Bytes
Newer Older
1
---
2
- hosts: '*'
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
  tasks:
  - name: config step
    action: setup a=2 b=3 c=4
  - name: copy comand
    action: copy src=/srv/a dest=/srv/b
    notify: 
    - restart apache
  - name: template step
    action: template src=/srv/template.j2 dest=/srv/file.out
    notify:
    - restart apache
  - name: execute bin false
    comment: call something that will fail just to demo failure counts and such
    action: command /bin/false
  - name: execute bin true
    comment: this will never be executed because previous will fail
    action: command /bin/true
  handlers:
    - name: restart apache
      action: service name=httpd state=restarted