# path to group\_vars

**URL:** <https://forum.ansible.com/t/path-to-group-vars/19572>\
**Category:** Ansible Project\
**Created:** [October 21, 2015, 11:02am UTC](https://forum.ansible.com/t/path-to-group-vars/19572 "2015-10-21T11:02:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jepper](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jepper](https://forum.ansible.com/u/jepper)\
**Post date:** [October 21, 2015, 11:02am UTC](https://forum.ansible.com/t/path-to-group-vars/19572/1 "2015-10-21T11:02:22Z")

</div>

This might be a really dumb question. I am working on a project where the directory structure looks like the tree below. I am looking for confirmation from the forum that this will not read anything group\_vars, as group\_vars from what I can deduct, should live within the inventory directory, being relative to the inventory (and this cannot be changed in ansible.cfg?). Is my understanding correct?

├── apserver.yml  
├── dbservers.yml

├── group\_vars  
│ ├── all (F)  
│ ├── apservers (F)

│ └── dbservers (F)

├── inventory  
│ ├── dev (F)

│ └── prod (F)

├── roles  
│ ├── activemq  
│ │ ├── tasks

│ │ │ ├── main.yml

For avoidance of doubt, (F) means the entry is a file.

---

<div class="post-metadata">

**Author:** ![jepper](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jepper](https://forum.ansible.com/u/jepper)\
**Post date:** [October 21, 2015, 11:56am UTC](https://forum.ansible.com/t/path-to-group-vars/19572/2 "2015-10-21T11:56:45Z")

</div>

On another project, I have my inventory file in a directory called env/sandbox

├── env  
│ └── sandbox  
│ ├── group\_vars  
│ │ └── all  
│ └── inventory

I then created this at the root of the ansible directory, with different variables.  
├── group\_vars  
│ └── all

Running ansible-playbook -i env/sandbox/inventory site.yml, values from group\_vars/all is used, instead of env/sandbox/group\_vars/all.

I am confused. While it is suggested one may elect to have group\_vars in the root directory, my understanding was that group\_vars was relative to inventory. Apparently not.

---

<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:** [October 21, 2015, 11:38pm UTC](https://forum.ansible.com/t/path-to-group-vars/19572/3 "2015-10-21T23:38:29Z")

</div>

group/host\_vars MUST be relative either to the inventory or to the  
play being run.
