Bug 1466232

Summary: extra_vars missing in retirement_job_options
Product: Red Hat CloudForms Management Engine Reporter: Kim Borup <kborup>
Component: AutomateAssignee: Drew Bomhof <dbomhof>
Status: CLOSED NOTABUG QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8.0CC: dbomhof, gblomqui, jfrey, jhardy, mkanoor, obarenbo, tfitzger
Target Milestone: GA   
Target Release: cfme-future   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: automate:retirement
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-05 19:20:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Ansible Target Upstream Version:
Embargoed:

Description Kim Borup 2017-06-29 10:01:44 UTC
Description of problem:
Variables used when provisioning using ansble, does not get used when doing a retirement. 

How reproducible:
All the time

Steps to Reproduce:
1. Create ansible playbook for provision and retirement that uses a variable.
2. create service dialog that ask for variable name
3. Create Catalog item that uses service dialog. 
4. Order Catalog item providing name for variable. 
5. Retire Service item which will then fail. 

Actual results:
Variable does not get passed during retirement.

Expected results:
Variable from provisioning get added when doing retirement in order to link to the correct projects in ie OCP.

Additional info:
From API. 

        "dialog": {
            "dialog_credential": "10",
            "dialog_hosts": "host.example.com",
            "dialog_param_projectname": "thedebug"
        },
        "provision_job_options": {
            "hosts": "host.example.com",
            "extra_vars": {
                "projectname": "thedebug"
            },
            "credential": "3",
            "inventory": 16
        },
        "retirement_job_options": {
            "hosts": "host.example.com",
            "extra_vars": {},
            "inventory": 17
        }
    },

        "retirement_job_options": {
            "hosts": "host.example.com",
            "extra_vars": {}, <- This is where i would expect the extra vars from provisioning to be as you can see from the provision_job_options.

Comment 2 Drew Bomhof 2017-09-05 19:20:33 UTC
Hi Kim,

Retirement was designed to run without user input. 

If 'copy from provision' is clicked at service creation / edit, the extra_vars from provision would be copied over.  However, if the dialog is modified to expect user input, that input will not be pushed into the retirement task.  In my opinion this is working as expected.