title: Ansible create list with 'with_items'
body: <p>I want to create a new list through a loop. I created a task like this. Ansible 2.9.10</p>
  <pre><code>- name: &quot;Generate list&quot;
    set_fact:
      dst: &quot;{{dst_list | default([])}} + [ '{{ item[0] }}' ]&quot; 
    with_items:
      - &quot;{{failed_connections}}&quot;
  - debug: var=dst
  
  
  &quot;failed_connections&quot;: [
      [
          &quot;1.1.1.1&quot;, 
          8888
      ], 
      [
          &quot;1.1.1.1&quot;, 
          8080
      ], 
      [
          &quot;2.2.2.2&quot;, 
          8888
      ], 
      [
          &quot;2.2.2.2&quot;, 
          8080
      ], 
      [
          &quot;2.2.2.2&quot;, 
          443
      ]
  ]
  </code></pre>
  <p>I end up only getting the last item in the list.</p>
  <pre><code>TASK [access-consul-kv : Generate list] 
  
  *********************************************************************************************
  ok: [127.0.0.1] =&gt; (item=[u'1.1.1.1', 8888])
  ok: [127.0.0.1] =&gt; (item=[u'1.1.1.1', 8080])
  ok: [127.0.0.1] =&gt; (item=[u'2.2.2.2', 8888])
  ok: [127.0.0.1] =&gt; (item=[u'2.2.2.2', 8080])
  ok: [127.0.0.1] =&gt; (item=[u'2.2.2.2', 443])
  
  TASK [access-consul-kv : debug] *****************************************************************************************************ok: [127.0.0.1] =&gt; {
      &quot;dst&quot;: [
          &quot;2.2.2.2&quot;
      ]
  }
  </code></pre>
  <p>How can I get a list of all addresses and preferably only unique ones?</p>