I following the technique suggested in how to read json file using ansible
<https://stackoverflow.com/questions/35403769/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?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/f4f129f1-bbaa-4b5e-856a-afb5f1a6e86c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.