--- - name: All Servers Test Windows Connectivity And Output Facts hosts: all gather_facts: true tasks: - name: Ping The Windows Hosts ansible.windows.win_ping: - name: Export Facts ansible.builtin.copy: mode: "0644" content: "{{ ansible_facts | to_nice_json }}" dest: "{{ playbook_dir }}../facts/{{ inventory_hostname }}.json" delegate_to: localhost tags: ["never", "debug"]