mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 20:44:00 -07:00
Document standardized task/handler include syntax.
This commit is contained in:
parent
6bec262b8e
commit
f27a9986c1
2 changed files with 8 additions and 4 deletions
|
|
@ -63,7 +63,12 @@ contain all of my wordpress tasks in a single wordpress.yml file, and use it lik
|
|||
- include: wordpress.yml user=alice
|
||||
- include: wordpress.yml user=bob
|
||||
|
||||
Variables passed in can then be used in the included files. We've already covered them a bit in :doc:`playbooks_variables`.
|
||||
If you are running Ansible 1.4 and later, include syntax is streamlined to match roles, and also allows passing list and dictionary parameters::
|
||||
|
||||
tasks:
|
||||
- { include: wordpress.yml, user: timmy, ssh_keys: [ 'keys/one.txt', 'keys/two.txt' ] }
|
||||
|
||||
Using either syntax, variables passed in can then be used in the included files. We've already covered them a bit in :doc:`playbooks_variables`.
|
||||
You can reference them like this::
|
||||
|
||||
{{ user }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue