Start a Conversation

Unsolved

10 Posts

2265

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\"?>1013Bad request body

The JSON you provided was not well-formed.ils>false", "content_length": "219", "content_type": "application/xml", "date": "Wed, 01 Apr 2020 14:23:
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:

http://doc.isilon.com/ECS/3.2/API/BucketService_setBucketACL_98919dd290b71afe51274a98d1c3f79f_e652c976d9be14caf2ca84a7c175d88c_detail.html

Thank you.

April 1st, 2020 14:00

Hi Jeff,

 

In order to try and get the proper group/resource to try and help you, I need to ask some basic questions:

  1)  What Ansible Modules are you using?

  2) Where did you download them from? (Do you have the link you could share?)

If I was to guess (and I don't like to guess!), you may need help from the ECS team. With the above info, we might be able to narrow that down.

 

Let me know,

 

Jay Farrell

jay.farrell@dell.com

 

10 Posts

April 1st, 2020 15:00

I am not using any Ansible modules. I wasn't aware that EMC had created any for the ECS platform. I am only using API calls for creation tasks. S3 is not involved at all with these steps.

Thank you.

72 Posts

April 1st, 2020 16:00

Have you tried the PUT operation using a different REST client like postman or something to validate the JSON data that your sending outside of the Ansible context?

72 Posts

April 2nd, 2020 17:00

I have used this tool in the past and it has helped a bit to find YAML syntax issues

https://yamllint.readthedocs.io/en/stable/index.html

April 7th, 2020 05:00

It seems the issue was resolved. It appears there was a syntax error, there was a missing "-".

I just wanted to share that update.

No Events found!

Top