diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2019-07-10 13:49:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-10 13:49:24 +0200 |
commit | 7346b699eec99d7279da4175b99f07e08f0de283 (patch) | |
tree | 83f5cb555bdd639d1f57311ddfa774802d1724a6 /test/integration/targets/loops | |
parent | fix the vm name (diff) | |
download | ansible-7346b699eec99d7279da4175b99f07e08f0de283.tar.xz ansible-7346b699eec99d7279da4175b99f07e08f0de283.zip |
Use templated loop_var/index_var when looping include_* (#58866)
Fixes #58820
Diffstat (limited to 'test/integration/targets/loops')
-rw-r--r-- | test/integration/targets/loops/tasks/main.yml | 10 | ||||
-rw-r--r-- | test/integration/targets/loops/tasks/templated_loop_var_tasks.yml | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/integration/targets/loops/tasks/main.yml b/test/integration/targets/loops/tasks/main.yml index 85fb5ce4b3..0ce32ab589 100644 --- a/test/integration/targets/loops/tasks/main.yml +++ b/test/integration/targets/loops/tasks/main.yml @@ -334,3 +334,13 @@ - 1 loop_control: loop_var: alvin + +# https://github.com/ansible/ansible/issues/58820 +- name: Test using templated loop_var inside include_tasks + include_tasks: templated_loop_var_tasks.yml + loop: + - value + loop_control: + loop_var: "{{ loop_var_name }}" + vars: + loop_var_name: templated_loop_var_name diff --git a/test/integration/targets/loops/tasks/templated_loop_var_tasks.yml b/test/integration/targets/loops/tasks/templated_loop_var_tasks.yml new file mode 100644 index 0000000000..1f8f96979a --- /dev/null +++ b/test/integration/targets/loops/tasks/templated_loop_var_tasks.yml @@ -0,0 +1,4 @@ +- name: Validate that the correct value was used + assert: + that: + - templated_loop_var_name == 'value' |