# can't access to existing "ansible\_eth1" fact

**URL:** <https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857>\
**Category:** Ansible Project\
**Created:** [November 6, 2013, 4:56pm UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857 "2013-11-06T16:56:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Philippe\_Caruan](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jean\_Philippe\_Caruan](https://forum.ansible.com/u/Jean_Philippe_Caruan)\
**Post date:** [November 6, 2013, 4:56pm UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/1 "2013-11-06T16:56:33Z")

</div>

Hi,

I successfully managed to add a private IP address on my servers. I  
can see both network interfaces eth0 and eth1 when I ask for the facts  
of this server (I stuggled to death to find this command) :

$ ansible server -m setup -i production  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ansible\_eth0": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"active": true,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"device": "eth0",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ipv4": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"address": "x.x.x.x",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"netmask": "x.x.x.x",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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&nbsp;"type": "ether"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},

But when I want to access the "ansible\_eth1" fact from my playbook :  
# dest file is /etc/hosts  
# locally resolve private IPs  
{% for host in groups['all'] %}  
{{ hostvars[host]['ansible\_eth1']['ipv4']['address'] }} {{ host }}  
{% endfor %}

I get the following error on every single server :  
fatal: [server] =\> {'msg': "One or more undefined variables: 'dict  
object' has no attribute 'ipv4'", 'failed': True}

This kind of code worked really good with eth0 ,as you can see in my  
fully working iptables template extract :  
{% for host in groups['all'] %}  
# access from {{ host }}  
- -A INPUT -p tcp -m tcp -s {{  
hostvars[host]['ansible\_eth0']['ipv4']['address'] }} --dport {{  
some\_port }} -j ACCEPT  
{% endfor %}

What am I doing wrong ?  
How can I debug this ? I thought "ansible server -m setup -i  
production" would provide me the correct information, but I was wrong.

Thanks.  
- --  
Jean-Philippe Caruana

---

<div class="post-metadata">

**Author:** ![Jean\_Philippe\_Caruan](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jean\_Philippe\_Caruan](https://forum.ansible.com/u/Jean_Philippe_Caruan)\
**Post date:** [November 6, 2013, 5:17pm UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/2 "2013-11-06T17:17:16Z")

</div>

To gather more information, I decided to print the content of the  
'ansible\_eth1' key inside my generated hosts file... I don't know if  
there is a more straightforward way to enter in debugging mode, still  
I found interesting data.

I replaced  
{{ hostvars[host]['ansible\_eth1']['ipv4']['address'] }} {{ host }}  
with  
{{ hostvars[host]['ansible\_eth1'] }} {{ host }}  
in my template

and got this (formatted for your eyes) dict, the content of the  
'ansible\_eth1' key :  
{  
&nbsp;&nbsp;&nbsp;&nbsp;'macaddress': 'x:x:x:x:x:x',  
&nbsp;&nbsp;&nbsp;&nbsp;'module': 'tg3',  
&nbsp;&nbsp;&nbsp;&nbsp;'mt': 9000,  
&nbsp;&nbsp;&nbsp;&nbsp;'device': 'eth1',  
&nbsp;&nbsp;&nbsp;&nbsp;'ipv4': {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'netmask': 'x.x.x.x',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'network': 'x.x.x.x',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'address': 'x.x.x.x'  
&nbsp;&nbsp;&nbsp;&nbsp;},  
&nbsp;&nbsp;&nbsp;&nbsp;'ipv6': [  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'scope': 'link',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'prefix': '64',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'address': 'x:❌x:x:x'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;],  
&nbsp;&nbsp;&nbsp;&nbsp;'active': True,  
&nbsp;&nbsp;&nbsp;&nbsp;'type': 'ether'  
}

There is a 'ipv4' key and inside this there is a 'address' key !

Informations are exactly the same with "ansible server -m setup" (cf  
my previous post), so I'm satisfied.  
I have as many lines in the generated file as my servers in my  
inventory, so I'm satisfied again.

So why can't I access to ansible\_eth1.ipv4 from my template ?

Thanks for your input.  
- --  
Jean-Philippe Caruana

---

<div class="post-metadata">

**Author:** ![Jean\_Philippe\_Caruan](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jean\_Philippe\_Caruan](https://forum.ansible.com/u/Jean_Philippe_Caruan)\
**Post date:** [November 8, 2013, 10:43am UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/3 "2013-11-08T10:43:00Z")

</div>

Le 06/11/2013 18:17, Jean-Philippe Caruana a �crit :

> So why can't I access to ansible\_eth1.ipv4 from my template ?

It seems to be quite a tough matter, so I opened an issue for this :  
[https://github.com/ansible/ansible/issues/4848](https://github.com/ansible/ansible/issues/4848)

- --  
Jean-Philippe Caruana

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [November 10, 2013, 9:32pm UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/4 "2013-11-10T21:32:57Z")

</div>

Have you narrowed this down by using --limit to exactly one host and made sure there is an ipv4 address for that host?

I’m guessing one host might not have an ipv4 address for that interface.

---

<div class="post-metadata">

**Author:** ![Jean\_Philippe\_Caruan](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jean\_Philippe\_Caruan](https://forum.ansible.com/u/Jean_Philippe_Caruan)\
**Post date:** [November 12, 2013, 9:26am UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/5 "2013-11-12T09:26:04Z")

</div>

Hi,

Le 10/11/2013 22:32, Michael DeHaan a �crit :

> Have you narrowed this down by using --limit to exactly one host and  
> made sure there is an ipv4 address for that host?
> 
> I'm guessing one host might not have an ipv4 address for that interface.

I tested on a single server, I have the fact ansible\_eth1 with  
ipv4.address and then I had the error when executing the playbook (see  
my first email).  
I used "ansible myserver.com -m setup -i inventory". Is it the same  
effect as --limit ?

As seen in my debug test (printing {{ hostvars[host]['ansible\_eth1'] }}  
on every host) gave me the following dict for every server (I masually  
checked, since I just have 8 servers for now) :

{  
&nbsp;&nbsp;&nbsp;&nbsp;'macaddress': 'x:x:x:x:x:x',  
&nbsp;&nbsp;&nbsp;&nbsp;'module': 'tg3',  
&nbsp;&nbsp;&nbsp;&nbsp;'mt': 9000,  
&nbsp;&nbsp;&nbsp;&nbsp;'device': 'eth1',  
&nbsp;&nbsp;&nbsp;&nbsp;'ipv4': {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'netmask': 'x.x.x.x',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'network': 'x.x.x.x',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'address': 'x.x.x.x' # \<- here 🙂  
&nbsp;&nbsp;&nbsp;&nbsp;},  
&nbsp;&nbsp;&nbsp;&nbsp;'ipv6': [  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'scope': 'link',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'prefix': '64',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'address': 'x:❌x:x:x'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;],  
&nbsp;&nbsp;&nbsp;&nbsp;'active': True,  
&nbsp;&nbsp;&nbsp;&nbsp;'type': 'ether'  
}

When I ask for facts for one server, there is an ipv4 address on eth1.  
I checked, and all my servers do have an ipv4 address on eth1, either  
with ifconfig or with ansible facts.

---

<div class="post-metadata">

**Author:** ![senorsmile](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/senorsmile/32/9024_2.png) [@senorsmile](https://forum.ansible.com/u/senorsmile)\
**Post date:** [February 4, 2014, 11:47pm UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/6 "2014-02-04T23:47:20Z")

</div>

I am getting the exact same issue as OP. I cloned the official ansible-examples and am trying to deploy the hadoop example. I get part the way through and then get the error:

TASK: [common | Create the hosts file for all machines] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [hadoop1] =\> {‘msg’: “One or more undefined variables: ‘dict object’ has no attribute u’ansible\_eth0’”, ‘failed’: True}  
fatal: [hadoop1] =\> {‘msg’: “One or more undefined variables: ‘dict object’ has no attribute u’ansible\_eth0’”, ‘failed’: True}  
fatal: [hadoop2] =\> {‘msg’: “One or more undefined variables: ‘dict object’ has no attribute u’ansible\_eth0’”, ‘failed’: True}  
fatal: [hadoop2] =\> {‘msg’: “One or more undefined variables: ‘dict object’ has no attribute u’ansible\_eth0’”, ‘failed’: True}  
fatal: [hadoop3] =\> {‘msg’: “One or more undefined variables: ‘dict object’ has no attribute u’ansible\_eth0’”, ‘failed’: True}  
fatal: [hadoop3] =\> {‘msg’: “One or more undefined variables: ‘dict object’ has no attribute u’ansible\_eth0’”, ‘failed’: True}

When I do ansible -m setup all, I can see that ansible\_eth0 exists and has a dict of data, including the address from hosts.j2. Any clue what is happening there?

For reference, here is my modified hosts file (as maybe there’s something wrong here?)

hadoop\_master\_primary ansible\_ssh\_host=centos6-hadoop01  
hadoop\_master\_secondary ansible\_ssh\_host=centos6-hadoop02  
hadoop1 ansible\_ssh\_host=centos6-hadoop03  
hadoop2 ansible\_ssh\_host=centos6-hadoop04  
hadoop3 ansible\_ssh\_host=centos6-hadoop05

[hadoop\_all:children]  
hadoop\_masters  
hadoop\_slaves  
qjournal\_servers  
zookeeper\_servers

[hadoop\_all:vars]  
ansible\_ssh\_user=root

[hadoop\_master\_primary]  
hadoop1

[hadoop\_master\_secondary]  
hadoop2

[hadoop\_masters:children]  
hadoop\_master\_primary  
hadoop\_master\_secondary

[hadoop\_slaves]  
hadoop1  
hadoop2  
hadoop3

[qjournal\_servers]  
hadoop1  
hadoop2  
hadoop3

[zookeeper\_servers]  
hadoop1 zoo\_id=1  
hadoop2 zoo\_id=2  
hadoop3 zoo\_id=3

---

<div class="post-metadata">

**Author:** ![Jean\_Philippe\_Caruan](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jean\_Philippe\_Caruan](https://forum.ansible.com/u/Jean_Philippe_Caruan)\
**Post date:** [February 5, 2014, 1:30pm UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/7 "2014-02-05T13:30:16Z")

</div>

I am feeling less alone now...

I haven't tested it since newer releases of ansible went out : what is  
your ansible version ?

---

<div class="post-metadata">

**Author:** ![Jean\_Philippe\_Caruan](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jean\_Philippe\_Caruan](https://forum.ansible.com/u/Jean_Philippe_Caruan)\
**Post date:** [November 21, 2014, 5:15pm UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/8 "2014-11-21T17:15:51Z")

</div>

Hi,

I am resurrecting this old message (of mine) : the issue [https://github.com/ansible/ansible/issues/4848](https://github.com/ansible/ansible/issues/4848) has been closed as “you can’t do jinja2”, but I think this is an issue in gathering ansible\_eth1 fact

any idea ?

Thanks

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [November 21, 2014, 5:20pm UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/9 "2014-11-21T17:20:38Z")

</div>

ansible server -m setup -i production, should provide you the correct info.

I suspect one of your hosts does not have an ipv4 address assigned to eth1.

---

<div class="post-metadata">

**Author:** ![Jean\_Philippe\_Caruan](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@Jean\_Philippe\_Caruan](https://forum.ansible.com/u/Jean_Philippe_Caruan)\
**Post date:** [November 24, 2014, 10:38am UTC](https://forum.ansible.com/t/cant-access-to-existing-ansible-eth1-fact/13857/10 "2014-11-24T10:38:50Z")

</div>

Thanks, this is helpful.  
As a matter of fact, one of my servers don’t have an ipv4 address assign to eth1, but does have an ansible\_eth1 fact:

“ansible\_eth1”: {  
“active”: false,  
“device”: “eth1”,  
  
},

I think I can use the active flag to prevent my template from crashing for this server:

{% for host in groups[‘all’] %}  
{% if hostvars[host][‘ansible\_eth1’][‘active’] %}  
{{ hostvars[host][‘ansible\_eth1’][‘ipv4’][‘address’] }} {{ host }}  
{% endif %}  
{% endfor %}
