Bug 1352012 - Extra Vars not passed to Ansible Tower when using custom state machines in service catalog
Summary: Extra Vars not passed to Ansible Tower when using custom state machines in se...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.6.1
Assignee: mkanoor
QA Contact: Pavol Kotvan
URL:
Whiteboard: service
Depends On: 1348232
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-01 12:13 UTC by John Prause
Modified: 2022-07-09 07:46 UTC (History)
7 users (show)

Fixed In Version: 5.6.1.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1348232
Environment:
Last Closed: 2016-08-18 17:54:02 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1634 0 normal SHIPPED_LIVE Important: CFME 5.6.1 security, bug fix, and enhancement update 2016-08-18 21:43:52 UTC

Comment 4 Shveta 2016-08-08 17:48:56 UTC
Hi Madhu , 

Please provider more steps to verify this bug .
 What can i specify in Postprovision for Provisioning a Vmware Catalog item .

Thanks,
Shveta

Comment 5 mkanoor 2016-08-08 20:32:01 UTC
Hi,
For this use case the customer had a regular service dialog to provision a single vm, which is different from having an "Ansible type" service, which directly works with the Ansible Job Template.

In their use case they would first provision the VM and then after provisioning run the Ansbile Job Template on the newly provisioned VM.

The dialog was built to pick up Ansible vars from the end user. So for example if they created the following 2 parameters in the service dialog which are going to be used during post provisioning when we are running the Ansible Job Template.

e.g.

param_package_name = "http"
param_package_ver  = "3.1"

These attributes are stored in the service options hash, and the earlier code wasn't looking at these fields. This fix was to look at the options hash and parse out the parameters and send it to Ansible Tower.

In the above example the parameter is stored in the options hash as
dialog_param_package_name
dialog_param_package_ver

When we send it to Ansible Tower it will go in as
package_name
package_ver

The param will be removed

When creating the dialog pleas make sure that any parameters they want to pass will be listed with param_

To test this feature you would have to update the post provision step in the Provisiong state machine to call the Ansible Tower State Machine, which is defined in ManageIQ/Infrastructure/Vm/Provisioning/StateMachines/VMProvision_Template.
You can take the PostProvision state and point it to /ConfigurationManagement/AnsibleTower/Operations/StateMachines/Job/default

During the post provision phase we will connect to Ansbile Tower and execute the Job Template.

To test this you would have to create your owns Ansible Tower Job Template, and that template should take run tine params also called extra_vars in Ansible.

To see if the Job has been executed properly you should check the Ansbile tower to see what parameters were passed in.

Thanks,
Madhu

Comment 8 errata-xmlrpc 2016-08-18 17:54:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-1634.html


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