Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Print an ansible fact or variable on the command line using the ansible cli and jq
# for example, to print ansible_distribution:
ansible localhost -m setup 2>/dev/null | sed '1 s/^.*$/{/' | jq -r '.ansible_facts.ansible_distribution'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.