Description of problem: The launch_ansible_job lookup in / ManageIQ / ConfigurationManagement / AnsibleTower / Operations / StateMachines / Job / launch_ansible_job will always returned the first element of the result. I have two Ansible Tower providers with a Job Template in each of them with same name (e.g. Dev & Prod environments). Running an Ansible Tower from a button on a VM will always pick-up the first Ansible template job. The alternative would be to specify a job template id but i cannot see it anywhere in the UI. Version-Release number of selected component (if applicable): 5.6.1.2.20160810181333_8ba817b How reproducible: Always Steps to Reproduce: 1. Have two Ansible Tower provider setup in CloudForms. Each provider has a Job Template performing two actions but with the same name. 2. Add a button to run the job template on a VM. 3. Run the job template by clicking on the button. Actual results: CloudForms will look up for the job template by name and only return the first job template and run it (in the first Ansible Tower provider). Expected results: I want to be able to specify which Ansible Tower provider to use (similar to Service Items) in launch_ansible_job or a way to find out the job template id from the UI to specify it when creating my button on the VM. Additional info:
Can we have the automation.log for this issue. We do support passing in the job_template_id into the method which can pick up a template by id. How is the job being launched is it thru a button or thru instances in the Automate State Machine as part of some other provisioning workflow.
(In reply to mkanoor from comment #2) > Can we have the automation.log for this issue. > We do support passing in the job_template_id into the method which can pick > up a template by id. > How is the job being launched is it thru a button or thru instances in the > Automate State Machine as part of some other provisioning workflow. I agree that job_template_id would work. However, as I mentioned earlier, there is no way to find the job_template_id from the UI. As an operator, it is then impossible to complete this use case, where two job templates have the same name on different Ansible Tower providers. I have attached a screenshot. I am suggesting to add the option to specify the Ansible provider name as a parameter for Ansible_Tower_Job. This way, an operator can launch the job template without having to look up its job_template_id.
Created attachment 1206333 [details] Ansible_Tower_Job - impossible to specify Ansible Tower Provider
https://github.com/ManageIQ/manageiq/pull/11669
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/23f8ac3d643e3e45796e5d37e0ed56cc14df6580 commit 23f8ac3d643e3e45796e5d37e0ed56cc14df6580 Author: Madhu Kanoor <mkanoor> AuthorDate: Mon Oct 3 18:01:16 2016 -0400 Commit: Madhu Kanoor <mkanoor> CommitDate: Tue Nov 1 14:05:16 2016 -0400 Support provider name & template name to uniquely identify https://bugzilla.redhat.com/show_bug.cgi?id=1378606 Optionally support 'ansible_provider_name' to uniquely identify a job template. This is needed where you might have multiple Ansible Towers with the same named templates. .../Job.class/__methods__/launch_ansible_job.rb | 21 +++++++++++++++++---- .../method_validation/launch_ansible_job_spec.rb | 19 ++++++++++++++++++- 2 files changed, 35 insertions(+), 5 deletions(-)