title: ansible group vars vs extra vars with parameterized include tasks
body: <p>I'm seeing a value defined in my <code>group_vars/all</code> where I expect to see the overridden value from my <code>-e @local-vars.yml</code> file. In normal cases, the <code>-e</code> wins as per the documentation, but in this more complex case of using parameterized includes, it seems the <code>-e</code> value is not involved at the right time.</p>
  
  <p><strong>playbooks/wtf-vars.yml</strong></p>
  
  <pre><code>---
  - hosts: appservers
    tasks:
      - name: WTF is up with this var
        debug: msg={{var1}}
      - include: "{{playbook_dir}}/tasks/wtf-vars-included.yml var1inner={{var1}}"
  </code></pre>
  
  <p><strong>playbooks/tasks/wtf-vars-included.yml</strong></p>
  
  <pre><code>---
  - name: WTF is up with this var included
    debug: msg={{var1inner}}
  </code></pre>
  
  <p><strong>playbooks/group_vars/all</strong></p>
  
  <pre><code>---
  var1: VALUE_FROM_GROUP_VAR_ALL
  </code></pre>
  
  <p><strong>local-vars.yml</strong></p>
  
  <pre><code>---
  var1: VALUE_FROM_DASH_E_FILE
  </code></pre>
  
  <p>Running it with:</p>
  
  <p><code>ansible-playbook -i inventory/local-dev.ini -e @local-vars.yml playbooks/wtf-vars.yml</code> prints this output:</p>
  
  <pre><code>PLAY [appservers] *************************************************************
  
  TASK: [WTF is up with this var] ***********************************************
  ok: [va] =&gt; {
      "msg": "VALUE_FROM_DASH_E_FILE"
  }
  ok: [vb] =&gt; {
      "msg": "VALUE_FROM_DASH_E_FILE"
  }
  
  TASK: [WTF is up with this var included] **************************************
  ok: [vb] =&gt; {
      "msg": "VALUE_FROM_GROUP_VAR_ALL"
  }
  ok: [va] =&gt; {
      "msg": "VALUE_FROM_GROUP_VAR_ALL"
  }
  
  PLAY RECAP ********************************************************************
  va                         : ok=2    changed=0    unreachable=0    failed=0
  vb                         : ok=2    changed=0    unreachable=0    failed=0
  
  ansible-playbook -i inventory/local-dev.ini -e @local-dev.yml   0.27s user 0.22s system 78% cpu 0.628 total
  </code></pre>
  
  <p>So my question is why doesn't the <code>-e</code> value win in both of these cases?</p>