title: How to assign ansible variable output to another variable from nested list
body: <p>I need help to perform join operation of Ansible task output. I have output as below:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;ansible_facts&quot;: {
          &quot;server_and_its_status&quot;: [
              {
                  &quot;name&quot;: &quot;server1&quot;,
                  &quot;session&quot;: &quot;enabled&quot;
              },
              {
                  &quot;name&quot;: &quot;server2&quot;,
                  &quot;session&quot;: &quot;enabled&quot;
              }
          ]
      },
      &quot;changed&quot;: false
  }
  </code></pre>
  <p>I want the output to be formatted as:</p>
  <pre class="lang-yaml prettyprint-override"><code>{ 
  &quot;server1&quot;: &quot;enabled&quot;
  &quot;server2&quot;: &quot;enabled&quot;
  }
  </code></pre>
  <p>I have tried many ways to get the output from my task as below but no luck:</p>
  <pre class="lang-yaml prettyprint-override"><code>- name: Get the server details
    set_fact:
      server_and_its_status: &quot;{{ jsondata1 | json_query('data.member[].nodes[].{name: name, session: sessionStatus}') | join(':','name','session') }}&quot;
  </code></pre>
  <p>How can I achieve this?</p>