What is the difference between the following syntaxes?

=== 1st scenario


outside.yaml:

---
- include: inside.yaml
  vars:
    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



=== 2nd scenario


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


=== 3rd Scenario:

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


... I do not list the old "loop_control" scenario...


By the way: there is an existing issue connected to this topic:
https://github.com/ansible/ansible/issues/14146

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b32ee9aa-7578-4ade-92e6-0dd2599bb14c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to