execute on all hosts:
ansible-playbook -i inventory/file/path playbook/file/pathfor all hosts:
ansible -i inventory/file/path all -m setupfor a single host:
ansible 192.168.1.20 -i inventory/file/path -m setupredirect the output to a file:
ansible -i inventory/file/path all -m setup > system_facts.txtthese facts are stored in the ansible_facts variable and they are used, for example, in the when condition:
- name: install apache
yum:
name: httpd
state: latest
when: ansible_facts['os_family'] == 'RedHat'README STILL IN PROGRESS...