# How to read the local variables in a role

**URL:** <https://forum.ansible.com/t/how-to-read-the-local-variables-in-a-role/26885>\
**Category:** Ansible Project\
**Created:** [March 2, 2018, 10:03am UTC](https://forum.ansible.com/t/how-to-read-the-local-variables-in-a-role/26885 "2018-03-02T10:03:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillermo\_Colmena](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@Guillermo\_Colmena](https://forum.ansible.com/u/Guillermo_Colmena)\
**Post date:** [March 2, 2018, 10:03am UTC](https://forum.ansible.com/t/how-to-read-the-local-variables-in-a-role/26885/1 "2018-03-02T10:03:57Z")

</div>

Hi community,

I was forwarded from github website to this group ; )

I am trying to use local variables on the roles I have created, but once the var file is created. I don’t know how and from where call those. At the moment it is not reading those local vars the role that i have created.

In that role , I am calling those vars following these steps:

```auto
vars_files:
   - /vars/main.yml

```

Let me know if there is a possible way to do it or somebody has been working on this before with success, perhaps calling those from the main playbook which contains the call to the hosts and roles? 😉

Thanks,  
Best Regards.  
Sivana

---

<div class="post-metadata">

**Author:** ![Guillermo\_Colmena](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@Guillermo\_Colmena](https://forum.ansible.com/u/Guillermo_Colmena)\
**Post date:** [March 5, 2018, 9:19am UTC](https://forum.ansible.com/t/how-to-read-the-local-variables-in-a-role/26885/2 "2018-03-05T09:19:12Z")

</div>

Hi, let me know if someone could guide me with this ;0

Kind regards,  
Sivana
