# vars /etc/ansible/hosts

**URL:** <https://forum.ansible.com/t/vars-etc-ansible-hosts/12592>\
**Category:** Ansible Project\
**Created:** [March 27, 2013, 9:01am UTC](https://forum.ansible.com/t/vars-etc-ansible-hosts/12592 "2013-03-27T09:01:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmytro\_Polushyn](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@Dmytro\_Polushyn](https://forum.ansible.com/u/Dmytro_Polushyn)\
**Post date:** [March 27, 2013, 9:01am UTC](https://forum.ansible.com/t/vars-etc-ansible-hosts/12592/1 "2013-03-27T09:01:50Z")

</div>

Yes, I know, if you think that this logic is right, ok  
But what do you think about this?

[https://gist.github.com/ovad/5252769](https://gist.github.com/ovad/5252769)

user oko1 has not been created on the host 10.132.219.68.  
Yes, I can declare my values in yml files but when it needs to deploy 30-40 applications on several servers and after that the same again and again (dev → test → preprod …) it will be useful to change values and server IPs only in the host file.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [March 27, 2013, 12:51pm UTC](https://forum.ansible.com/t/vars-etc-ansible-hosts/12592/2 "2013-03-27T12:51:45Z")

</div>

Keeping simple variables in a host file is ok, but obviously you can't  
set the same variable twice to two different values and have it work  
🙂

It seems like you should consider vars or vars\_files on the play and  
set the variables per play instead if you want that behavior.
