# Load vars directory variables at inventory or playbook level

**URL:** <https://forum.ansible.com/t/load-vars-directory-variables-at-inventory-or-playbook-level/15451>\
**Category:** Ansible Project\
**Created:** [June 12, 2014, 1:11pm UTC](https://forum.ansible.com/t/load-vars-directory-variables-at-inventory-or-playbook-level/15451 "2014-06-12T13:11:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xabier\_Larrakoetxea](https://avatars.discourse-cdn.com/v4/letter/x/f05b48/32.png) [@Xabier\_Larrakoetxea](https://forum.ansible.com/u/Xabier_Larrakoetxea)\
**Post date:** [June 12, 2014, 1:11pm UTC](https://forum.ansible.com/t/load-vars-directory-variables-at-inventory-or-playbook-level/15451/1 "2014-06-12T13:11:40Z")

</div>

Hi!

I think that this is not possible at this moment (I don’t know if I’m wrong)

I want to load a common variables directory ( **vars** for example like in role levels) at playbook or inventory levels so I don’t have to set the **include\_vars** or **vars\_files** in each role or task.

I want to do this because I want to store all my sensible data in different encrypted files with vault, I could set this variables in **group\_vars** or **host\_vars** but I don’t want to encrypt all these files, only the ones with the sensible data variables.

This is my actual structure:

./  
├── group\_vars  
│ ├── all  
│ └── readme.txt  
├── inventories  
│ └── sandbox  
│ ├── group\_vars  
│ │ └── all  
│ ├── hosts  
│ ├── host\_vars  
│ │ ├── [1.db.master.sandbox.favorshare.org](http://1.db.master.sandbox.favorshare.org)  
│ │ ├── [1.lb.sandbox.favorshare.org](http://1.lb.sandbox.favorshare.org)  
│ │ ├── [1.web.sandbox.favorshare.org](http://1.web.sandbox.favorshare.org)  
│ │ └── [2.web.sandbox.favorshare.org](http://2.web.sandbox.favorshare.org)  
│ └── **vars**  
**│ └── sensible\_data.yml**  
├── main.yml  
…

Is a good approach?  
I am wrong with some concepts or structure and is a better one?  
Could be a feature for a pull request?

Thank you!

---

<div class="post-metadata">

**Author:** ![Xabier\_Larrakoetxea](https://avatars.discourse-cdn.com/v4/letter/x/f05b48/32.png) [@Xabier\_Larrakoetxea](https://forum.ansible.com/u/Xabier_Larrakoetxea)\
**Post date:** [June 13, 2014, 7:11am UTC](https://forum.ansible.com/t/load-vars-directory-variables-at-inventory-or-playbook-level/15451/2 "2014-06-13T07:11:28Z")

</div>

Solved!

This was answered by Serge van Ginderachter at the devel list:

group\_vars/all can also be a directory (and so can be any group or host name)

so you could do

group\_vars/all/normalstuff.yml  
group\_vars/all/vaultencryptedstuff.yml
