title: How to access to list of all ansible extra-vars, passed from the cli? (Variable of variable)
body: <p>I have a problem with accessing to extra-vars from my playbook with variable-of-variable way.
  For example, I created a group_vars/mygroup.yml file with content:</p>
  
  <pre><code>MYVAR=AAAA
  </code></pre>
  
  <p>Then I call command and pass extra-vars:
      ansible-playbook -i test playbook.yml --extra-vars "MYVAR=BBB"</p>
  
  <p>I need to get actual value of MYVAR from list of exists variables. I tried to do this:</p>
  
  <pre><code>- debug: var=hostvars[inventory_hostname]['MYVAR']
  </code></pre>
  
  <p>...I getting</p>
  
  <pre><code>TASK: [test | debug var=AAA] *******************************
  ok: [192.168.1.21] =&gt; {
      "var": {
          "AAA": "BBB"
      }
  }
  
  TASK: [test | debug var=hostvars[inventory_hostname]['AAA']] ***
  ok: [192.168.1.21] =&gt; {
      "var": {
          "hostvars[inventory_hostname]['AAA']": "AAA"   // ← THIS IS THE PROBLEM
      }
  }
  </code></pre>
  
  <p>How I can get actual value of AAA, that passed from cli?
  Please, <em>don't say to me to just use AAA directly by name</em>, because this is a part of more complex logic, when I have a list of registered variables and I can't use their names.</p>
  
  <pre><code>hostvars[inventory_hostname][**item**] ← variable of variable
  </code></pre>
  
  <p>Thank you in advance.</p>
  
  <p>Update: <strong>OR</strong> maybe Ansible already supports something like this?:</p>
  
  <pre><code>VARNAME: APP_ENV
  APP_ENV: blabla
  debug: var=${VARNAME} // blabla expected
  </code></pre>
  
  <p>Update 2: The <a href="https://gist.github.com/KIVagant/bf33525ffea1def0186d" rel="nofollow">github gist</a> with problem explanation.</p>