|
63 | 63 | ping: |
64 | 64 | register: legacy |
65 | 65 |
|
66 | | - - name: check for dep warning (only on platforms where auto result is not /usr/bin/python and legacy is) |
| 66 | + # from ansible 2.12 on this changed |
| 67 | + # - https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_5.html#python-interpreter-discovery |
| 68 | + # - https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html |
| 69 | + # default discovery methot is now auto and will default to python3 |
| 70 | + # and the message changed from a deprecation warning to a real warning that can not be suppressed by |
| 71 | + # using deprecation_warnings=False |
| 72 | + - name: check for dep warning (only on platforms where auto result is not /usr/bin/python and legacy is) for ansible 2.8-2.11 |
67 | 73 | assert: |
68 | 74 | that: |
69 | 75 | - legacy.deprecations | default([]) | length > 0 |
70 | 76 | fail_msg: legacy={{legacy}} |
71 | 77 | # only check for a dep warning if legacy returned /usr/bin/python and auto didn't |
72 | 78 | when: legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and |
73 | | - auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' |
| 79 | + auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' and |
| 80 | + ansible_version.full is version_compare('2.12.0', '<', strict=True) |
74 | 81 |
|
| 82 | + - name: check for warning (only on platforms where auto result is not /usr/bin/python and legacy is) from ansible 2.12 on |
| 83 | + assert: |
| 84 | + that: |
| 85 | + - legacy.warnings | default([]) | length > 0 |
| 86 | + fail_msg: legacy={{legacy}} |
| 87 | + # only check for a warning if legacy returned /usr/bin/python and auto didn't |
| 88 | + when: legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' and |
| 89 | + auto_out.ansible_facts.discovered_interpreter_python != '/usr/bin/python' and |
| 90 | + ansible_version.full is version_compare('2.12.0', '>=', strict=True) |
75 | 91 |
|
76 | 92 | - name: test that auto_silent never warns and got the same answer as auto |
77 | 93 | block: |
|
0 commit comments