mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
Getting dynamic includes working a bit better on v2
This commit is contained in:
parent
f12695f287
commit
d0cfcdbc4d
9 changed files with 147 additions and 39 deletions
1
v2/samples/common_include.yml
Normal file
1
v2/samples/common_include.yml
Normal file
|
@ -0,0 +1 @@
|
|||
- debug: msg="this is the common include"
|
3
v2/samples/l1_include.yml
Normal file
3
v2/samples/l1_include.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
- debug: msg="this is the l1 include"
|
||||
- include: common_include.yml
|
||||
|
4
v2/samples/l2_include.yml
Normal file
4
v2/samples/l2_include.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- debug: msg="this is the l2 include"
|
||||
- debug: msg="a second task for l2"
|
||||
- include: common_include.yml
|
||||
|
4
v2/samples/l3_include.yml
Normal file
4
v2/samples/l3_include.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- debug: msg="this is the l3 include"
|
||||
- debug: msg="a second task for l3"
|
||||
- debug: msg="a third task for l3"
|
||||
- include: common_include.yml
|
|
@ -1,9 +1,7 @@
|
|||
- hosts: localhost
|
||||
- hosts: all
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- block:
|
||||
- include: include.yml
|
||||
when: 1 == 2
|
||||
- include: include.yml a=1
|
||||
when: 1 == 1
|
||||
notify: foo
|
||||
|
@ -12,10 +10,11 @@
|
|||
- foo
|
||||
- bar
|
||||
- bam
|
||||
- include: "{{inventory_hostname}}_include.yml"
|
||||
- fail:
|
||||
|
||||
#rescue:
|
||||
#- include: include.yml a=rescue
|
||||
rescue:
|
||||
- include: include.yml a=rescue
|
||||
|
||||
always:
|
||||
- include: include.yml a=always
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue