title: Add a new key-value to a json file using Ansible
body: <p>I'm using Ansible to automate some configuration steps for my application VM, but having difficult to insert a new key-value to an existing json file on the remote host.</p>
  
  <p>Say I have this json file:</p>
  
  <pre><code>{
    "foo": "bar"
  }
  </code></pre>
  
  <p>And I want to insert a new key value pair to make the file become:</p>
  
  <pre><code>{
    "foo": "bar",
    "hello": "world"
  }
  </code></pre>
  
  <p>Since json format is not line based, I'm excluding <code>lineinfile</code> module from my options. Also, I would prefer not to use any external modules. Google keeps giving me examples to show how to read json file, but nothing about change json values and write them back to file. Really appreciate your help please!</p>