Usage
There are several ways to get the desired profile to run during the VM lifecycle:
1. Attach vRA Property Group to vRA Blueprint
When the SovLabs Configuration is created, a vRA property group for that configuration is also created. That Property Group contains a custom property of SovLabs_AnsibleTowerProfile
with a value of the profile name.
By setting this property to the profile name, we enable that profile to run during the machine’s lifecycle.
The vRA Event Broker Subscription (EBS) created during the configuration of the SovLabs modules controls the order in which the various integrations will run.
The easiest way to enable the profile for your build is to add the SovLabs Property group to the vRA blueprint, either at the blueprint level, or at the machine level.
- Login to vRealize Automation.
- Click on the Design tab > Blueprints
- Click the blueprint name to Edit it
- Click on the vSphere machine component on the Blueprint Design Canvas
- Click on the Properties tab
- In the Property Groups section, add the vRA property group for Ansible Tower:
- Property Group name:
SovLabs-AnsibleTowerProfile-[tenant]_[profile_shortname]
- Property Group name:
Repeat for all desired vRA blueprints and provision!
2. Set the SovLabs Custom Property to the desired profile name
Instead of adding a Property Group to the blueprint, a more streamlined method is to simply set the SovLabs Custom Property to the desired profile name.
This can be done with the Profile Name as a hardcoded value.
For the Ansible Tower module, the SovLabs Custom Property is SovLabs_AnsibleTowerProfile
You can set the SovLabs vRA profile properties on any component in vRA that allows Custom Properties to be created.
Just remember to keep track of where you set them!
3. The SovLabs profile can be chosen dynamically using the SovLabs Template Engine
For this example, assume there is a vRA Custom Property called location and it’s value is set to “Norcross”.
If we want to use one Ansible Tower profile for the “Norcross” location and different one for any other location, you could write a template that does this:
if location is “Norcross”, set the SovLabs_AnsibleTowerProfile
property to
my_Ansibletower_profileA
otherwise set it to
my_Ansibletower_profileB
Template Syntax: {% if location == "Norcross" %}my_Ansibletower_profileA{% else %}my_Ansibletower_profileB{% endif %}
Result: SovLabs_AnsibleTowerProfile
is set to my_Ansibletower_profileA
If location had been set to something other than “Norcross”, the result: SovLabs_AnsibleTowerProfile
is set to my_Ansibletower_profileB
*See documentation on the SovLabs Template Engine and the SovLabs Template Tester .
Disable
If you enabled the integration by adding the Property Group to the Blueprint, remove it
- Login to the vRA tenant
- Click on the Design tab > Blueprints
- Hover over the desired blueprint name and click Edit
- Click on the vSphere machine component on the Blueprint Design Canvas
- Click on the Properties tab
- In the Property Groups section, remove the vRA property group for Ansible Tower:
- Property Group name:
SovLabs-AnsibleTowerProfile-[tenant]_[profile_shortname]
- Property Group name:
Repeat Step 3 for all desired blueprints
Or, unpublish the Event Broker Subscriptions for Ansible Tower (Recommended)
Unpublishing the Event Broker Subscriptions is a non-destructive and simple way to disable the workflows for SovLabs module Ansible Tower module from running for all builds.
- Login to the vRA tenant
- Click on the Administration tab -> Events -> Subscriptions
- Highlight the Event Broker subscription and click Unpublish
The vRA EBS will go to “Draft” mode and will not execute until you click “Publish” to publish it again.
Synchronize Ansible Tower Inventory
Only able to perform on Static Inventory Type
- Login to vRA tenant
- Click on the Items tab
- Click on the SovLabs vRA Extensibility Modules menu option (left-pane)
- Click on the SovLabs Ansible Tower Inventory Profile menu option (left-pane)
- Find the desired Ansible Tower Inventory Profile and click on Actions
- Click on Synchronize Ansible Tower Inventory to request
- Click Submit
Synchronize Ansible Tower Inventory
Field | Value |
---|---|
Synchronize Ansible Tower Inventory | |
Configuration label |
Read-only field of the SovLabs Ansible Tower Inventory Profile to perform a sync |
Note |
Click 'Submit' to update groups and hosts in the Ansible Tower Inventory to match the SovLabs Ansible Tower Inventory Profile |
Configure Ansible Tower Custom Inventory
Only able to perform on Dynamic Inventory Type
- Login to vRA tenant
- Click on the Items tab
- Click on the SovLabs vRA Extensibility Modules menu option (left-pane)
- Click on the SovLabs Ansible Tower Inventory Profile menu option (left-pane)
- Find the desired Ansible Tower Inventory Profile and click on Actions
- Click on Configure Ansible Tower Custom Inventory to request
- Fill out the form accordingly (see below) and Submit
Configure Ansible Tower Custom Inventory
Field | Value |
---|---|
Ansible Tower Inventory Profile | |
Configure Custom Inventory? |
Select to create the cache directory and dynamic inventory configuration YAML file on the indicated Ansible Tower endpoint |
Ansible Tower Host Access | |
Ansible Tower Endpoint |
Read-only field provided as a reference References the Ansible Tower Endpoint selected in the previous tab |
Ansible Tower Hostname |
Read-only field provided as a reference Displays the full Ansible Tower Endpoint's URL. The cache directory and dynamic inventory configuration YAML file will be placed in the |
Command for privilege escalation (e.g. sudo) |
The command for the type of Linux the Ansible Tower server is using. If the Host Username defined below has root privilege, this field can be left blank |
Host Username |
A username who is in the sudoer file or otherwise root privilege |
Host Password |
Host username's password |
Field | Value |
---|---|
vRO Host |
Auto-generated and may be overwritten by the user The URL of the vRO Host |
vRO Port |
Auto-generated and may be overwritten by the user The Port of the vRO Host |
vRO Username |
The vRO Username of the vRO Host |
vRO Password |
The Password for the vRO Username |
Field | Value |
---|---|
Organization Setup | |
Create Organization? |
Select to create a new Organization or use an existing one |
Organization Name |
Create Organization? is not checked Auto-generated list based on Ansible Tower Endpoint selected Select a desired Organization Create Organization? is checked Type in the new Organization name to create |
Description |
Shown when 'Create Organization?' is checked New Organization description |
Inventory Setup | |
Create Inventory? |
Select to create a new Inventory or use an existing one |
Inventory Name |
Create Inventory? is not checked Auto-generated list based on Ansible Tower Endpoint selected Select a desired Inventory Create Inventory? is checked Type in the new Inventory name to create |
Description |
Shown when 'Create Inventory?' is checked New Inventory description |
Group Setup | |
Create Group? |
Select to create a new Group or use an existing one |
Group Name |
Create Group? is not checked Auto-generated list based on Ansible Tower Endpoint selected Select a desired Group Create Group? is checked Type in the new Group name to create |
Description |
Shown when 'Create Group?' is checked New Group description |
Inventory Source Setup | |
Create Inventory Source? |
Option only available to Ansible Tower 3.2+ Select to create a new Inventory Source or use an existing one |
Inventory Source Name |
Create Inventory Source? is not checked Auto-generated list based on Ansible Tower Endpoint selected Select a desired Inventory Source Create Inventory Source? is checked Type in the new Inventory Source name to create |
Description |
Shown when 'Create Inventory Source?' is checked New Inventory Source description |
Inventory Script Setup | |
Inventory Script Options |
Select from the provided options |
Inventory Script Name |
Inventory Script Options is either of the 'Assign to Group' option is selected Auto-generated list based on Ansible Tower Endpoint and Organization selected. If Organization is blank, gets all Select a desired Inventory Source Inventory Script Options is Create new with Latest Custom Inventory Type in the new Inventory Script name to create |
Description |
New Inventory Script description |