title: Ansible - How to combine multiple disparate lists into to use in tasks loop
body: <p>I have 3 lists like below</p>
  <pre><code>users:
    - &quot;['user1', 'user2']&quot;
  permissions:
    - &quot;[['Read'], ['Read', 'Write']]&quot;
  topics:
    - &quot;[['Topic1', 'Topic2'], ['Topic3', 'Topic4', 'Topic5']]&quot;
  </code></pre>
  <p>That I want to combine into a structure similar to this</p>
  <pre><code>  combined_lists:
      [
          {'user1', 'Read','Topic1'},
          {'user1', 'Read','Topic2'},
          {'user2', 'Read','Topic3'},
          {'user2', 'Read','Topic4'},
          {'user2', 'Read','Topic5'},
          {'user2', 'Write','Topic3'},
          {'user2', 'Write','Topic4'},
          {'user2', 'Write','Topic5'}
      ]
  </code></pre>
  <p>So that I can use it in a task like below</p>
  <pre><code>- name: Generate ACL command and run
    shell: |
      echo &quot; kafka-acls --bootstrap-server broker1:9092 --command-config /kafka/configs/client.properties --add --allow-principal User:{{ item.0 }} --operation {{ item.1 }} --topic {{ item.2 }}&quot;
    loop:
        &quot;{{ combined_lists }}&quot;
  </code></pre>
  <p>Can someone suggest what module should I use or look at to combine the lists which are lists of lists in the format that can be used to generate and execute the kafka-acl command ?  I tried to look at cartesian module but wasn't able to get it to work this way.</p>
  <p>Appreciate any pointers regarding what modules to look at to achieve the outcome.</p>
  <p>Thank you</p>