Im tring to translate a play i have that is using curl to use uri and nothing works for me
this is the what works for now:
- name: install via shell
shell: “curl -k --fail --connect-timeout 1 --max-time 1200 -X "POST" "https://127.0.0.1:8080/v0/upload\” -H "Authorization: Bearer {{ login.json.access_token }}" -H "Content-Type: multipart/form-data" -F "in_file=@/home/user/bundles/{{ item.key }}_docker.zip.bin""
loop: “{{ template|dict2items }}”
now i have translated this to uri:
- name: install
become: yes
uri:
url: “https://127.0.0.1:8080/v0/upload”
headers:
Authorization: “Bearer {{ login.json.access_token }}”
Accept: application/json
Content-Type: multipart/form-data
validate_certs: no
body_format: form-multipart
method: POST
timeout: 1200
remote_src: yes
body:
in_file:
filename: “/home/user/bundles/{{ item.key }}_docker.zip.bin”
mime_type: application/octet-stream
loop: “{{ template | dict2items }}”
because this file is encrypted for some reason the uri module doesnt upload it correctly
in my server that the file is posted to , need to run some decryped script
and the file using the uri module is uploaded as not binary file if i open it - it looks like a certificate file inside and also the file size is bigger
if i uploads it using curl and open the file i can see the file is binary file and the file size is smaller
what is hapening? why is the uri module changing the file?
please help?