Commit dcd064ae authored by Chris's avatar Chris
Browse files

Fix incompatibility with Ansible 2.4

The 'ping' module behaves differently between Ansible 2.4 and 2.5, so the
tasks/diagnose-unpingable.yml task list didn't work in Ansible 2.4.
parent c08b8e42
......@@ -4,16 +4,10 @@
# being unavailable, or Python being an unsupported version.
#
---
# If the error has a defined error message and is not related to Python not
# being found, then display that message
- fail:
msg: '{{ _can_ping.msg }}'
when: _can_ping.msg is defined and (_can_ping.rc is not defined or _can_ping.rc != 127)
# If the error is related to Python not being found, then try to find the
# available Python interpreters
- name: Python is not found
when: _can_ping.rc is defined and _can_ping.rc == 127
when: _can_ping.module_stdout is defined and ( 'python' in _can_ping.module_stdout and 'not found' in _can_ping.module_stdout )
block:
- include_tasks: '{{ role_path }}/tasks/find-python-executable.yml'
- fail:
......@@ -21,6 +15,11 @@
Please set 'ansible_python_interpreter' to an executable Python interpreter.\n
The host has these available: ( {{ _python_interpreters | join(' , ') }} )"
# If the error has a defined error message, then display that message
- fail:
msg: '{{ _can_ping.msg }}'
when: _can_ping.msg is defined
# This block is a catchall that runs whenever an unanticipated error occurs
- name: Something Unexpected Happened
block:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment