Skip to content

Instantly share code, notes, and snippets.

@alxschwarz
Created February 23, 2017 12:17
Show Gist options
  • Save alxschwarz/7ef97e87678b3d776207093546e44105 to your computer and use it in GitHub Desktop.
Save alxschwarz/7ef97e87678b3d776207093546e44105 to your computer and use it in GitHub Desktop.
Using ansible in command line
ansible -i hosts '192.168.1.10*' -m setup | sed 's/.*|.*=>.*/{/g' | jq -r '.ansible_facts.ansible_hostname'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment