mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
update playbook docs with updated syntax / minor edits
This commit is contained in:
@@ -1,23 +1,15 @@
|
||||
---
|
||||
- pattern: '*'
|
||||
hosts: /etc/ansible/hosts
|
||||
hosts: '/etc/ansible/hosts'
|
||||
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
|
||||
- name: configure template & module variables for future template calls
|
||||
action: setup http_port=80 max_clients=200
|
||||
- name: write the apache config file
|
||||
action: template src=/srv/httpd.j2 dest=/etc/httpd/conf
|
||||
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
|
||||
- name: ensure apache is running
|
||||
action: service name=httpd state=started
|
||||
handlers:
|
||||
- name: restart apache
|
||||
action: service name=httpd state=restarted
|
||||
- action: service name=httpd state=restarted
|
||||
|
||||
23
examples/playbook2.yml
Normal file
23
examples/playbook2.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- pattern: '*'
|
||||
hosts: /etc/ansible/hosts
|
||||
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
|
||||
Reference in New Issue
Block a user