# Impact of merging hashes

**URL:** <https://forum.ansible.com/t/impact-of-merging-hashes/15618>\
**Category:** Ansible Project\
**Created:** [July 7, 2014, 3:58pm UTC](https://forum.ansible.com/t/impact-of-merging-hashes/15618 "2014-07-07T15:58:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehul\_Ved](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mehul\_Ved](https://forum.ansible.com/u/Mehul_Ved)\
**Post date:** [July 7, 2014, 3:58pm UTC](https://forum.ansible.com/t/impact-of-merging-hashes/15618/1 "2014-07-07T15:58:46Z")

</div>

Hi,  
&nbsp;&nbsp;I am setting up a system using ansible where my configuration values  
are defined in defaults/main.yml. If the user wants to override it,  
they will edit vars/main.yml with the same dictionary structure. e.g.

$ cat defaults/main.yml  
app:  
&nbsp;&nbsp;port: 10000  
&nbsp;&nbsp;workers: 10

$ cat vars/main.yml  
app:  
&nbsp;&nbsp;port: 20000

So, now my configuration will be:  
app:  
&nbsp;&nbsp;port: 2000  
&nbsp;&nbsp;workers: 10

To do this, I set hash\_behaviour=merge in my ansible.cfg. This does  
work as expected. But, I am not sure if it'll cause me any trouble  
going ahead or add unnecessary complexity? Is it safe to go ahead with  
this setting as long the whole deployment code will be maintained by  
me?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 7, 2014, 7:29pm UTC](https://forum.ansible.com/t/impact-of-merging-hashes/15618/2 "2014-07-07T19:29:53Z")

</div>

I generally view it as over-complicated for most folks, but it is a supported thing and won’t bite 🙂
