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. 

 [1;35m[WARNING]: Unable to find 'include/Browsers-CollectionDB.json' in 
expected paths (use [0m

 [1;35m-vvvvv to see paths) [0m
 [1;35m [0m
 [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'"} [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"*            body: "{{ 
lookup('file','include/Browsers-CollectionDB.json') }}"
*            user: "{{ARANGODB_USER}}"
            password: "{{ARANGODB_PASS}}"
            method: POST
            force_basic_auth: yes
            status_code: 200

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2f7bb622-a963-454b-a694-a72580b18283%40googlegroups.com.

Reply via email to