Bug 1658172
| Summary: | [RFE] launch_ansible_job fails to launch Ansible Tower workflow jobs | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Peter McGowan <pmcgowan> | ||||
| Component: | Automate | Assignee: | Lucy Fu <lufu> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Nandini Chandra <nachandr> | ||||
| Severity: | high | Docs Contact: | Red Hat CloudForms Documentation <cloudforms-docs> | ||||
| Priority: | high | ||||||
| Version: | 5.10.0 | CC: | cbolz, dmetzger, lavenel, mkanoor, nachandr, obarenbo, pmcgowan, rspagnol, simaishi, tfitzger | ||||
| Target Milestone: | GA | Keywords: | FutureFeature, RFE, TestOnly, ZStream | ||||
| Target Release: | 5.11.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | 5.11.0.1 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1763859 (view as bug list) | Environment: | |||||
| Last Closed: | 2019-12-13 14:54:21 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | CFME Core | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1763859 | ||||||
| Attachments: |
|
||||||
|
Description
Peter McGowan
2018-12-11 12:40:58 UTC
Sorry I was incorrect, ManageIQ_Providers_AnsibleTower_AutomationManager_ConfigurationScript is now a ManageIQ_Providers_AnsibleTower_AutomationManager_ConfigurationWorkflow object I believe for a workflow Peter, Regarding your step 2 - In CloudForms Automate, try to call the workflow job using /AutomationManagement/AnsibleTower/Operations/StateMachines/Job/default What does it mean? How did you do that? Does it work if you run it as a service? Thanks. Hi Lucy You can run a playbook through /AutomationManagement/AnsibleTower/Operations/StateMachines/Job/default by calling /System/Request/ansible_tower_job and passing a parameter pair of: job_template_name <template_name> A service works fine, but then a service isn't calling this method. Thanks New commit detected on ManageIQ/manageiq-content/master: https://github.com/ManageIQ/manageiq-content/commit/c699cd8fdbb39a930c4f21747f6e10dd40ff801e commit c699cd8fdbb39a930c4f21747f6e10dd40ff801e Author: Lucy Fu <lufu> AuthorDate: Wed Dec 19 10:42:17 2018 -0500 Commit: Lucy Fu <lufu> CommitDate: Wed Dec 19 10:42:17 2018 -0500 Changes to launch_ansible_job to support Ansible Tower workflow template. https://bugzilla.redhat.com/show_bug.cgi?id=1658172 content/automate/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job.class/__methods__/launch_ansible_job.rb | 5 +- content/automate/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job.class/__methods__/wait_for_completion.rb | 2 +- spec/content/automate/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job.class/__methods__/launch_ansible_job_spec.rb | 87 +- 3 files changed, 71 insertions(+), 23 deletions(-) New commit detected on ManageIQ/manageiq-automation_engine/master: https://github.com/ManageIQ/manageiq-automation_engine/commit/f828fe218a846e5b72e0d22885ee8e73c7d329dd commit f828fe218a846e5b72e0d22885ee8e73c7d329dd Author: Lucy Fu <lufu> AuthorDate: Wed Dec 19 10:38:06 2018 -0500 Commit: Lucy Fu <lufu> CommitDate: Wed Dec 19 10:38:06 2018 -0500 Add helper method #create_job for Ansible Tower Job/Workflow template. https://bugzilla.redhat.com/show_bug.cgi?id=1658172 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configuration_script.rb | 4 + lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configuration_workflow.rb | 4 + spec/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configuration_script_spec.rb | 8 + spec/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configuration_workflow_spec.rb | 8 + 4 files changed, 24 insertions(+) Hi Pete/Lucy,
I ran an automation simulation of an Ansible workflow on a CFME 5.11.0.22 appliance.
Attached screen shot shows the simulation details.
The workflow was eventually successfully run on Ansible Tower.
Here is a snippet from automation.log. Do these steps verify this BZ ?
[----] I, [2019-08-30T18:31:06.298892 #8534:2b134a3c40b4] INFO -- : Updated namespace [AutomationManagement/AnsibleTower/Operations/StateMachines/Job/launch_ansible_job ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines]
[----] I, [2019-08-30T18:31:06.306784 #8534:2b134a3c40b4] INFO -- : Invoking [inline] method [/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job/launch_ansible_job] with inputs [{}]
[----] I, [2019-08-30T18:31:06.308335 #8534:2b134a3c40b4] INFO -- : <AEMethod [/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job/launch_ansible_job]> Starting
[----] I, [2019-08-30T18:31:06.782415 #8534:2b134ecf43d8] INFO -- : <AEMethod launch_ansible_job> Processing Job Template simulation-workflow
[----] I, [2019-08-30T18:31:06.787009 #8534:2b134ecf43d8] INFO -- : <AEMethod launch_ansible_job> Job Arguments {:extra_vars=>{}, :limit=>"ansible-host1-dnd"}
[----] I, [2019-08-30T18:31:51.930881 #8534:2b134ecf43d8] INFO -- : <AEMethod launch_ansible_job> Scheduled Job ID: 42 Ansible Job ID: 6709
[----] I, [2019-08-30T18:31:51.953239 #8534:2b134a3c40b4] INFO -- : <AEMethod [/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job/launch_ansible_job]> Ending
[----] I, [2019-08-30T18:31:51.953306 #8534:2b134a3c40b4] INFO -- : Method exited with rc=MIQ_OK
[----] I, [2019-08-30T18:31:51.953707 #8534:2b134a3c40b4] INFO -- : Processed State=[Launch] with Result=[ok]
[----] I, [2019-08-30T18:31:51.953771 #8534:2b134a3c40b4] INFO -- : Processed State=[Launch]
[----] I, [2019-08-30T18:31:51.953927 #8534:2b134a3c40b4] INFO -- : Next State=[WaitForCompletion]
[----] I, [2019-08-30T18:31:51.954141 #8534:2b134a3c40b4] INFO -- : Processing State=[WaitForCompletion]
[----] I, [2019-08-30T18:31:52.236338 #8534:2b134a3c40b4] INFO -- : Updated namespace [AutomationManagement/AnsibleTower/Operations/StateMachines/Job/wait_for_completion ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines]
[----] I, [2019-08-30T18:31:52.243763 #8534:2b134a3c40b4] INFO -- : Invoking [inline] method [/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job/wait_for_completion] with inputs [{}]
[----] I, [2019-08-30T18:31:52.248144 #8534:2b134a3c40b4] INFO -- : <AEMethod [/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job/wait_for_completion]> Starting
[----] I, [2019-08-30T18:32:36.530112 #7741:2b1345b525c4] INFO -- : User [admin] with current group ID [1] name [Tenant My Company access]
[----] I, [2019-08-30T18:32:36.532459 #7741:2b1345b525c4] INFO -- : Instantiating [/System/Process/Event?EventStream%3A%3Aevent_stream=453&MiqServer%3A%3Amiq_server=1&User%3A%3Auser=1&event_id=453&event_stream_id=453&event_type=workflow_job_create&object_name=Event&vmdb_object_type=event_stream]
[----] I, [2019-08-30T18:32:36.549031 #7741:2b1345b525c4] INFO -- : Updated namespace [/System/Process/Event?EventStream%3A%3Aevent_stream=453&MiqServer%3A%3Amiq_server=1&User%3A%3Auser=1&event_id=453&event_stream_id=453&event_type=workflow_job_create&object_name=Event&vmdb_object_type=event_stream ManageIQ/System]
[----] I, [2019-08-30T18:32:36.563330 #7768:2b1345b525c4] INFO -- : User [admin] with current group ID [1] name [Tenant My Company access]
[----] I, [2019-08-30T18:32:36.565727 #7768:2b1345b525c4] INFO -- : Instantiating [/System/Process/Event?EventStream%3A%3Aevent_stream=454&MiqServer%3A%3Amiq_server=1&User%3A%3Auser=1&event_id=454&event_stream_id=454&event_type=job_create&object_name=Event&vmdb_object_type=event_stream]
[----] I, [2019-08-30T18:32:36.582873 #7768:2b1345b525c4] INFO -- : Updated namespace [/System/Process/Event?EventStream%3A%3Aevent_stream=454&MiqServer%3A%3Amiq_server=1&User%3A%3Auser=1&event_id=454&event_stream_id=454&event_type=job_create&object_name=Event&vmdb_object_type=event_stream ManageIQ/System]
[----] I, [2019-08-30T18:32:36.607586 #7741:2b1345b525c4] INFO -- : Following Relationship [miqaedb:/System/Event/EmsEvent/ANSIBLETOWER/workflow_job_create#create]
[----] I, [2019-08-30T18:32:36.628390 #7741:2b1345b525c4] INFO -- : Updated namespace [miqaedb:/System/Event/EmsEvent/ANSIBLETOWER/workflow_job_create#create ManageIQ/System/Event/EmsEvent]
[----] I, [2019-08-30T18:32:36.639479 #7768:2b1345b525c4] INFO -- : Following Relationship [miqaedb:/System/Event/EmsEvent/ANSIBLETOWER/job_create#create]
[----] I, [2019-08-30T18:32:36.661406 #7768:2b1345b525c4] INFO -- : Updated namespace [miqaedb:/System/Event/EmsEvent/ANSIBLETOWER/job_create#create ManageIQ/System/Event/EmsEvent]
[----] I, [2019-08-30T18:32:36.747767 #7741:2b1345b525c4] INFO -- : Instance [/ManageIQ/System/Event/EmsEvent/ANSIBLETOWER/workflow_job_create] not found in MiqAeDatastore - trying [.missing]
[----] I, [2019-08-30T18:32:36.754852 #7741:2b1345b525c4] INFO -- : Followed Relationship [miqaedb:/System/Event/EmsEvent/ANSIBLETOWER/workflow_job_create#create]
[----] I, [2019-08-30T18:32:36.778913 #7768:2b1345b525c4] INFO -- : Instance [/ManageIQ/System/Event/EmsEvent/ANSIBLETOWER/job_create] not found in MiqAeDatastore - trying [.missing]
[----] I, [2019-08-30T18:32:36.785537 #7768:2b1345b525c4] INFO -- : Followed Relationship [miqaedb:/System/Event/EmsEvent/ANSIBLETOWER/job_create#create]
[----] I, [2019-08-30T18:32:40.312492 #8534:2b134a3c40b4] INFO -- : <AEMethod [/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job/wait_for_completion]> Ending
[----] I, [2019-08-30T18:32:40.312603 #8534:2b134a3c40b4] INFO -- : Method exited with rc=MIQ_OK
[----] I, [2019-08-30T18:32:40.312909 #8534:2b134a3c40b4] INFO -- : Processed State=[WaitForCompletion] with Result=[ok]
[----] I, [2019-08-30T18:32:40.312970 #8534:2b134a3c40b4] INFO -- : Processed State=[WaitForCompletion]
[----] I, [2019-08-30T18:32:40.313104 #8534:2b134a3c40b4] INFO -- : Next State=[]
[----] I, [2019-08-30T18:32:40.313184 #8534:2b134a3c40b4] INFO -- : Followed Relationship [miqaedb:/AutomationManagement/AnsibleTower/Operations/StateMachines/Job/default#create]
[----] I, [2019-08-30T18:32:40.313563 #8534:2b134a3c40b4] INFO -- : Followed Relationship [miqaedb:/System/Request/ansible_tower_job#create]
Nandini, To test this BZ, create a custom button by calling /System/Request/ansible_tower_job and passing a parameter pair of: job_template_name <template_name> Simulation works as well. Created attachment 1611224 [details]
screen shot of Ansible workflow simulation
Verified in 5.11.0.22 |