Skip to content

Instantly share code, notes, and snippets.

@oboukili
Created April 20, 2017 09:26
Show Gist options
  • Select an option

  • Save oboukili/8866bd9ea2dc97631286b8f229dc4408 to your computer and use it in GitHub Desktop.

Select an option

Save oboukili/8866bd9ea2dc97631286b8f229dc4408 to your computer and use it in GitHub Desktop.
> $ ansible -i scaleway/scaleway-inventory.py all -m debug -a "var=hostvars[inventory_hostname]['ansible_host']"
web1 | SUCCESS => {
"changed": false,
"hostvars[inventory_hostname]['ansible_host']": "10.2.216.145"
}
database1 | SUCCESS => {
"changed": false,
"hostvars[inventory_hostname]['ansible_host']": "10.3.64.213"
}
> $ ansible -i scaleway all -m debug -a "var=hostvars[inventory_hostname]['ansible_host']"
web1 | SUCCESS => {
"changed": false,
"hostvars[inventory_hostname]['ansible_host']": "VARIABLE IS NOT DEFINED!"
}
database1 | SUCCESS => {
"changed": false,
"hostvars[inventory_hostname]['ansible_host']": "VARIABLE IS NOT DEFINED!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment