title: Convert list of objects (string, string) into Dictionary (string, list<string>) in Ansible
body: <p>I have a list of objects (each object contains two attributes of type string) which I need to convert into Dictionary. The first attribute of the object will become a key, the second attribute of the object would have to be combined into a list of strings.</p>
  
  <p>I went through several solutions but couldn't find exactly what I need.</p>
  
  <p><strong>Input Example:</strong></p>
  
  <pre><code>[
      {
          "name": "AAA",
          "value": "111"
      },
      {
          "name": "AAA",
          "value": "222"
      },
      {
          "name": "BBB",
          "value": "333"
      },
      {
          "name": "BBB",
          "value": "444"
      },
      {
          "name": "CCC",
          "value": "555"
      }
  ]
  </code></pre>
  
  <p><strong>Desired Outputs (either one works):</strong></p>
  
  <pre><code>[
      {
          "name": "AAA",
          "value": [ "111", "222" ]
      },
      {
          "name": "BBB",
          "value": [ "333", "444" ]
      },
      {
          "name": "CCC",
          "value": [ "555" ]
      }
  ]
  </code></pre>
  
  <pre><code>[
      "AAA": [ "111", "222" ],
      "BBB": [ "333", "444" ],
      "CCC": [ "555" ]
  ]
  </code></pre>