# over riding the var defined in include var file is making all other variables undefined

**URL:** <https://forum.ansible.com/t/over-riding-the-var-defined-in-include-var-file-is-making-all-other-variables-undefined/30764>\
**Category:** Ansible Project\
**Created:** [July 11, 2019, 8:01pm UTC](https://forum.ansible.com/t/over-riding-the-var-defined-in-include-var-file-is-making-all-other-variables-undefined/30764 "2019-07-11T20:01:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shashank\_Dutt\_Jha](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Shashank\_Dutt\_Jha](https://forum.ansible.com/u/Shashank_Dutt_Jha)\
**Post date:** [July 11, 2019, 8:01pm UTC](https://forum.ansible.com/t/over-riding-the-var-defined-in-include-var-file-is-making-all-other-variables-undefined/30764/1 "2019-07-11T20:01:46Z")

</div>

I have included var file using  
var\_files:

- file

It has a variable city. state among others

Then I redefine the city variable in a json file and run the playbook --extra-vars “@a.json”

Now when I access any variable other then city it gives undefined var.

---

<div class="post-metadata">

**Author:** ![Shashank\_Dutt\_Jha](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Shashank\_Dutt\_Jha](https://forum.ansible.com/u/Shashank_Dutt_Jha)\
**Post date:** [July 12, 2019, 4:08pm UTC](https://forum.ansible.com/t/over-riding-the-var-defined-in-include-var-file-is-making-all-other-variables-undefined/30764/2 "2019-07-12T16:08:40Z")

</div>

Should I over-ride all variables? Looks like that.

Or can I selectively decide to over ride only few of them. This is what I want.
