Bug 1480019

Summary: Ansible Automation: missing group id in manageiq payload
Product: Red Hat CloudForms Management Engine Reporter: Kevin Morey <kmorey>
Component: AutomateAssignee: Lucy Fu <lufu>
Status: CLOSED CURRENTRELEASE QA Contact: Dmitry Misharov <dmisharo>
Severity: high Docs Contact:
Priority: medium    
Version: 5.8.0CC: dmisharo, gmccullo, jhardy, jmarc, kmorey, ldomb, mkanoor, nstephan, obarenbo, simaishi, tfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.9.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.9.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1481445 (view as bug list) Environment:
Last Closed: 2018-03-06 15:23:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1481445    

Description Kevin Morey 2017-08-09 23:59:31 UTC
Description of problem:
Currently when running an Ansible play book we get the manageiq object delivered. But it is missing the href of the group that launched the job. This will allow us to assign group ownership to the VMs and resources after provisioning. If not we can only guess that the user's group that launched the job is the current group which if the user launches the job and group context switches to another group the VM and resources will be assigned to the wrong group.

Version-Release number of selected component (if applicable):
5.8.1.5

How reproducible:
100%

Here is what the payload looks like now:

TASK [ec2_basic_preprovision : logging manageiq object] ************************
ok: [localhost] => {
    "manageiq": {
        "action": "Provision", 
        "api_token": "c03805d2bd18752fdbb40aee6bac3c3d", 
        "api_url": "https://10.9.61.254", 
        "service": "services/12000000000030", 
        "user": "users/12000000000001"
    }
}

What we need is output that would like like this:

TASK [ec2_basic_preprovision : logging manageiq object] ************************
ok: [localhost] => {
    "manageiq": {
        "action": "Provision", 
        "api_token": "c03805d2bd18752fdbb40aee6bac3c3d", 
        "api_url": "https://10.9.61.254", 
        "service": "services/12000000000030", 
        "user": "users/12000000000001",
        "group": "groups/12000000000002",
    }
}

Comment 2 Greg McCullough 2017-08-10 00:36:44 UTC
Lucy - The object references are passed as part of the manageiq_extra_vars.  See https://github.com/ManageIQ/manageiq/blob/master/app/models/service_ansible_playbook.rb#L63

Comment 4 CFME Bot 2017-08-11 02:31:36 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/5b763962bf5abf07bddbcf0818a61760e9642419

commit 5b763962bf5abf07bddbcf0818a61760e9642419
Author:     Lucy Fu <lufu>
AuthorDate: Thu Aug 10 14:10:40 2017 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Thu Aug 10 14:10:49 2017 -0400

    Add group in manageiq payload for ansible automation.
    
    Need to catch the group that the user is in when the job is launched in a multiple groups context.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1480019

 app/models/service_ansible_playbook.rb       | 1 +
 spec/models/service_ansible_playbook_spec.rb | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comment 6 Dmitry Misharov 2017-10-16 06:37:32 UTC
Fixed and verified in 5.9.0.2.20171010190026_0413a06. Group id is presented in manage iq payload.