Hi,

I have a json file like below called "develop.json"

{
    "releasedata": {
        "release_name": "abcd",
        "release_number": "22"
}

Below is my ansible script. I need to fetch release_name from the file.

---
  - hosts: localhost
    vars:
      version_file: "{{ lookup('file', '/opt/develop.json')  | from_json }}"
    tasks:
       - name: print json file
        debug: msg= "{{ version_file.releasedata.release_name }}"

But this is not working. Kindly help me.


-- 
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/7afb6ba8-3d29-4eac-9920-6a1c2bc65b5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to