mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Update conditional docs since @jimi-c got playbook includes working in 2.0
This commit is contained in:
parent
61e76fd707
commit
6faaf41069
1 changed files with 3 additions and 2 deletions
|
@ -119,12 +119,13 @@ Applying 'when' to roles and includes
|
||||||
`````````````````````````````````````
|
`````````````````````````````````````
|
||||||
|
|
||||||
Note that if you have several tasks that all share the same conditional statement, you can affix the conditional
|
Note that if you have several tasks that all share the same conditional statement, you can affix the conditional
|
||||||
to a task include statement as below. Note this does not work with playbook includes, just task includes. All the tasks
|
to a task include statement as below. All the tasks get evaluated, but the conditional is applied to each and every task::
|
||||||
get evaluated, but the conditional is applied to each and every task::
|
|
||||||
|
|
||||||
- include: tasks/sometasks.yml
|
- include: tasks/sometasks.yml
|
||||||
when: "'reticulating splines' in output"
|
when: "'reticulating splines' in output"
|
||||||
|
|
||||||
|
.. note:: In versions prior to 2.0 this worked with task includes but not playbook includes. 2.0 allows it to work with both.
|
||||||
|
|
||||||
Or with a role::
|
Or with a role::
|
||||||
|
|
||||||
- hosts: webservers
|
- hosts: webservers
|
||||||
|
|
Loading…
Reference in a new issue