--- - name: inventory of machines HQ-SRV and HQ-CLI hosts: - HQ-SRV - HQ-CLI gather_facts: yes tasks: - name: create a report with workplace information delegate_to: localhost copy: dest: "/etc/ansible/PC_INFO/{{ ansible_hostname }}.yml" content: | --- name pc: "{{ ansible_hostname }}" ip-address pc: "{{ ansible_default_ipv4.address }}"