# not able to reference fact for network interface in the template

**URL:** <https://forum.ansible.com/t/not-able-to-reference-fact-for-network-interface-in-the-template/15750>\
**Category:** Ansible Project\
**Created:** [July 23, 2014, 9:34pm UTC](https://forum.ansible.com/t/not-able-to-reference-fact-for-network-interface-in-the-template/15750 "2014-07-23T21:34:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_M](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@Greg\_M](https://forum.ansible.com/u/Greg_M)\
**Post date:** [July 23, 2014, 9:34pm UTC](https://forum.ansible.com/t/not-able-to-reference-fact-for-network-interface-in-the-template/15750/1 "2014-07-23T21:34:40Z")

</div>

Helo all,

I wonder if I can get some help with referencing facts in template.

I ma not able to reference:

every time I run my play, the file on the host shows:

carp0\_ip=””

and the same line in my template:

carp0\_ip=”{{ ansible\_carp0[“ipv4”][“address”] }}”

this is the snippet from running: ansible server -m setup

“ansible\_carp0”: {  
“device”: “carp0”,  
“flags”: [  
“UP”,  
“BROADCAST”,  
“RUNNING”,  
"SI  
“ipv4”: [  
{  
“address”: “10.0.0.33”,  
“broadcast”: “10.0.0.255”,  
“netmask”: “255.255.255.0”,  
“network”: “10.0.0.0”  
}  
],  
“ipv6”: [  
{  
“address”: “fe80::200:5eff:fe00:101%carp0”,  
“prefix”: “64”,  
“scope”: “0x4”  
}  
],  
“macaddress”: “00:00:5e:00:01:04”,  
“mtu”: “1500”,  
“status”: “master”,  
“type”: “unknown”  
},

host where ansible is installed: CentOS 6.5

ansible version: 1.6.6

host I’m pulling facts from: OpenBSD 5.5

Thank you

Greg

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 23, 2014, 10:12pm UTC](https://forum.ansible.com/t/not-able-to-reference-fact-for-network-interface-in-the-template/15750/2 "2014-07-23T22:12:49Z")

</div>

Hmm, can we see a full playbook so we can understand a bit more in context?

---

<div class="post-metadata">

**Author:** ![Greg\_M](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@Greg\_M](https://forum.ansible.com/u/Greg_M)\
**Post date:** [July 24, 2014, 1:21pm UTC](https://forum.ansible.com/t/not-able-to-reference-fact-for-network-interface-in-the-template/15750/3 "2014-07-24T13:21:13Z")

</div>

template/relayd.yml.j2:

# {{ ansible\_managed }}

---

<div class="post-metadata">

**Author:** ![Greg\_M](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@Greg\_M](https://forum.ansible.com/u/Greg_M)\
**Post date:** [July 28, 2014, 9:26pm UTC](https://forum.ansible.com/t/not-able-to-reference-fact-for-network-interface-in-the-template/15750/4 "2014-07-28T21:26:48Z")

</div>

Thank you for your replay.  
after farther testing i was able to reproduce the error  
the error only shows on BSD system (Open, Free)

sample host file:

# ansible host file
