Bug 1739247

Summary: [v2v] Pre/post-migration playbook launch overrides Ansible Playbook service template credential
Product: Red Hat CloudForms Management Engine Reporter: Fabien Dupont <fdupont>
Component: AutomateAssignee: Fabien Dupont <fdupont>
Status: CLOSED CURRENTRELEASE QA Contact: Yadnyawalk Tale <ytale>
Severity: urgent Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: urgent    
Version: 5.11.0CC: gmccullo, mkanoor, obarenbo, simaishi, smallamp
Target Milestone: GAKeywords: Regression, TestOnly, ZStream
Target Release: 5.11.0Flags: mfeifer: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: v2v
Fixed In Version: 5.11.0.21 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1772641 (view as bug list) Environment:
Last Closed: 2019-12-13 14:55:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: V2V Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1739487, 1772641    

Description Fabien Dupont 2019-08-08 20:25:17 UTC
Description of problem:

When configuring a Migration Plan with pre or post-migration playbook, the credential set on the Ansible Playbook service template is overriden by an empty string. This leads to not passing the credential to Ansible Runner and to failing the playbook execution.

How reproducible: 100%

Steps to Reproduce:
1. Create an Ansible Playbook service template with valid credential
2. Create a migration plan using the service template as pre-migration playbook
3. Start the migration plan

Actual results: The playbook fails with host unreachable

Expected results: The playbook succeeds

Additional info:

When watching the Ansible Runner execution, we can see that the file /tmp/ansible-runnner*/env/passwords is not created.

Comment 5 CFME Bot 2019-08-16 14:27:38 UTC
New commit detected on ManageIQ/manageiq-automation_engine/ivanchuk:

https://github.com/ManageIQ/manageiq-automation_engine/commit/c85a21aeae52c1c96bfffc0e103d8958e253ad57
commit c85a21aeae52c1c96bfffc0e103d8958e253ad57
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Tue Aug 13 09:20:24 2019 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Tue Aug 13 09:20:24 2019 -0400

    Merge pull request #348 from fdupont-redhat/override_equality_comparison_method

    Override equality comparison method for MiqAeServiceModelBase

    (cherry picked from commit 0c498633308578ba84bfb52328234db1ece7c659)

    https://bugzilla.redhat.com/show_bug.cgi?id=1739247

 lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb | 4 +
 1 file changed, 4 insertions(+)

Comment 6 CFME Bot 2019-08-16 14:31:58 UTC
New commit detected on ManageIQ/manageiq-content/ivanchuk:

https://github.com/ManageIQ/manageiq-content/commit/70c5f459f954f96277920fd073ea43901b303f80
commit 70c5f459f954f96277920fd073ea43901b303f80
Author:     tina <tfitzger>
AuthorDate: Tue Aug 13 13:18:34 2019 -0400
Commit:     tina <tfitzger>
CommitDate: Tue Aug 13 13:18:34 2019 -0400

    Merge pull request #559 from fdupont-redhat/v2v_fix_launch_ansible_playbook_credentials

    [Transformation][AnsiblePlaybook] Send service_template credential id as part of service dialog

    (cherry picked from commit a2fb8c8192327d7a60697fc829b28777f9aa7ca8)

    https://bugzilla.redhat.com/show_bug.cgi?id=1739247

 content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice.rb | 5 +-
 spec/content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice_spec.rb | 131 +
 2 files changed, 135 insertions(+), 1 deletion(-)

Comment 7 Yadnyawalk Tale 2019-08-28 15:06:30 UTC
Playbook worked so fixed in 5.11.0.21.

Comment 8 Fabien Dupont 2019-11-14 18:27:18 UTC
It would be great to backport it to CFME 5.10

Comment 9 Sudhir Mallamprabhakara 2019-11-14 19:14:16 UTC
ack for back port into 5.10.z.