title: Ansible Roles Global Variables
body: <p>I use roles to deploy my machines, Roles have vars, but sometimes i have multiple role and i want to put a global variable file in the root folders, so ansible use <code>vars/global.yml</code> and <strong>overwrite</strong> <code>role/vars/main.yml</code></p>
  
  <pre><code>#vars/global.yml
  somevariable: somevalue
  </code></pre>
  
  <p>But if there is global variable in root folder, Just overwrite role based variable and implement vars/global instead.</p>
  
  <pre><code>├── Playbook.yml
  ├── ansible.cfg
  ├── roles
  │   ├── Ansible-Role-UserProfile
  │   │   ├── LICENSE
  │   │   ├── README.md
  │   │   ├── meta
  │   │   │   └── main.yml
  │   │   ├── tasks
  │   │   │   └── main.yml
  │   │   ├── templates
  │   │   │   ├── rm.j2
  │   │   │   └── vimrc.j2
  │   │   └── vars
  │   │       └── main.yml
  └── vars
      └── global.yml
  </code></pre>
  
  <p>Is anything comes which suite reusability of roles and variable natively ?</p>