Reading a Json file using Ansible

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.

Just use it as a vars file.

vars_file:

  • ‘/opt/develop.json’

or via the include_vars module, JSON is a subset of YAML so it can be read as you would any other vars file.