changed examples to not have a non working variable that gets confused
with directives as per #9264
This commit is contained in:
parent
d25748b037
commit
8e2a8c92ac
1 changed files with 6 additions and 6 deletions
|
@ -61,19 +61,19 @@ For instance, if deploying multiple wordpress instances, I could
|
||||||
contain all of my wordpress tasks in a single wordpress.yml file, and use it like so::
|
contain all of my wordpress tasks in a single wordpress.yml file, and use it like so::
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- include: wordpress.yml user=timmy
|
- include: wordpress.yml wp_user=timmy
|
||||||
- include: wordpress.yml user=alice
|
- include: wordpress.yml wp_user=alice
|
||||||
- include: wordpress.yml user=bob
|
- include: wordpress.yml wp_user=bob
|
||||||
|
|
||||||
If you are running Ansible 1.4 and later, include syntax is streamlined to match roles, and also allows passing list and dictionary parameters::
|
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:
|
tasks:
|
||||||
- { include: wordpress.yml, user: timmy, ssh_keys: [ 'keys/one.txt', 'keys/two.txt' ] }
|
- { include: wordpress.yml, wp_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'll cover them in :doc:`playbooks_variables`.
|
Using either syntax, variables passed in can then be used in the included files. We'll cover them in :doc:`playbooks_variables`.
|
||||||
You can reference them like this::
|
You can reference them like this::
|
||||||
|
|
||||||
{{ user }}
|
{{ wp_user }}
|
||||||
|
|
||||||
(In addition to the explicitly passed-in parameters, all variables from
|
(In addition to the explicitly passed-in parameters, all variables from
|
||||||
the vars section are also available for use here as well.)
|
the vars section are also available for use here as well.)
|
||||||
|
@ -85,7 +85,7 @@ which also supports structured variables::
|
||||||
|
|
||||||
- include: wordpress.yml
|
- include: wordpress.yml
|
||||||
vars:
|
vars:
|
||||||
remote_user: timmy
|
wp_user: timmy
|
||||||
some_list_variable:
|
some_list_variable:
|
||||||
- alpha
|
- alpha
|
||||||
- beta
|
- beta
|
||||||
|
|
Loading…
Reference in a new issue