ping_check/ping.yml

21 lines
476 B
YAML

---
- name: Ping check to determine if hosts are reachable
hosts: all
become: false
gather_facts: false
tasks:
- name: Ping target hosts
ansible.builtin.ping:
register: ping_results
ignore_errors: true
failed_when: false
- name: Display ping check results
ansible.builtin.debug:
msg: "{{ lookup('template', 'ping_results.j2') | from_yaml }}"
run_once: true # noqa: run-once[task]
delegate_to: localhost
...