Hi all
I am having trouble accessing IP address from bond0 dict object and
all google search I can do is not helping. Anyone has a pointer on
whats wrong with the way I am trying to use the object below? In the
template, I am using the below format but it fails
{{ansible_bond0.ipv4.address}}
Below, I am using setup module to investigate the issue
[wmuriithi@dazzler config]$ ansible 192.168.149.233 -m setup -a
'filter=ansible_bond0' --user=uxp -vvv
<192.168.149.233> ESTABLISH CONNECTION FOR USER: uxp
<192.168.149.233> REMOTE_MODULE setup filter=ansible_bond0
<192.168.149.233> EXEC ssh -C -tt -q -o ControlMaster=auto -o
ControlPersist=60s -o
ControlPath="/home/wmuriithi/.ansible/cp/ansible-ssh-%h-%p-%r" -o
Port=22 -o KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=uxp -o ConnectTimeout=10
192.168.149.233 /bin/sh -c 'mkdir -p
$HOME/.ansible/tmp/ansible-tmp-1441033768.14-23900406434480 && chmod
a+rx $HOME/.ansible/tmp/ansible-tmp-1441033768.14-23900406434480 &&
echo $HOME/.ansible/tmp/ansible-tmp-1441033768.14-23900406434480'
<192.168.149.233> PUT /tmp/tmpUxuv8k TO
/home/uxp/.ansible/tmp/ansible-tmp-1441033768.14-23900406434480/setup
<192.168.149.233> EXEC ssh -C -tt -q -o ControlMaster=auto -o
ControlPersist=60s -o
ControlPath="/home/wmuriithi/.ansible/cp/ansible-ssh-%h-%p-%r" -o
Port=22 -o KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=uxp -o ConnectTimeout=10
192.168.149.233 /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python
/home/uxp/.ansible/tmp/ansible-tmp-1441033768.14-23900406434480/setup;
rm -rf /home/uxp/.ansible/tmp/ansible-tmp-1441033768.14-23900406434480/
/dev/null 2>&1'
192.168.149.233 | success >> {
"ansible_facts": {
"ansible_bond0": {
"active": true,
"device": "bond0",
"ipv4": {
"address": "192.168.152.51",
"netmask": "255.255.255.0",
"network": "192.168.152.0"
},
"ipv6": [
{
"address": "2607:f798:f:3df2:461e:a1ff:fe4f:5ce0",
"prefix": "64",
"scope": "global"
},
{
"address": "fe80::461e:a1ff:fe4f:5ce0",
"prefix": "64",
"scope": "link"
}
],
"lacp_rate": "slow",
"macaddress": "44:1e:a1:4f:5c:e0",
"miimon": "100",
"mode": "active-backup",
"mtu": 1500,
"promisc": false,
"slaves": [
"eth0",
"eth7"
],
"type": "bonding"
}
},
"changed": false
}
[wmuriithi@dazzler config]$ ansible 192.168.149.233 -m setup -a
'filter=ansible_bond0.ipv4' --user=uxp -vvv
<192.168.149.233> ESTABLISH CONNECTION FOR USER: uxp
<192.168.149.233> REMOTE_MODULE setup filter=ansible_bond0.ipv4
<192.168.149.233> EXEC ssh -C -tt -q -o ControlMaster=auto -o
ControlPersist=60s -o
ControlPath="/home/wmuriithi/.ansible/cp/ansible-ssh-%h-%p-%r" -o
Port=22 -o KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=uxp -o ConnectTimeout=10
192.168.149.233 /bin/sh -c 'mkdir -p
$HOME/.ansible/tmp/ansible-tmp-1441033793.19-19846156718369 && chmod
a+rx $HOME/.ansible/tmp/ansible-tmp-1441033793.19-19846156718369 &&
echo $HOME/.ansible/tmp/ansible-tmp-1441033793.19-19846156718369'
<192.168.149.233> PUT /tmp/tmpdupApC TO
/home/uxp/.ansible/tmp/ansible-tmp-1441033793.19-19846156718369/setup
<192.168.149.233> EXEC ssh -C -tt -q -o ControlMaster=auto -o
ControlPersist=60s -o
ControlPath="/home/wmuriithi/.ansible/cp/ansible-ssh-%h-%p-%r" -o
Port=22 -o KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=uxp -o ConnectTimeout=10
192.168.149.233 /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/python
/home/uxp/.ansible/tmp/ansible-tmp-1441033793.19-19846156718369/setup;
rm -rf /home/uxp/.ansible/tmp/ansible-tmp-1441033793.19-19846156718369/
/dev/null 2>&1'
192.168.149.233 | success >> {
"ansible_facts": {},
"changed": false
}
Why is ansible_bond0.ipv4 coming back empty?
Appreciate any pointer
Regards,
William