Task:
As an alternative of failing a subsequent task, add a check to see if a host is reachable first.
In a real-world example, the reg_connection_check.skip_reason would be the when for all subsequent calls (e.g. tasks or to a child role).
Code Snippet:
...
- shell: hostname
register: reg_connection_check
- wait_for_connection:
msg: "Server is unreachable"
when:
- reg_connection_check.skip_reason is defined
- "'unreachable' in reg_connection_check.skip_reason"
...
previous page
|