title: Ansible - Map an array of objects to a different array of objects
body: <p>Is there a way to map an array of objects in Ansible Playbook to a different array of objects? Let's say we have a source array being:</p>
  
  <pre><code>arr:
    - value: a
    - value: b
    - value: c
  </code></pre>
  
  <p>And what we want is to get a different array based on objects in the first array, let's say:</p>
  
  <pre><code>arr2:
    - const: 1
      var: a
    - const: 1
      var: b
    - const: 1
      var: c
  </code></pre>
  
  <p>This would be doable by an element template of:</p>
  
  <pre><code>const: 1
  var: {{ value }}
  </code></pre>
  
  <p>Is there a way to apply such a template to every element in an array? I haven't found an appropriate <code>map</code> filter, as <code>lookup('template', ...)</code> cannot be used inside <code>map</code>.</p>