Ansible facts

From wikinotes
Revision as of 22:06, 2 November 2019 by Will (talk | contribs) (Created page with "Ansible has some useful built-in variables. Most of them seem to be built in to <code>/usr/local/lib/python2.7/site-packages/ansible/module_utils/facts.py</code> ''' List all...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Ansible has some useful built-in variables. Most of them seem to be built in to /usr/local/lib/python2.7/site-packages/ansible/module_utils/facts.py

List all variables on a particular machine

ansible -m setup <hostname>

Some useful Variables

ansible_os_family                  == "RedHat"
ansible_distribution               == "Debian"
ansible_distribution_major_version == "7"