Hi Ansible Experts,
We would need to check the fail-over check of remote servers in the
beginning of the play and delegate them during the play execution when its
reachable.
---
- name:Remote server status check
gather_facts: no
hosts: 127.0.0.1
vars:
remoteserver1: remoteserver1.com
remoteserver2: remoteserver2.com
tasks:
- name: Gather facts from server1
setup:
delegate_to: "{{ remoteserver1 }}"
register: status1
any_errors_fatal: true
- name: Gather facts from server2
setup:
delegate_to: "{{ remoteserver2 }}"
register: status2
any_errors_fatal: true
But the play fails as soon as any one of the remote server is not
reachable. Can you please suggest the right approach to handle this error
for failed servers.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/9b67180a-f390-4fa7-a09b-417c17b1189f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.