Bug 1480019 - Ansible Automation: missing group id in manageiq payload
Ansible Automation: missing group id in manageiq payload
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate (Show other bugs)
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: 2018-03-06 10:23 EST (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)
Last Closed: 2018-03-06 10:23:32 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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):

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

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 02:37:32 EDT
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.