# ansible facts for interface aliases

**URL:** <https://forum.ansible.com/t/ansible-facts-for-interface-aliases/16192>\
**Category:** Ansible Developer\
**Created:** [September 12, 2014, 10:25am UTC](https://forum.ansible.com/t/ansible-facts-for-interface-aliases/16192 "2014-09-12T10:25:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rene\_Moser](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@Rene\_Moser](https://forum.ansible.com/u/Rene_Moser)\
**Post date:** [September 12, 2014, 10:25am UTC](https://forum.ansible.com/t/ansible-facts-for-interface-aliases/16192/1 "2014-09-12T10:25:54Z")

</div>

Hi

If you have ip aliases so called ipv4 secondaries configured, you get this from setup:

“ansible\_bond0”: {  
“active”: true,  
“device”: “bond0”,  
“ipv4”: {  
“address”: “10.100.219.17”,  
“netmask”: “255.255.255.0”,  
“network”: “10.100.219.0”  
},  
“ipv4\_secondaries”: [  
{  
“address”: “10.100.219.18”,  
“netmask”: “255.255.255.0”,  
“network”: “10.100.219.0”  
}  
],  
“ipv6”: [  
{  
“address”: “fe80::250:56ff:fe9e:10d4”,  
“prefix”: “64”,  
“scope”: “link”  
}  
],  
“macaddress”: “00:50:56:9e:10:d4”,  
“module”: “vmxnet3”,  
“mtu”: 1500,  
“promisc”: false,  
“type”: “ether”  
},  
“ansible\_bond0\_0”: {  
“ipv4\_secondaries”: [  
{  
“address”: “10.100.219.18”,  
“netmask”: “255.255.255.0”,  
“network”: “10.100.219.0”  
}  
]  
},

the “ansible\_bond0”: part looks good. But in the “ansible\_bond0\_0” part, I expected to have the following (without the array ).

“ansible\_bond0\_0”: {  
“ipv4\_secondaries”: {  
“address”: “10.100.219.18”,  
“netmask”: “255.255.255.0”,  
“network”: “10.100.219.0”  
}  
},

# ifconfig

bond0 Link encap:Ethernet HWaddr 00:50:56:9E:10:D4  
inet addr:10.100.219.17 Bcast:10.100.219.255 Mask:255.255.255.0  
inet6 addr: fe80::250:56ff:fe9e:10d4/64 Scope:Link  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
RX packets:234982 errors:0 dropped:0 overruns:0 frame:0  
TX packets:258833 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 txqueuelen:1000  
RX bytes:66325373 (63.2 MiB) TX bytes:18960200 (18.0 MiB)

bond0:0 Link encap:Ethernet HWaddr 00:50:56:9E:10:D4  
inet addr:10.100.219.18 Bcast:10.100.219.255 Mask:255.255.255.0  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Or can you explain, why there is an array defined for this ifce?

Regards  
René

---

<div class="post-metadata">

**Author:** ![Paul\_Totterman](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@Paul\_Totterman](https://forum.ansible.com/u/Paul_Totterman)\
**Post date:** [September 12, 2014, 11:00am UTC](https://forum.ansible.com/t/ansible-facts-for-interface-aliases/16192/2 "2014-09-12T11:00:48Z")

</div>

> Or can you explain, why there is an array defined for this ifce?

Interface aliases are deprecated in Linux. Expect weird behaviour. ipv4\_secondaries is exactly the same for bond0 and bond0\_0. iproute2 allows you to add any number of ip addresses to an interface. To handle the generic case, it has to be an array.

Cheers,  
Paul
