Ansible Tower
5 minute read
To learn more about this OneFuse module, refer to Ansible Tower.
Prerequisites
- Configure OneFuse Property Set(s) and OneFuse Module Policies.
- Install OneFuse XUI per CloudBolt CMP.
- Review an overview on OneFuse Modules with CloudBolt CMP.
- Create a new Blueprint (if none exist) or determine which existing Blueprint(s) will utilize this OneFuse Module. Resource: Blueprints.
Configure the Blueprint
- Know the name of the OneFuse Connection Info created via OneFuse XUI initial setup.
- Determine which OneFuse Ansible Tower Policies to run for this Blueprint.
- Determine when to run each OneFuse Ansible Tower Policy for the deployment provisioning lifecycle with CMP’s Trigger Points.
- Update the Blueprint to add in necessary parameters to invoke OneFuse Ansible Tower Policies.
- Deploy the Blueprint to provision a deployment and run Provision Job Template(s).
- Destroy the Deployment to run Deprovision Job Template(s), if any.
Update the Blueprint
- Log in to CloudBolt CMP.
- If not already on the Catalog page, select Catalog from the main menu.
- Search and find the desired CloudBolt Blueprint.
- Edit the Blueprint by selecting the gear icon on the bottom-right of the Catalog Item.
Add in necessary parameters
The following Parameters need to exist on the Blueprint.
Learn more about CloudBolt Parameters for: Blueprints, Environments, and Groups.
Call an Ansible Tower Policy:
| Parameter Name Format | Parameter Value Format |
|---|---|
OneFuse_AnsibleTowerPolicy_<ExecutionString>_<CustomID>- Replace <ExecutionString> with an appropriate Trigger Point state - Replace <CustomID> with a unique, user-defined friendly label. |
<OneFuse Connection Info Name>:<Ansible Tower Policy Name>:<Ansible Tower Host>:<Ansible Tower Limit> - (Optional) <Ansible Tower Host> is a specific Hostname (FQDN) or IP Address of the Host to add to the Ansible Tower Inventory. - (Optional) <Ansible Tower Limit> is a valid Limit definition to pass to Ansible Tower. This can be a specific Hostname (FQDN) or IP Address or any valid Limit pattern. See Patterns: targeting hosts and groups. (It is recommended to insert a required filter for the <Ansible Tower Limit>. When left blank, it will execute an Ansible Tower Job on the entire Ansible Host Inventory. Refer to example below.) |
Example Parameter:
# Example CustomID
Apache
BackupClient
WebApp
Ansible Tower Trigger Point States
ExecutionString refers to a specific Trigger Point for the OneFuse Module’s policy to execute on.
Replace the <ExecutionString> variable with one of the following values in the Trigger Point Execution String column:
| Job / Process | Trigger Point Name | Trigger Point Execution String | Run Sequence | Plugin Action Name |
|---|---|---|---|---|
| Provision Server | Generated Hostname Overwrite | HostnameOverwrite |
1010 | OneFuse - Provision Ansible Tower |
| Provision Server | Pre-Create Resource | PreCreateResource |
1010 | OneFuse - Provision Ansible Tower |
| Provision Server | Pre-Application Installation | PreApplication |
1010 | OneFuse - Provision Ansible Tower |
| Provision Server | Post-Provision | PostProvision |
1010 | OneFuse - Provision Ansible Tower |
| Delete Server | Post-Delete | - | 15 | OneFuse - De-Provision Ansible Tower |
CustomID
CustomID refers to a user specified text string to identify and can set an order of precedence for execution when calling multiple Policies for the OneFuse Module in the same Trigger Point.
Replace the <CustomID> variable with a unique custom identifier:
- Format is alphanumeric characters only
A-Z, a-z, 0-9. No spaces, underscores, hyphens, or special characters. - Must be unique across all Trigger Point Execution Strings for the OneFuse Module on the specific resource for the Blueprint.
- Is reusable either between different VM components of the same Blueprint or between different Blueprints.
# Example CustomID
Apache
BackupClient
WebApp
Specify sorting with CustomID:
When executing multiple different OneFuse Module’s Policies in the same Trigger Point, prefix the <CustomID> with a numeric value (for example, 001, 002, etc).
The <CustomID> is sorted prior to executing the OneFuse module’s policies.
# Example CustomID with sorting
001Apache
002WebApp
003BackupClient
Additional helpful properties passed to OneFuse module
Purpose: Relate OneFuse Policy executions from different OneFuse Modules together with a Tracking ID.
| Property and Parameter | Value Format |
|---|---|
OneFuse_Tracking_Id |
A GUID (globally unique identifier) that links OneFuse Policy Executions and the resulting Managed Objects together for a given resource on a deployment. The first OneFuse Module Policy execution will populate this Parameter and it will be passed into other OneFuse Modules automatically. Learn more about OneFuse Tracking ID. |
When a Tracking ID is not provided, a Tracking ID gets generated for the Policy execution.
Purpose: Reference a specific NIC’s values to get hostname, IP Address, etc.
| Property Format | Example |
|---|---|
OneFuse_VmNic<#>.<value> |
See examples below |
Replace <#> with a number from 0 to 9, one for each NIC.
Replace <value> with an appropriate key: assignment, dnsServers, dnsSuffix, fqdn, gateway, hostname, ipAddress, label, mac, network, nicLabel, target
For most use cases, NIC 0 is the primary network interface and the target hostname is a Fully Qualified Domain Name (FQDN).
Examples:
OneFuse_VmNic0.dnsSuffixOneFuse_VmNic0.fqdnOneFuse_VmNic0.hostnameOneFuse_VmNic0.ipAddressOneFuse_VmNic0.target: when DNS Suffix is provided, will be the FQDN; otherwise, will be the hostname (without domain).
Purpose: Reference VM hardware information: cpu, memory, etc.
| Property Format | Example |
|---|---|
OneFuse_VmHardware.<value> |
See examples below |
Replace <value> with an appropriate key: cpuCount, memoryGB, memoryMB, platformUuid, powerState, totalStorageGB
Examples:
OneFuse_VmHardware.cpuCountOneFuse_VmHardware.memoryGBOneFuse_VmHardware.platformUuidOneFuse_VmHardware.powerStateOneFuse_VmHardware.totalStorageGB
Provision
Deploy a Blueprint with OneFuse Ansible Tower module configured. Ansible Tower Provisioning Job Template(s) will run on the resource(s) and add the host to the Ansible Tower Inventory (if configured).
Outputs
The following parameter will have the generated OneFuse Ansible Tower Managed Object as a JSON string on the resource.
| Parameter Name | Parameter Value Format |
|---|---|
OneFuse_AnsibleTower_<CustomID> |
JSON string of OneFuse Ansible Tower Managed Object |
Deprovision
Destroy an existing resource with OneFuse Ansible Tower Module configured. Ansible Tower Deprovisioning Job Template(s) will run and remove the host from the Ansible Tower Inventory (if configured).
Trigger Points
| Job / Process | Trigger Point Name | Trigger Point Execution String | Run Sequence | Plugin Action Name |
|---|---|---|---|---|
| Provision Server | Generated Hostname Overwrite | HostnameOverwrite |
1010 | OneFuse - Provision Ansible Tower |
| Provision Server | Pre-Create Resource | PreCreateResource |
1010 | OneFuse - Provision Ansible Tower |
| Provision Server | Pre-Application Installation | PreApplication |
1010 | OneFuse - Provision Ansible Tower |
| Provision Server | Post-Provision | PostProvision |
1010 | OneFuse - Provision Ansible Tower |
| Delete Server | Post-Delete | - | 15 | OneFuse - De-Provision Ansible Tower |