I am trying to do a post request which will upload a binary fil(.bin) using the URI module in my playbook. I am getting the below error.
Ansible playbook :
- name: Play_manage Upload the upgrade file
uri:
url: "{{ token_url.json.url }}"
user: "admin"
password: "admin@123"
method: POST
return_content: true
force_basic_auth: true
status_code: 201,204,200
headers:
Content-Type: 'multipart/form-data'
#Accept: application/json
validate_certs: false
body_format: json
body: "{{ lookup('file','{{ folder_path }}') }}"
Error Message: fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'file'. Error was a <type 'exceptions.UnicodeDecodeError'>, original message: 'utf8' codec can't decode byte 0x90 in position 1: invalid start byte"}