title: Ansible template module not parsing with_items variable
body: <p>I am using a simple template with only variables in it.
  This is how my task looks like in my playbook (actually a role being used from my playbook):</p>
  
  <pre><code>- name: Ensure the conf file exists
    template:
      src: file.conf.j2
      dest: '/opt/file.conf'
    with_items: '{{ myrole }}'
  </code></pre>
  
  <p>I keep variables in group_vars. Any variable in <code>file.conf.j2</code> will be expanded correctly, like <code>{{ myrole_user }}</code> but fails when expanding one of with_items variables, like <code>{{ myrole.applicationName }}</code>.</p>
  
  <p>My group_vars looks like this:</p>
  
  <pre><code>myrole_user: regularuser
  myrole:
    -  { applicationName: foo, othervar: bar }
  </code></pre>
  
  <p>And this is the Ansible error:</p>
  
  <blockquote>
    <p>"msg": "AnsibleUndefinedVariable: 'list object' has no attribute 'applicationName'"</p>
  </blockquote>