title: Ansible, list object has no attribute
body: <p>I am using Ansible 2.3.0.0 and I have tested in Ansible 2.4.0.0, obtaining the same result. My problem is very simple, but I cannot see the problem.</p>
  
  <p>I have defined a list of objects in Ansible as follows:</p>
  
  <pre><code>  vars:
       password_text_to_encrypt:
            - { line: "{{truststore_pass }}" , regexp: '\${TRUSTSTORE_PASS}*'}
            - { line: "{{ keystore_pass }}" , regexp: '\${KEYSTORE_PASS}*'}
            - { line: "{{ gp_pass }}" , regexp: '\${GP_PASS}*'}
            - { line: "{{ datasource_password }}" , regexp: '\${DATASOURCE_PASS}*'}
            - { line: "{{ server_password }}" , regexp: '\${SERVER_PASSWORD}*'}
            - { line: "{{ sftp_password }}" , regexp: '\${SFTP_PASSWORD}*'}
            - { line: "{{ db_userpassword }}" , regexp: '\${DB_PASSWORD}*'}
       roles:
         - basic_role
  </code></pre>
  
  <p>My Basic_role just prints the items, and I would like to obtain the content of each line:</p>
  
  <pre><code>---
  
  - name: "print password"
    debug: 
      msg: "The content of the line is: {{ item.line}}"
    with_nested:
      - "{{password_text_to_encrypt}}"
  </code></pre>
  
  <p>But the result that I obtain is: </p>
  
  <pre><code>FAILED! =&gt; {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'list object' has no attribute 'line'\n\nThe error appears to have been in.....
  </code></pre>
  
  <p>If I change <code>item.line</code> to just <code>item</code>, it works but it prints:</p>
  
  <pre><code>ok: [localhost] =&gt; (item=[u'regexp', u'line']) =&gt; {
      "item": [
          "regexp",
          "line"
      ],
      "msg": "The content of the line is: [u'regexp', u'line']"
  }
  .
  .
  .
  </code></pre>
  
  <p>To summarize, Ansible does not consider the content of line o regexp. I have been doing tests and the variable which are used to init line and regexp are not empty.</p>