We have a template to create ifcfg files with the following partial
snippet: (second line commented out for test with 2.1)
HWADDR={{ ansible_wlp2s0.macaddress }}
{#HWADDR={{ hostvars[inventory_hostname]['ansible_' +
xsce_wireless_lan_iface|trim]['macaddress'] ]] #}
In ansible version 1.9 both HWADDR lines function. In version 2.1, I had to
comment out the hostvars line to execute the template without error.
So the syntax has changed, or something. I tried setting
gathering=implicit in ansible.conf, but it did not fix the problem
Does anyone have a new syntax that works in version 2.1
The error returned at the console was:
TASK [1-prep : WiFi enslaving wlp2s0 to Bridge]
********************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "msg":
"AnsibleUndefinedVariable: 'dict object' has no attribute
u'ansible_wlp2s0'"}
yet indeed ansible_wlp2s0 is defined when I do: "ansible -m setup localhost"
--
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/ad469fa8-e8df-4d24-a62b-6f4162d80b8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.