On 13. sep. 2016 23:55, Lise Mattice wrote:
[snip]
- name: VMWARE - Identify Adapter of primary interface
set_fact:
adptr: "create_vm_results.ansible_facts.hw_{{ nic }}.macaddress"
- name: VMWARE - Show Created VM Primary Adapter (DEBUG)
debug: var=adptr
[snip]
TASK [vm_create : VMWARE - Show Created VM Primary Adapter (DEBUG)]
************
ok: [localhost] => {
"adptr": "create_vm_results.ansible_facts.hw_eth0.macaddress"
}
[snip]
The objective was to get the MAC, but instead it is the "fact" name. Is
there a way to look up the value of this fact?
Any assistance would be appreciated.
To use variables you need to use hostvars to make it work
{{
hostvars[inventory_hostname]['create_vm_results']['ansible_facts']['hw_'
+ nic]['macaddress'] }}
--
Kai Stian Olstad
--
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/3bb51ccc-cf43-2983-9c0b-9a23553453d7%40olstad.com.
For more options, visit https://groups.google.com/d/optout.