IBM-Security / isam-ansible-roles

DEPRECATED Ansible Custom Modules, Handlers and Tasks for ISAM. Requires "ibmsecurity" python package.
Apache License 2.0
24 stars 43 forks source link

create_mgmt_root_dir wrong use of API #25

Closed dreezey closed 7 years ago

dreezey commented 7 years ago

Hi,

The create_mgmt_root_dir Ansible role utilizes the following action: ibmsecurity.isam.web.reverse_proxy.management_root.directory.create This function has the following signature: create(isamAppliance, instance_id, id, name, check_mode=False, force=False)

Upon executing a task using this role, I received the following trace: [DEBUG] [ibmsecurity.appliance.ibmappliance] [_process_response():64] Text: [{\"name\":\"ISAM Base Appliance\",\"description\":\"IBM Security Access Manager Base Appliance\",\"id\":\"wga\",\"enabled\":\"True\"}]\n", "msg": "Error> action does not have the right set of arguments or there is a code bug! Options: isamAppliance=isam_server, force=False, instance_id=\"rp-demotest\", id=\"management/C\", filename=\"dirname\"", "name": "ibmsecurity.isam.web.reverse_proxy.management_root.directory.create"}

This is due to an incorrect mapping in the actual task: see here.

Which according to the API should use "name" instead of "filename".

I'll open a Pull Request in order to resolve this issue.

Kind regards, Dries Eestermans

P.S.: A restart of the reverse proxy instance should also be issued, this will be added via the PR as well.

ram-ibm commented 7 years ago

Please note that Reverse Proxy does NOT need to be restarted for changes to the file taking effect. So I deliberately left out the handler call to restart reverse proxy. I realize that reverse proxy does get flagged as requiring a restart - which I would like to submit a RFE.

Let me know if you need the restart handler - will hold off on merging the pull request.

dreezey commented 7 years ago

As suggested, the restart handler has been removed.

ram-ibm commented 7 years ago

Looks like I merged in the wrong order - I will submit another change with the handler removed.