Hi,
below is my task where in the “body” section in the below task - I am currently using a file and it is throwing error (I actually check the location file is present there) when I am trying to run a jenkins job.
e[1;35m[WARNING]: Unable to find 'include/Browsers-CollectionDB.json' in expected paths (usee[0m
e[1;35m-vvvvv to see paths)e[0m
e[1;35me[0m
e[0;31mfatal: [10.181.56.199]: FAILED! => {"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: 'include/Browsers-CollectionDB.json'"}e[0
However when I try to actually paste data from the file and specify it in “body :” it works.
body: "{{ lookup('file','include/Browsers-CollectionDB.json') }}"
- name: Populating browsers collection
uri:
url: "http://{{groups['default'][0]}}:8529/_db/collectionDB/_api/document/browsers"
HEADER_Content-Type: "application-type: json"
<b> body: "{{ lookup('file','include/Browsers-CollectionDB.json') }}"
</b> user: "{{ARANGODB_USER}}"
password: "{{ARANGODB_PASS}}"
method: POST
force_basic_auth: yes
status_code: 200