mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Document standardized task/handler include syntax.
This commit is contained in:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user