title: Ansible looping over nested variables
body: <p>I have a set of variables which define FQDNs.</p>
  
  <pre><code>domains:
    - erp: erp.mycompany.com
    - crm: crm.mycompany.com
    - git: git.mycompany.com
  </code></pre>
  
  <p>Indeed, I both need to loop over them and access them namely (in a template file). So accessing them like <code>domains.erp</code>works like a charm. But I can't get ansible to loop over these. </p>
  
  <p>Obviously, if I do:</p>
  
  <pre><code>- name: Print domains
    debug:
      msg: test {{ item }}
    with_items:
      - "{{ domains }}"
  </code></pre>
  
  <p>It prints both the key and the value… And if I do:</p>
  
  <pre><code>- name: Print domains
    debug:
      msg: test {{ domains[{{ item }}] }}
    with_items:
      - "{{ domain }}"
  </code></pre>
  
  <p>But that doesn't work. I also tried the <a href="http://docs.ansible.com/ansible/playbooks_loops.html#looping-over-hashes" rel="nofollow">hashes form</a> as mentionned in the docs, but didn't get any luck either…</p>