title: Using variables inside json file
body: <p>I need to define a variable once and use it throughout the json file.</p>
  
  <p>Here is my MWE: (adapted from <a href="http://www.packer.io/docs/templates/user-variables.html" rel="nofollow">here</a>)</p>
  
  <pre><code>{
    "variables": {
      "my_access_key": "abc",
      "my_secret_key": "def"
    },
    "objectB": {
      "type": "1",
      "access_key": "{{user `my_access_key`}}",
      "secret_key": "{{user `my_secret_key`}}"
    },
    "objectA": {
      "type": "2",
      "access_key": "{{user `my_access_key`}}",
      "secret_key": "{{user `my_secret_key`}}"
    }
  }
  </code></pre>
  
  <p>The <code>access_key</code> field of the objects <code>objectB</code> and <code>objectA</code> must be equal to "<code>abc</code>", which  is defined by me in the beginning of the file. </p>
  
  <p>How can I achieve this goal in python?</p>