- name: Create local working dir
  hosts: localhost
  roles:
    - provision/local
  tags:
    - provision

- name: Random select a storage host
  hosts: localhost
  connection: local
  gather_facts: false
  tasks:
    - set_fact:
        random_host: "{{ groups['storage'] | random }}"

- name: Create non root user on storage nodes
  hosts: "{{ random_host }}"
  roles:
    - provision/user
  tags:
    - provision

- name: Run fault drills on storage nodes in the system level
  hosts: "{{ random_host }}"
  roles:
    - storage/system

# Finally, we conditionally remove basic setup (users,
# groups, directories)to start from scratch
- name: Tear down non-root user on storage hosts
  hosts: "{{ random_host }}"
  roles:
    - provision/teardown
  tags:
    - teardown-provision

- name: Create local working dir
  hosts: localhost
  roles:
    - provision/local
  tags:
    - provision

- name: Random select a storage host
  hosts: localhost
  connection: local
  gather_facts: false
  tasks:
    - set_fact:
        random_host: "{{ groups['storage'] | random }}"

- name: Create non root user on storage nodes
  hosts: "{{ hostvars['localhost']['random_host'] }}"
  roles:
    - provision/user
  tags:
    - provision

- name: Run fault drills on storage nodes in the system level
  hosts: "{{ hostvars['localhost']['random_host'] }}"
  roles:
    - storage/system

# Finally, we conditionally remove basic setup (users,
# groups, directories)to start from scratch
- name: Tear down non-root user on storage hosts
  hosts: "{{ hostvars['localhost']['random_host'] }}"
  roles:
    - provision/teardown
  tags:
    - teardown-provision

Access host facts from another remote host
Access host facts from another remote host

Access another host facts use hostvars['remote hostname']['fact name']
