diff --git a/test/integration/targets/var_reserved/tasks/include_vars.yml b/test/integration/targets/var_reserved/tasks/include_vars.yml new file mode 100644 index 00000000000..af05f3f71e6 --- /dev/null +++ b/test/integration/targets/var_reserved/tasks/include_vars.yml @@ -0,0 +1,5 @@ +- hosts: localhost + gather_facts: no + tasks: + - include_vars: + file: ../vars/set_host_variable.yml diff --git a/test/integration/targets/var_reserved/tasks/main.yml b/test/integration/targets/var_reserved/tasks/main.yml index c4c9600f6d8..efd5f9fcb2a 100644 --- a/test/integration/targets/var_reserved/tasks/main.yml +++ b/test/integration/targets/var_reserved/tasks/main.yml @@ -2,22 +2,32 @@ vars: canary: Found variable using reserved name block: - - shell: ansible-playbook '{{[ role_path, "tasks", item ~ ".yml"] | path_join }}' + - shell: ansible-playbook '{{[ role_path, "tasks", item.file ~ ".yml"] | path_join }}' environment: ANSIBLE_LOCALHOST_WARNING: 0 + ANSIBLE_FORCE_COLOR: 0 failed_when: false loop: - - play_vars - - block_vars - - task_vars - - task_vars_used - - set_fact + - file: play_vars + name: lipsum + - file: block_vars + name: query + - file: task_vars + name: query + - file: task_vars_used + name: q + - file: set_fact + name: lookup + - file: include_vars + name: query register: play_out - name: check they all complain about bad defined var assert: that: - - canary in item['stderr'] + - item.stderr == warning_message loop: '{{play_out.results}}' loop_control: - label: '{{item.item}}' + label: '{{item.item.file}}' + vars: + warning_message: "[WARNING]: {{ canary }}: {{ item.item.name }}" diff --git a/test/integration/targets/var_reserved/vars/set_host_variable.yml b/test/integration/targets/var_reserved/vars/set_host_variable.yml new file mode 100644 index 00000000000..a6b4dead74d --- /dev/null +++ b/test/integration/targets/var_reserved/vars/set_host_variable.yml @@ -0,0 +1 @@ +query: overwrite global Jinja2 function