2012-07-12 04:17:51 +00:00
|
|
|
---
|
|
|
|
# it is possible to have top level playbook files import other playbook
|
|
|
|
# files. For example, a playbook called could include three
|
|
|
|
# different playbooks, such as webservers, workers, dbservers, etc.
|
|
|
|
#
|
|
|
|
# Running the site playbook would run all playbooks, while individual
|
|
|
|
# playbooks could still be run directly. This is somewhat like
|
|
|
|
# the tag feature and can be used in conjunction for very fine grained
|
|
|
|
# control over what you want to target when running ansible.
|
|
|
|
|
2012-08-07 00:00:31 +00:00
|
|
|
- name: this is a play at the top level of a file
|
2012-07-12 04:17:51 +00:00
|
|
|
hosts: all
|
|
|
|
user: root
|
|
|
|
tasks:
|
|
|
|
- name: say hi
|
|
|
|
tags: foo
|
|
|
|
action: shell echo "hi..."
|
|
|
|
|
|
|
|
# and this is how we include another playbook, be careful and
|
|
|
|
# don't recurse infinitely or anything. Note you can't use
|
2012-08-29 00:27:08 +00:00
|
|
|
# any variables in the include path here.
|
2012-07-12 04:17:51 +00:00
|
|
|
|
|
|
|
- include: intro_example.yml
|
|
|
|
|
|
|
|
# and if we wanted, we can continue with more includes here,
|
|
|
|
# or more plays inline in this file
|