--- - 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('') }}"