outside.yaml:
--- - include: inside.yamlvars:my_inner_item: "{{ item}}"
with_items: - A - B - C
inside.yaml:
---- debug: msg="{{my_inner_item}} with {{ item }} is defined" with_items: - 1 - 2 - 3
outside.yaml:
--- - include: inside.yaml
with_items: - A - B - C
inside.yaml:
---
- set_fact
my_inner_item={{item}}- debug: msg="{{my_inner_item}} with {{ item }} is defined" with_items: - 1 - 2 - 3
outside.yaml:
---
- include: inside.yaml my_inner_item={{item}}
with_items:
- A
- B
- C
inside.yaml:
--- - debug: msg="{{my_inner_item}} with {{ item }} is defined" with_items: - 1 - 2 - 3
outside.yaml:
--- - include: inside.yamlvars:my_outer_item: "{{ item}}"
with_items:
- A
- B
- C
inside.yaml:
---- debug: msg="{{my__item}} with {{ item }} is defined" with_items: - 1 - 2 - 3outer
outside.yaml:
--- - include: inside.yaml
with_items: - A - B - C
inside.yaml:
---
- set_fact
my_- debug: msg="{{my__item={{item}}outer_item}} with {{ item }} is defined" with_items: - 1 - 2 - 3outer
outside.yaml:
--- - include: inside.yaml my__item={{item}} with_items: - A - B - Couter
inside.yaml:
--- - debug: msg="{{my__item}} with {{ item }} is defined" with_items: - 1 - 2 - 3outer