title: Ansible: Create variables from json string
body: <p>In Ansible, is there a way to convert a dynamic list of key/value pairs that are located in a JSON variable into variable names/values that can be accessed in a Playbook without using the filesystem?</p>
  
  <p>IE - If I have the following JSON in a variable (in my case, already imported from a URI call):</p>
  
  <pre><code>{
          "ansible_facts": {
              "list_of_passwords": {
                  "ansible_password": "abc123",
                  "ansible_user": "user123",
                  "blue_server_password": "def456",
                  "blue_server_user": "user456"
              }
  }
  </code></pre>
  
  <p>Is there a way to convert that JSON variable into the equivelant of:</p>
  
  <pre><code>vars:
    ansible_password: abc123
    ansible_user: user123
    blue_server_password: def456
    blue_server_user: user456
  </code></pre>
  
  <p>Normally, I'd write the variable to a file, then import it using <code>vars_files:</code>. Our goal is to not write the secrets to the filesystem.</p>