On 23.02.2018 12:22, Foss Geek wrote:
# cat /tmp/test.json | jq
{
  "VMware.Hardware.Version": " vmx-10",

  "toolname": "tomcat"

}


Playbook:


# cat test.yml

---

host: myhost

vars:

  hdversion: "{{ VMware.Hardware.Version }}" # not works due to
dot(.), getting VARIABLE NOT DEFINED when try to reference hdversion
inside role

  mytoolname: "{{toolname}}"  # works fine


any workaround to use hdversion: "{{ VMware.Hardware.Version }}" to
get the value?

Any advise or guidance would be greatly appreciated.

This should work
  {{ vars['VMware.Hardware.Version'] }}


--
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/be47e32657e17d52b056a1220fb84b5a%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to