title: Ansible: set_fact on a json object
body: <p>I have a json object in an Ansible variable (<code>my_var</code>), which contains values similar to the following:</p>
  
  <pre><code>{
      "Enabled": "true"
      "SomeOtherVariable": "value"
  }
  </code></pre>
  
  <p>I want to modify the value of <code>Enabled</code> in <code>my_var</code> and have tried the following:</p>
  
  <pre><code>set_fact:
    my_var.Enabled: false
  </code></pre>
  
  <p>and</p>
  
  <pre><code>set_fact:
    my_var['Enabled']: false
  </code></pre>
  
  <p>Which both give errors similar to:</p>
  
  <blockquote>
    <p>"The variable name 'my_var.Enabled' is not valid. Variables must start
    with a letter or underscore character, and contain only letters,
    numbers and underscores."</p>
  </blockquote>
  
  <p>Can this be done with set_fact or is there some other way of achieving this?</p>