title: Multiple loops in ansible task
body: <p>I'm trying to use vars to perform loops in ansible but I'm struggling to get them to work. The documentation talks about the <code>loop</code> attribute but as far as I can tell, this only works if you have one loop in a task. </p>
  
  <p>Is it possible to use different loops in a task or must it be split into different tasks?</p>
  
  <pre><code>- name: "Configure ufw"
        ufw:
          policy: "{{ defaults.policy }}"
          direction: "{{ defaults.direction }}"
          rule: allow
          src: "{{ rules }}"
          logging: on
          state: enabled
        vars:
          defaults:
            - { direction: incoming, policy: deny }
            - { direction: outgoing, policy: allow }
          rules:
            - 80/tcp
            - 443/tcp
  </code></pre>
  
  <p>When I run the code I get the error</p>
  
  <blockquote>
    <p>"msg": "The task includes an option with an undefined variable. The error was: 'list object' has no attribute 'direction'</p>
  </blockquote>