Bug 1480019 - Ansible Automation: missing group id in manageiq payload
Summary: Ansible Automation: missing group id in manageiq payload
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.8.0
Hardware: All
OS: All
Target Milestone: GA
: 5.9.0
Assignee: Lucy Fu
QA Contact: Dmitry Misharov
Depends On:
Blocks: 1481445
TreeView+ depends on / blocked
Reported: 2017-08-09 23:59 UTC by Kevin Morey
Modified: 2018-03-06 15:23 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1481445 (view as bug list)
Last Closed: 2018-03-06 15:23:32 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:

Attachments (Terms of Use)

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):

How reproducible:

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": "", 
        "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": "", 
        "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:

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.

 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 Group id is presented in manage iq payload.

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