# Multi-dimensional group\_vars ?

**URL:** <https://forum.ansible.com/t/multi-dimensional-group-vars/21352>\
**Category:** Ansible Project\
**Created:** [May 4, 2016, 12:04pm UTC](https://forum.ansible.com/t/multi-dimensional-group-vars/21352 "2016-05-04T12:04:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renaud\_Guerin](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@Renaud\_Guerin](https://forum.ansible.com/u/Renaud_Guerin)\
**Post date:** [May 4, 2016, 12:04pm UTC](https://forum.ansible.com/t/multi-dimensional-group-vars/21352/1 "2016-05-04T12:04:53Z")

</div>

Hi,

I have a variable “elasticsearch\_heap\_size” that can take 4 different values depending on 2 dimensions:

- the host being an Elasticsearch master or data node
- whether it’s in production or development.

At the moment, I have 2 inventory files “production” and “development”, and I set the variable directly within each using [elasticsearch-master:vars] and [elasticsearch-data:vars]

However, I know that setting variables inside static inventory files is discouraged in favor of using group\_vars directories.

How would I go about doing this when the variable depends BOTH on production/development group membership ?

Thanks

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [May 4, 2016, 4:37pm UTC](https://forum.ansible.com/t/multi-dimensional-group-vars/21352/2 "2016-05-04T16:37:52Z")

</div>

I like to set values like that in group\_vars/all/\<something\_descriptive\>.yml

e.g.

# file: group\_vars/definitions.yml

`
