diff --git a/playbooks/ping.yml b/playbooks/ping.yml new file mode 100644 index 0000000..b9ccd95 --- /dev/null +++ b/playbooks/ping.yml @@ -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('') }}"