Add ping test playbook

This commit is contained in:
alex-local
2025-09-10 10:31:47 +02:00
parent cd18c6e75b
commit 24234478bb

18
ping.yml Normal file
View File

@@ -0,0 +1,18 @@
---
- name: Ping Test Playbook
hosts: all
gather_facts: no
tasks:
- name: Test connectivity with ping
ansible.builtin.ping:
register: ping_result
- name: Display ping result
ansible.builtin.debug:
msg: "Host {{ inventory_hostname }} is reachable"
when: ping_result is succeeded
- name: Display connection failure
ansible.builtin.debug:
msg: "Host {{ inventory_hostname }} is NOT reachable"
when: ping_result is failed