# Variable overwriting

**URL:** <https://forum.ansible.com/t/variable-overwriting/11609>\
**Category:** Ansible Project\
**Created:** [June 12, 2012, 8:04pm UTC](https://forum.ansible.com/t/variable-overwriting/11609 "2012-06-12T20:04:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brad\_Olson](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@Brad\_Olson](https://forum.ansible.com/u/Brad_Olson)\
**Post date:** [June 12, 2012, 8:04pm UTC](https://forum.ansible.com/t/variable-overwriting/11609/1 "2012-06-12T20:04:01Z")

</div>

Michael,

What’s the intended behavior about variable re-definition? Will later vars\_files overwrite earlier ones?

I guess that leads to a best practice problem. Use case is variable for a webserver, web app, and configuration, which has minor tweaks for a development server. My thought was a standard vars\_file read by production, qa, and dev, then another vars\_file with the dev server overrides.

Thanks,  
–Brad

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [June 12, 2012, 8:12pm UTC](https://forum.ansible.com/t/variable-overwriting/11609/2 "2012-06-12T20:12:11Z")

</div>

> Michael,
> 
> What’s the intended behavior about variable re-definition? Will later vars\_files overwrite earlier ones?

Yes. It’s an ordered list.

> I guess that leads to a best practice problem. Use case is variable for a webserver, web app, and configuration, which has minor tweaks for a development server. My thought was a standard vars\_file read by production, qa, and dev, then another vars\_file with the dev server overrides.

You could still do that.

---

<div class="post-metadata">

**Author:** ![Brad\_Olson](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@Brad\_Olson](https://forum.ansible.com/u/Brad_Olson)\
**Post date:** [June 13, 2012, 4:29pm UTC](https://forum.ansible.com/t/variable-overwriting/11609/3 "2012-06-13T16:29:30Z")

</div>

Great, thanks for confirming that!
