title: Ansible "set_fact" repository url from json file using filters like "from_json"
body: <p>Using Ansible "set_fact" module, I need to get repository url from json file using filters like "from_json". I tried in couple ways, and still doesn't get it how is should work.</p>
  
  <pre><code>- name: initial validation
    tags: bundle
    hosts: localhost
    connection: local
  
    tasks:
    - name: register bundle version_file
      include_vars:
        file: '/ansible/playbook/workbench-bundle/bundle.json'
      register: bundle
  
    - name: debug registered bundle file
      debug:
        msg: '{{ bundle }}'
  </code></pre>
  
  <p>I get json that I wanted:</p>
  
  <pre><code>TASK [debug registered bundle file] ************************************************
  ok: [127.0.0.1] =&gt; {
      "msg": {
          "ansible_facts": {
              "engine-config": "git@bitbucket.org/engine-config.git",
              "engine-monitor": "git@bitbucket.org/engine-monitor.git",
              "engine-server": "git@bitbucket.org/engine-server.git",
              "engine-worker": "git@bitbucket.org/engine-worker.git"        
      },
          "changed": false
      }
  }
  </code></pre>
  
  <p>And then I'm trying to select each value by key name to use this value as URL to "npm install" each package in separate instances.</p>
  
  <pre><code>  - name: set_fact some paramater
      set_fact:
        engine_url: "{{ bundle.('engine-server') | from_json }}"
  </code></pre>
  
  <p>And then I get error: </p>
  
  <blockquote>
    <p>fatal: [127.0.0.1]: FAILED! => {"failed": true, "msg": "template error
    while templating string: expected name or number. String: {{
    bundle.('engine-server') }}"}</p>
  </blockquote>
  
  <p>I many others ways like this <a href="https://stackoverflow.com/questions/35403769/how-to-read-json-file-using-ansible">loopkup</a>, and it still fails with others errors. Can someone help to understand, how I can find each parameter and store him as  "set_fact"? Thanks</p>