Answer the question
In order to leave comments, you need to log in
Why doesn't ignore_errors help for ping?
In general, I am rebooting a remote virtual machine, I want to ping to check whether the host has woken up or not (I know about wait_for port, but I need to additionally check with another tool that I can execute a command on a remote host). There is a problem that the machine does not go into reboot, it pings, but you can't connect to it via ssh, do something on it, etc. but alas, ignore_errors does not work. How to be? Or is there another means besides ping to check the host, who knows?
doing a reboot:
- name: Rebooting the machine
shell: sleep 2 && shutdown -r now
async: 1
poll: 0
ignore_errors: yes
- name: tmp sleep
local_action: shell sleep 5
- name: ping pong
ping:
register: data
ignore_errors: yes
TASK [reboot_vm : ping pong] ***************************************************
fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.245.145 port 22: Connection refused\r\n", "unreachable": true}
to retry, use: --limit @/etc/ansible/prepare.retry
PLAY RECAP *********************************************************************
default : ok=3 changed=2 unreachable=1 failed=0
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question