diff --git a/test/integration/roles/test_template/files/foo-py26.txt b/test/integration/roles/test_template/files/foo-py26.txt new file mode 100644 index 00000000000..84279bc7b3b --- /dev/null +++ b/test/integration/roles/test_template/files/foo-py26.txt @@ -0,0 +1,8 @@ +templated_var_loaded + +{ + "bool": true, + "multi_part": "1Foo", + "number": 5, + "string_num": "5" +} diff --git a/test/integration/roles/test_template/files/foo.txt b/test/integration/roles/test_template/files/foo.txt index 84279bc7b3b..edd704da048 100644 --- a/test/integration/roles/test_template/files/foo.txt +++ b/test/integration/roles/test_template/files/foo.txt @@ -1,8 +1,8 @@ templated_var_loaded { - "bool": true, - "multi_part": "1Foo", - "number": 5, + "bool": true, + "multi_part": "1Foo", + "number": 5, "string_num": "5" } diff --git a/test/integration/roles/test_template/tasks/main.yml b/test/integration/roles/test_template/tasks/main.yml index 2568843cf7e..0574868c9cd 100644 --- a/test/integration/roles/test_template/tasks/main.yml +++ b/test/integration/roles/test_template/tasks/main.yml @@ -41,8 +41,18 @@ # VERIFY CONTENTS +- name: check what python version ansible is running on + command: python -c 'import distutils.sysconfig ; print(distutils.sysconfig.get_python_version())' + register: pyver + delegate_to: localhost + - name: copy known good into place copy: src=foo.txt dest={{output_dir}}/foo.txt + when: pyver.stdout != '2.6' + +- name: copy known good into place + copy: src=foo-py2.6.txt dest={{output_dir}}/foo.txt + when: pyver.stdout == '2.6' - name: compare templated file to known good shell: diff {{output_dir}}/foo.templated {{output_dir}}/foo.txt