Created
November 1, 2018 21:45
-
-
Save lhazlewood/e7d09ca3a847a93dbad79570b4d22baf to your computer and use it in GitHub Desktop.
Print an ansible fact or variable on the command line using the ansible cli and jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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