# Overriding Role variables using vars\_files

**URL:** <https://forum.ansible.com/t/overriding-role-variables-using-vars-files/16139>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [September 7, 2014, 9:42pm UTC](https://forum.ansible.com/t/overriding-role-variables-using-vars-files/16139 "2014-09-07T21:42:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Bell](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@Mike\_Bell](https://forum.ansible.com/u/Mike_Bell)\
**Post date:** [September 7, 2014, 9:42pm UTC](https://forum.ansible.com/t/overriding-role-variables-using-vars-files/16139/1 "2014-09-07T21:42:48Z")

</div>

Hi,

I’m trying to override some default variables in a rolebook that I’m using from ansible galaxy. In my playbook I have the following:

`

---

<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:** [September 7, 2014, 10:30pm UTC](https://forum.ansible.com/t/overriding-role-variables-using-vars-files/16139/2 "2014-09-07T22:30:53Z")

</div>

Roles having a defaults/main.yml will have, in that file, variables that are lower priority than basically anything in Ansible - including inventory.

Variables in vars/ are going to be used.

It seems the confusion is the use of “vars/” instead of “defaults/”.

(In either case, this is a matter of overriding things - precedence - not OO inheritance)
