What Command Do You Run to See the Host Variables That Ansible Natively Has Access to on the Servers In /etc/ansible/hosts File?

Problem scenario
You want to see the different variables that Ansible can leverage (e.g., for playbooks to inject host-specific data into files).  How do you find out what Ansible has access to on each server in /etc/ansible/hosts?

Solution
Run this command:
ansible all -m setup --tree /tmp/facts

Leave a comment

Your email address will not be published. Required fields are marked *