Skip to content

Instantly share code, notes, and snippets.

@ilkka
Created August 16, 2017 08:25
Show Gist options
  • Save ilkka/b2862d35f39da9b9cb22bd7b6e07ab6c to your computer and use it in GitHub Desktop.
Save ilkka/b2862d35f39da9b9cb22bd7b6e07ab6c to your computer and use it in GitHub Desktop.
#!/usr/bin/env jq -r -f
._meta.hostvars[] |
select(.openstack.metadata.Group | contains("my-host-group"))? |
("Host " + .openstack.name + "\n Hostname " + .ansible_host + "\n User myusername")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment