# vars dictionary

**URL:** <https://forum.ansible.com/t/vars-dictionary/36132>\
**Category:** Ansible Project\
**Created:** [December 20, 2021, 12:13am UTC](https://forum.ansible.com/t/vars-dictionary/36132 "2021-12-20T00:13:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_K](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@Andrew\_K](https://forum.ansible.com/u/Andrew_K)\
**Post date:** [December 20, 2021, 12:13am UTC](https://forum.ansible.com/t/vars-dictionary/36132/1 "2021-12-20T00:13:52Z")

</div>

Hello,

A few years back I wrote a playbook that defined a variable like this:

variable\_names: “{{ vars.keys() }}”

The playbook is still working fine, but when I recently revisited it and tried to refresh myself on how it works, I found that I couldn’t find any documentation on the vars dictionary. I’m concerned that the lack of documentation means that this isn’t something that is officially supported and it may stop working in a future version.

I’m hoping that someone can either point me to some documentation, or let me know that using vars is a legit thing to do.

For what it’s worth, I’m using this to dynamically access variables defined within roles.

Thanks,  
Andrew
