brocade / ansible

55 stars 33 forks source link

brocade_interface_fibrechannel returns OK when fos_user_name has insufficient privileges #95

Open mgoetze5 opened 2 years ago

mgoetze5 commented 2 years ago

I tried to change some port configuration as "user" rather than as "admin" and got ok: [fcsw-gts-a1.srv.tgos.de] => {"GET_url": "https://********/rest/running/brocade-interface/fibrechannel", "POST_resp_code": 405, "POST_resp_data": {"errors": {"@xmlns": "urn:ietf:params:xml:ns:yang:ietf-restconf", "error": {"error-app-tag": "Error", "error-info": {"error-code": "25", "error-module": "rest"}, "error-message": "Method not supported", "error-path": "/rest/running/brocade-interface/fibrechannel", "error-tag": "operation-not-supported", "error-type": "application"}}}, "POST_resp_reason": "Method Not Allowed", "POST_url": "https://********/rest/logout", "add_entries": .... IMHO the task should fail when it gets a 4xx response.

daniel-chung-broadcom commented 2 years ago

REST API requires admin level permission. As far as I could tell, the original failure is 405 against the /rest/running/brocade-inteface/fibrechannel as expected. Do you mind clarifying what you would like to see differently? Thanks.

mgoetze5 commented 2 years ago

Yes, the REST level correctly returned an error, my problem is the Ansible level translated this to a green "OK" task and continued executing the rest of the playbook, expected behaviour would be for Ansible to mark this as a red "failed" task and abort execution of the playbook.

daniel-chung-broadcom commented 2 years ago

got it. I'll take a look. Thanks

daniel-chung-broadcom commented 2 years ago

Will you be able to share the playbook for repro? I have some questions as to why post operation is being used. Thanks.

mgoetze5 commented 2 years ago

Hi Daniel, I won't be able to provide full context as I'm using a custom inventory plugin that reads from our CMDB, but basically:

tasks:

Presumably POST is used because I'm configuring all 48 ports at once which would be too much data for a GET.

daniel-chung-broadcom commented 2 years ago

Thanks. I"ll keep you posted on the investigation.

prasad-valmeti-broadcom commented 1 year ago

Do you see this issue if the number of ports is not 48? Is it specific to more data? This will help to test and figure out the issue. Also please clarify ansible version and fos version used.

prasad-valmeti-broadcom commented 1 year ago

No response to the questions asked. Could you please clarify the questions to work on this issue?

prasad-valmeti-broadcom commented 1 year ago

Please respond to the questions. If there are no issues, please suggest if we close the issue.

mgoetze5 commented 8 months ago

@prasad-valmeti-broadcom I feel like I provided more than enough information at the time. Asking me to do testing for you with code and an environment I no longer have access to two years later seems somewhat optimistic.

prasad-valmeti-broadcom commented 8 months ago

Thank you for the details. Issue is addressed in the latest ansible and FOS versions. Please let us know if we can close the issue.

mgoetze5 commented 8 months ago

Which patch addressed the issue?

prasad-valmeti-broadcom commented 5 months ago

We tried Ansible 1.3.3 with FOS 9.1, issue was not reproduced.

prasad-valmeti-broadcom commented 5 months ago

Please let us know if you see issues if you use the same or above Ansible and FOS releases.