title: Ansible: Merge dictionaries within a list adding values to a list
body: <p>How can I merge dictionaries within the list with the some properties that are the same and have the values of the properties that are different added to a list value of merged dictionary?</p>
  <pre><code>[
        {
          &quot;name&quot;: &quot;samename&quot;,
          &quot;content&quot;: &quot;content1&quot;
        },
        {
          &quot;name&quot;: &quot;samename&quot;,
          &quot;content&quot;: &quot;content2&quot;
        },
        {
          &quot;name&quot;: &quot;differentname&quot;,
          &quot;content&quot;: &quot;content3&quot;
        }
      ]
  </code></pre>
  <p>Desired output:</p>
  <pre><code>[
        {
          &quot;name&quot;: &quot;samename&quot;,
          &quot;content&quot;: [&quot;content1&quot;, &quot;content2&quot;]
        },
        {
          &quot;name&quot;: &quot;differentname&quot;,
          &quot;content&quot;: &quot;content3&quot;
        }
      ]
  </code></pre>