dudu.c
(dudu.c...@gmail.com)
1
HI
I’m checking ping on a few of my groups. I wish to abort the playbook if one of the IPs is not reachable - How should I update the playbook
Thanks
Playbook
- hosts:
- postgres1
- kafka
- repository
become: true
gather_facts: False
tasks:
- name: Verify that all hosts are reachable
ping:
vbotka
(Vladimir Botka)
2
Try this
- hosts:
- postgres1
- kafka
- repository
become: true
gather_facts: False
tasks:
- block:
- wait_for_connection:
timeout: 5
rescue:
- debug:
msg: "{{ inventory_hostname }} not available. End play."
- meta: end_play
- debug:
msg: All hosts available. Continue play.
- setup:
HTH,
-vlado