# Where to store global defaults?

**URL:** <https://forum.ansible.com/t/where-to-store-global-defaults/18345>\
**Category:** Ansible Project\
**Created:** [May 29, 2015, 1:43pm UTC](https://forum.ansible.com/t/where-to-store-global-defaults/18345 "2015-05-29T13:43:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bence\_Takacs](https://avatars.discourse-cdn.com/v4/letter/b/c6cbf5/32.png) [@Bence\_Takacs](https://forum.ansible.com/u/Bence_Takacs)\
**Post date:** [May 29, 2015, 1:43pm UTC](https://forum.ansible.com/t/where-to-store-global-defaults/18345/1 "2015-05-29T13:43:12Z")

</div>

Hi, All

Where should I store my global variables? Like company artifact repository url, application directory (/opt), etc?

Is there a proper place to put that?

I was thinking about ansible.cfg but this would be overkill.  
It’s not for hosts, not for groups, not for playbooks…

Regards:  
Bence

---

<div class="post-metadata">

**Author:** ![Bence\_Takacs](https://avatars.discourse-cdn.com/v4/letter/b/c6cbf5/32.png) [@Bence\_Takacs](https://forum.ansible.com/u/Bence_Takacs)\
**Post date:** [May 29, 2015, 2:24pm UTC](https://forum.ansible.com/t/where-to-store-global-defaults/18345/2 "2015-05-29T14:24:24Z")

</div>

First I tried to put that into **hosts** file, but did not work:

> [all:vars]

> nexus\_url=…

> app\_dir=/opt

…but did not work

Then I came up with the following solution:  
**group\_vars/all** :

> * * *

> nexus\_url: …

> app\_dir: /opt

And it is working and seems to be a clean colution for me

Regards:  
Bence

1. május 29., péntek 15:43:12 UTC+2 időpontban Bence Takács a következőt írta:
