title: Ansible variable scope clash
body: <p>I've got an <a href="https://www.ansible.com/" rel="nofollow">ansible</a> setup that looks like this</p>
  
  <pre><code>inventories/
      sandbox1
      group_vars/
         all
         sandbox1
  pb/
      pb1/
          run_pb1.yml
  </code></pre>
  
  <p>I've got roles and other stuff too, but I think this is enough to capture the gist of what I need to do.</p>
  
  <p>I've got a variable <strong>foo</strong> that I am defining inside</p>
  
  <pre><code>inventories/group_vars/all
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>inventories/group_vars/sandbox1
  </code></pre>
  
  <p>Now my issue is that whenever I call</p>
  
  <pre><code>ansible-playbook -i inventories/sandbox1 pb/pb1/run_pb1.yml
  </code></pre>
  
  <p>The playbook is run with the value of <strong>foo</strong>
   that is contained in <strong>inventories/group_vars/all</strong>... put another way, the value of foo from <strong>inventories/group_vars/sandbox1</strong> is not overriding the "global/all" version.</p>
  
  <p>Is this the correct way to implement an inventory specific variable? I want to avoid creating mulitple playbooks for something as simple as a variable change... ie, I do not want to do something like this inside the "all" file</p>
  
  <pre><code>default_foo: bar
  sandbox1_foo: baz
  </code></pre>
  
  <p>along with multiple playbooks, which would be the same except for the variable they reference.</p>
  
  <p>Is there a way to do what I am asking?</p>