mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Make template test work with both py2.6 and 2.7+
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user