---

- name: "Retrieve facts and store them locally"
  hosts: all
  gather_facts: no
  connection: local
  tasks:
    - name: "Gather facts"
      setup:
        gather_subset: "!all"
      connection: "{{omit}}"
    - name: "Create directory for each machine"
      file:
        path: "/tmp/{{inventory_hostname}}"
        state: "directory"
    - name: "Create file information for each machine"
      copy:
        content: |
          Distribution : {{ansible_distribution}}
          Version      : {{ansible_distribution_major_version}}
        dest: "/tmp/{{inventory_hostname}}/info.txt"
