Why to overrule role vars? There is quite a simple setup I am sure many of us have come across: 


You have lean, slim and dedicate roles
Every role has its own role vars
Playbooks include the roles


Let's assume you have a base path for an application, most likely you will need this path in many roles. To keep the roles independent you would define this base path in every role vars where needed.

Now you include some roles in a Playbook and in case of a change on e.g. the base path you need to change that in every role.

One help would be to use extra vars to overrule the role vars, but what if there are many potential candidates for a change?

So I would like to be able to include_vars in a playbook to overrule the variables in the roles. But this is not possible as:


include_vars is not allowed in Playbooks
var_files (what would work in Playbooks) will be over written by role vars




Question: how do you do solve this situation?  Maybe I want something odd and there is a much simpler way?
Variables have different priorities, see vars precedence.

As of Ansible 2.x:


  role defaults
  inventory file or script group vars
  inventory group_vars/all
  playbook group_vars/all
  inventory group_vars/*
  playbook group_vars/*
  inventory file or script host vars
  inventory host_vars/*
  playbook host_vars/*
  host facts
  play vars
  play vars_prompt
  play vars_files
  role vars (defined in role/vars/main.yml)
  block vars (only for tasks in block)
  task vars (only for the task)
  role (and include_role) params
  include params
  include_vars
  set_facts / registered vars
  extra vars (always win precedence)  


For roles you would generally use myrole/defaults/main.yml for easily overridable vars (e.g. installation path or smth) and use myrole/vars/main.yml for vars that you don't want to be easily overridden (smth like required packages).