# Reading a Json file using Ansible

**URL:** <https://forum.ansible.com/t/reading-a-json-file-using-ansible/21371>\
**Category:** Ansible Project\
**Created:** [May 6, 2016, 9:08am UTC](https://forum.ansible.com/t/reading-a-json-file-using-ansible/21371 "2016-05-06T09:08:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shwetha\_Hadimani](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Shwetha\_Hadimani](https://forum.ansible.com/u/Shwetha_Hadimani)\
**Post date:** [May 6, 2016, 9:08am UTC](https://forum.ansible.com/t/reading-a-json-file-using-ansible/21371/1 "2016-05-06T09:08:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [May 6, 2016, 1:46pm UTC](https://forum.ansible.com/t/reading-a-json-file-using-ansible/21371/2 "2016-05-06T13:46:10Z")

</div>

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.
