Don't pollute include_variables (#54687)

* Don't pollute include_variables. Fixes #51667. Fixes #54618.

* Rename include_variables to include_args, so we can make the distinction about what they are

* Track args and vars separately

* oops

* oops again

* linting fix

* Add test
This commit is contained in:
Matt Martz
2019-04-09 10:14:42 -05:00
committed by GitHub
parent dd20c7c04e
commit fbf2d5d2f4
7 changed files with 51 additions and 22 deletions

View File

@@ -0,0 +1,4 @@
- assert:
that:
- name == 'name_from_loop_var'
- name != 'loop_name_assert'

View File

@@ -94,3 +94,6 @@ test "$(egrep -c 'include handler task|ERROR! The requested handler '"'"'do_impo
# https://github.com/ansible/ansible/issues/49969
ansible-playbook -v parent_templating/playbook.yml 2>&1 | tee test_parent_templating.out
test "$(egrep -c 'Templating the path of the parent include_tasks failed.' test_parent_templating.out)" = 0
# https://github.com/ansible/ansible/issues/54618
ansible-playbook test_loop_var_bleed.yaml "$@"

View File

@@ -0,0 +1,9 @@
- hosts: localhost
gather_facts: false
tasks:
- include_role:
name: loop_name_assert
loop:
- name_from_loop_var
loop_control:
loop_var: name