Bug 1480019 - Ansible Automation: missing group id in manageiq payload
Ansible Automation: missing group id in manageiq payload
Status: POST
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate (Show other bugs)
5.8.0
All All
medium Severity high
: GA
: 5.9.0
Assigned To: Lucy Fu
Dmitry Misharov
: TestOnly, ZStream
Depends On:
Blocks: 1481445
  Show dependency treegraph
 
Reported: 2017-08-09 19:59 EDT by Kevin Morey
Modified: 2017-08-14 17:52 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1481445 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kevin Morey 2017-08-09 19:59:31 EDT
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-09 20:36:44 EDT
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-10 22:31:36 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/5b763962bf5abf07bddbcf0818a61760e9642419

commit 5b763962bf5abf07bddbcf0818a61760e9642419
Author:     Lucy Fu <lufu@redhat.com>
AuthorDate: Thu Aug 10 14:10:40 2017 -0400
Commit:     Lucy Fu <lufu@redhat.com>
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(-)

Note You need to log in before you can comment on or make changes to this bug.