Skip to content

Instantly share code, notes, and snippets.

@carlessanagustin
Created May 26, 2016 09:00
Show Gist options
  • Save carlessanagustin/da6b15d6352e9a977f98ce43a5b92f89 to your computer and use it in GitHub Desktop.
Save carlessanagustin/da6b15d6352e9a977f98ce43a5b92f89 to your computer and use it in GitHub Desktop.
Ansible - Working with inventory variables
- name: 1st
tags: debug
debug: var=hostvars['{{ item }}']['ansible_eth1']['ipv4']['address']
with_items: "{{ groups['master'] }}"
- name: 2nd
tags: debug
debug: var=hostvars['{{ item }}']['ansible_default_ipv4']['address']
with_items: "{{ groups['master'] }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment