Make template test work with both py2.6 and 2.7+

pull/10838/merge
Toshio Kuratomi 10 years ago
parent aafda44bb3
commit 8d0ceeca91

@ -0,0 +1,8 @@
templated_var_loaded
{
"bool": true,
"multi_part": "1Foo",
"number": 5,
"string_num": "5"
}

@ -1,8 +1,8 @@
templated_var_loaded
{
"bool": true,
"multi_part": "1Foo",
"number": 5,
"bool": true,
"multi_part": "1Foo",
"number": 5,
"string_num": "5"
}

@ -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

Loading…
Cancel
Save