I’m running Ansible 1.4.4 which comes with Ubuntu 12.04 LTS. I’m getting weird 
results when trying to get host facts.

If I have:

- debug: var=hostvars[inventory_hostname]

I get the all the information I’d expect, including:

ok: [test.example.com] => {
   "hostvars[inventory_hostname]": {
…
"ansible_eth0": {
           "active": true, 
           "device": "eth0", 
           "ipv4": {
               "address": “192.168.1.1", 
               "netmask": "255.255.255.0", 
               "network": “192.168.1.254"
           }, 
….

but if I have:

- debug: var=hostvars[inventory_hostname]['ansible_eth0’]

ok: [test.example.com] => {
   "hostvars[inventory_hostname][ansible_eth0]": "{{ 
hostvars[inventory_hostname][ansible_eth0] }}", 
   "item": "”
}

i.e. Nothing!

I also tried

 - debug: msg={{hostvars[inventory_hostname]['ansible_eth0’]}}

and got the same result.

I did a google and didn’t find anything promising.

Any suggestions as to what I’m doing wrong?

Thanks,

GTG
-- 
Gordon Ross



-- 
Gordon Ross,
UIS Telecoms Office,
University of Cambridge

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/39F10C05-1BD4-44D4-9968-C907E683E0CC%40uis.cam.ac.uk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to