Description of problem: The details of this BZ are confusing but I will do my best to explain all the reproduction steps here. Essentially, if you create a custom button under a generic object class of the "Ansible Playbook" type, and point it at a playbook catalog item, create and add a generic object instance to a service under my service, then click the button to execute the playbook, it doesn't do anything. If the button is not associated with the generic object class, then it will execute. Version-Release number of selected component (if applicable): 5.11.0.25 How reproducible: 100% Steps to Reproduce: 1. Enable embedded ansible role 2. Add a repo with some playbooks (e.g. https://github.com/ManageIQ/integration_tests_playbooks.git) 3. Add some Ansible credentials for a VMware provider 4. Create a catalog named "Catalog VMware" 5. Create a catalog item "VMware Catalog Item" under this catalog that executes a playbook, if you're using the above repo you can use e.g. "gather_all_vms_from_vmware.yml" 6. Order the service catalog and ensure that the playbook runs successfully 7. Now create a separate catalog "Test Custom Button" 8. Create a "generic" catalog item under this catalog "test custom button" 9. Order this service and ensure that the service appears under My Services 10. Create a generic object class "Test class" 11. Create a custom button of type "Ansible Playbook" that uses the catalog item "VMware Catalog Item", with "Request" -> "Order_Ansible_Playbook" 12. Create a generic object instance under "Test class" 13. Associate the generic object instance with the service "Test Custom Button" This can be done by REST action "add_resource" or by the rails console 14. Navigate to Services > My services > Services > Active Services > Test Custom Button 15. In the generic objects summary table, there should be one instance associated with the service, click this instance 16. Click the generic object quadicon 17. The custom button you created in step 11 should be displayed, click that button. 18. Hit submit Actual results: The playbook is not executed, no trace of the playbook being triggered in the logs at all Expected results: The playbook should be executed Additional info: If you create a button in "Automation > Automate > Customization > Buttons > Generic Objects" (i.e. not associated with a generic object class, but does the same thing as the button in step 11) then this button also appears on the page in step 17, and clicking this button DOES result in the playbook being executed. I am not sure if this is a valid use case, but I would still expect it to work given that it works for the scenario in the sentence above. Note: there are several BZs associated with custom buttons that are associated with the generic object classes bug 1753237, 1753281 It is not clear whether this is an embedded ansible issue or a generic object custom button issue.
Note that for step 11., the custom button must be made under: Automation > Automate > Generic Objects > All Generic Object Classes
Can the associated logs be attached for analysis?
Hey John, has that appliance been updated? I'm not seeing services or custom buttons on it.
Drew, the original appliance was deleted and likely that IP was assigned to a different appliance.
Ah, then may I please have another reproducer?
`:attrs=>{"request"=>"Order_Ansible_Playbook"` vs `:attrs=>{:request=>"Order_Ansible_Playbook"` The nonworking one looks like it's using keys that are strings, not symbols.
I guess comment 15 is a symptom of the fact that we're storing uri_attributes for custom_buttons like this: CustomButton.find(3).uri_attributes => {"request"=>"Order_Ansible_Playbook", :service_template_name=>"list VMs playbook", :hosts=>"localhost"} as both strings and symbols, which certainly can't be great in the UI when hitting, for example, https://github.com/ManageIQ/manageiq-ui-classic/blob/cec300bbea3bb7ab4e46b17400b07bdc4b593804/app/controllers/miq_ae_customization_controller/custom_buttons.rb#L70.
Hey Harpreet, based on comment 17 and comment 18, could I get you to please take a look at this one?
https://github.com/ManageIQ/manageiq-ui-classic/pull/6533
New commit detected on ManageIQ/manageiq-ui-classic/master: https://github.com/ManageIQ/manageiq-ui-classic/commit/1048a770cd9a862543f1daec2f76e2a10995fa13 commit 1048a770cd9a862543f1daec2f76e2a10995fa13 Author: Harpreet Kataria <hkataria> AuthorDate: Wed Dec 11 16:03:23 2019 -0500 Commit: Harpreet Kataria <hkataria> CommitDate: Wed Dec 11 16:03:23 2019 -0500 Fixed code to pass in `service_template` in ae_attributes hash When creating a new GO Playbook custom button, code expects service_template to be included in the ae_attributes hash in order to save the value correctly inside uri_attributes. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1753338 app/assets/javascripts/components/generic_object/main-custom-button-form.js | 1 + spec/javascripts/components/generic_object_definition/main-custom-button-form_spec.js | 1 + 2 files changed, 2 insertions(+)
The method was missing the service template name in the root object, we provided that, it all ran well. I believe that Harpreet's original fix addresses a valid issue.