Unsolved
10 Posts
0
2391
April 1st, 2020 09:00
ECS Automation with Ansible and API Calls
I have been having an issue trying to get this one piece to work via automation. No matter what I do I keep getting an error saying that the JSON is bad. Any help would be greatly appreciated.
The forum will not let me put the coding in with proper indentation without flagging the post as spam.
Coding:
- name: add ro user to bucket acl
uri:
url: "{{ ecs_host }}/object/bucket/{{ manifest.bucket_name }}/acl"
method: PUT
validate_certs: no
headers:
X-SDS-AUTH-TOKEN: "{{ auth.x_sds_auth_token }}"
return_content: yes
body_format: json
body:
bucket: "{{ manifest.bucket_name }}"
namespace: "{{ manifest.name }}"
acl:
user_acl:
user: nbu-dev-ro
permission: READ
register: user_add_acl
- debug: var=user_add_acl
Error:
fatal: [localhost]: FAILED! => {"changed": false, "connection": "close", "content": "e=\"yes\"?>1013
25 GMT", "elapsed": 0, "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request", "redirected": false, "status": 400, "ur
l": "https://d53ecsobj001t0a:4443/object/bucket/nbu-dev-bucket/acl"}
Documentation I am referencing:
Thank you.