I following the technique suggested in how to read json file using ansible suggestion in Stackoverflow, and I do this
`
- set_fact:
version_file: “{{ lookup(‘file’,‘/opt/gitlab/version-manifest.json’) | from_json }}”
installed_version: version_file.build_version
`
However I get the error
`
TASK [gitlab-ce : set_fact] ****************************************************
[WARNING]: Unable to find ‘/opt/gitlab/version-manifest.json’ in expected
paths.
fatal: [host.domain.com]: FAILED! => {“failed”: true, “msg”: “An unhandled exception occurred while running the lookup plugin ‘file’. Error was a <class ‘ansible.errors.AnsibleError’>, original message: could not locate file in lookup: /opt/gitlab/version-manifest.json”}
to retry, use: --limit @/var/tmp/jenkins/team_SCSCM/gitlab-ce/install-gitlab-ce/ansible-playbooks/gitlab-ce.retry
PLAY RECAP *********************************************************************
rtp-scm-lnx26.cisco.com : ok=5 changed=0 unreachable=0
`
The file is there on the remote machine. What gives?