Add connectivity test playbook
Tests SSH connectivity and displays basic host info (OS, version). Usage: ansible-playbook playbooks/ping.yml Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d841e04a39
commit
35d6965fab
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
- name: Test connectivity to all hosts
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
- name: Ping all hosts
|
||||
ansible.builtin.ping:
|
||||
|
||||
- name: Gather basic facts
|
||||
ansible.builtin.setup:
|
||||
gather_subset:
|
||||
- min
|
||||
register: host_facts
|
||||
|
||||
- name: Display host info
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ inventory_hostname }} - {{ ansible_host | default('localhost') }} - {{ host_facts.ansible_facts.ansible_distribution | default('N/A') }} {{ host_facts.ansible_facts.ansible_distribution_version | default('') }}"
|
||||
Loading…
Reference in New Issue