# how to access dictionary key and value from group\_vars it is not working

**URL:** <https://forum.ansible.com/t/how-to-access-dictionary-key-and-value-from-group-vars-it-is-not-working/28688>\
**Category:** Ansible Project\
**Created:** [September 30, 2018, 11:19pm UTC](https://forum.ansible.com/t/how-to-access-dictionary-key-and-value-from-group-vars-it-is-not-working/28688 "2018-09-30T23:19:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atul\_Sharma](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Atul\_Sharma](https://forum.ansible.com/u/Atul_Sharma)\
**Post date:** [September 30, 2018, 11:19pm UTC](https://forum.ansible.com/t/how-to-access-dictionary-key-and-value-from-group-vars-it-is-not-working/28688/1 "2018-09-30T23:19:02Z")

</div>

group\_vars/vars.yml

[root@master mywork]# cat group\_vars/vars

---

<div class="post-metadata">

**Author:** ![Kuldip\_Madnani1](https://avatars.discourse-cdn.com/v4/letter/k/91b2a8/32.png) [@Kuldip\_Madnani1](https://forum.ansible.com/u/Kuldip_Madnani1)\
**Post date:** [October 1, 2018, 4:03am UTC](https://forum.ansible.com/t/how-to-access-dictionary-key-and-value-from-group-vars-it-is-not-working/28688/2 "2018-10-01T04:03:59Z")

</div>

The `group_vars` directory contains files _for each hostgroup_ defined in your inventory file. The files define variables that member hosts can use. So in your case the file should be group\_vars/docker\_con.yml
