Hi All,

I need to pass a json file to ansible-palybook command using --extra-var 
(like --extra-var @/tmp/test.json).  I am able to reference the variable 
inside playbook if the json key don't have dot character in it.  But I am 
not able reference the key which contain dot(.) in it. This is just sample 
entry in JSOn file but I have many keys which contain dot(.) in key name 
and I can't remove the dot char in the key name because the file coming 
from external system. 

# 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.


-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8f7ebee3-83d2-4572-80fb-6e8d4489d8ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to