1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

restructure the examples directory

This commit is contained in:
Michael DeHaan 2012-03-13 19:27:13 -04:00
parent 09a7119e74
commit 2e1b59a9d2
9 changed files with 32 additions and 6 deletions

View file

@ -42,7 +42,7 @@
# end of the playbook run # end of the playbook run
- name: write some_random_foo configuration - name: write some_random_foo configuration
action: template src=foo.j2 dest=/etc/some_random_foo.conf action: template src=templates/foo.j2 dest=/etc/some_random_foo.conf
notify: notify:
- restart apache - restart apache
@ -66,6 +66,6 @@
# is changed, and only then # is changed, and only then
- name: restart apache - name: restart apache
action: service httpd state=restarted action: service name=httpd state=restarted

View file

@ -16,7 +16,7 @@
# files but still keep the playbook in public source control # files but still keep the playbook in public source control
vars_files: vars_files:
- external_vars.yml - vars/external_vars.yml
# as with before, every play has a list of tasks in it # as with before, every play has a list of tasks in it
@ -30,7 +30,7 @@
# or we can promote reuse and simplicity by including tasks # or we can promote reuse and simplicity by including tasks
# from other files, for instance, to reuse common tasks # from other files, for instance, to reuse common tasks
- include: base.yml - include: tasks/base.yml
# we could also have done something like: # we could also have done something like:
# - include: wordpress.yml user=timmy # - include: wordpress.yml user=timmy
@ -44,7 +44,7 @@
# and simpler recipes, you may wish to only have one # and simpler recipes, you may wish to only have one
# handler file for all your plays and playbooks # handler file for all your plays and playbooks
- include: handlers.yml - include: handlers/handlers.yml
# you can mix things that are directly in the file with things # you can mix things that are directly in the file with things
# that are included. Order is executed as written, but only # that are included. Order is executed as written, but only
@ -75,7 +75,7 @@
vars: vars:
release: 2.0 release: 2.0
vars_files: vars_files:
- external_vars.yml - vars/external_vars.yml
# these all runs as the user 'mdehaan'. If there were any handlers # these all runs as the user 'mdehaan'. If there were any handlers

View file

@ -0,0 +1,26 @@
---
# this is not so much an example playbook file as a playbook we sometimes use
# for testing. I have chosen to not comment this one so folks can get
# an idea of what a concise playbook can look like...
- hosts: all
user: root
vars:
http_port: 80
max_clients: 200
tasks:
- name: simulate long running op, wait for 45s, poll every 5
action: command /bin/sleep 15
async: 45
poll: 5
- include: tasks/base.yml favcolor=blue
- name: write the foo config file using vars set above
action: template src=foo.j2 dest=/etc/some_random_foo.conf
notify:
- restart apache
- name: ensure apache is running
action: service name=httpd state=started
- name: pointless test action
action: command /bin/echo {{ http_port }}
handlers:
- include: handlers/handlers.yml