Skip to content

Instantly share code, notes, and snippets.

@madsonic
Last active May 24, 2019 09:51
Show Gist options
  • Save madsonic/a5817445514fb67f8787032285030174 to your computer and use it in GitHub Desktop.
Save madsonic/a5817445514fb67f8787032285030174 to your computer and use it in GitHub Desktop.
ansible gather facts
# stdout_call back must be in json
ansible -i <inventory> <inventory_hostname> -m setup
# depending on ansible config, the facts file might be cached locally, see '~/ansible.cfg'
# internal ip
"{{ ansible_facts['default_ipv4']['address'] }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment