Ansible Tower plugin

4 minute readExtensibilityDeveloper productivity

Plugin version 1.1.0

Revised on April 29, 2022

Overview

This plugin provides CloudBees CD/RO integration to Ansible Tower, allowing you to run Ansible playbooks.

Note the following:

  • Ansible Tower inventory tracks hosts, but does not track deployed artifacts.

  • The plugin does not automatically populate inventory.

    • You can specify your deployed artifacts, which are then populated in the inventory during a successful deployment to your hosts.

    • You can extract artifacts with a user-defined regexp.

  • Inventory is not updated when a component is not present.

Supported versions

The plugin has been tested with the following versions:

  • Ansible Automation Platform Controller 4.1.0

Plugin configurations

Plugin configurations are sets of parameters that apply across some or all of the plugin procedures. They reduce repetition of common values, create predefined parameter sets for end users, and securely store credentials where needed. Each configuration is given a unique name that is entered in designated parameters on procedures that use them.

Creating plugin configurations

To create plugin configurations in CloudBees CD, do these steps:

  • Go to Administration Plugins to open the Plugin Manager.

  • Find the EC-AnsibleTower-1.1.0 row.

  • Click Configure to open the Configurations page.

  • Click Create Configuration as per the description of parameters below.

Configuration procedure parameters

ParameterDescription

Configuration Name

Unique name for the configuration

Description

Configuration description

Ansible Tower Server

Auth Scheme

Authorization scheme for the third-party connection.

Check Connection?

If checked, the connection endpoint and credentials entered as part of the configuration will be tested. If this option is checked, configuration will not be saved if the test fails.

Debug Level

This option sets debug level for logs. If info is selected, only summary information will be shown, for debug, there will be some debug information and for trace the whole requests and responses will be shown.

Modeling third-party deployments

You can model third-party deployments using the Ansible Tower plugin and Service Catalog item.

To model a third-party deployment with Ansible Tower:

  1. Navigate to the Service Catalog.

  2. Select Deploy.

  3. Select your project.

  4. Enter your deployment model details, including the Ansible Tower configuration, job template ID, and regular expression.

  5. Select OK.

    When you deploy the catalog item, the system creates an application and an environment.

The application contains a three-step component without artifacts.

  1. Runs the Ansible playbook. This process requires the Ansible Tower plugin.

  2. A placeholder that allows you to add logic to extract artifacts.

  3. Seeds the artifacts into the path-to-production inventory.

    For more information, refer to Service Catalogs.

Plugin procedures

Create a Job Template

This procedure creates a job template.

Create a Job Template parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

JSON body

JSON body to send

Output parameters

ParameterDescription

result

The REST API result.

id

The ID of the job template.

link

A link to the job template.

Create an Inventory

This procedure creates an inventory.

Create an Inventory parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

JSON body

The JSON body to send.

Output parameters

ParameterDescription

result

The REST API result

id

The ID of the inventory.

link

A link to the inventory.

Launch a Job Template

This procedure launches a job template.

Launch a Job Template parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Job Template Id

The ID of the job template to launch.

Job Template Parameters

Parameters of the Job Template to launch. For example: { "extra_vars": {"foo": "bar"} }

Output parameters

ParameterDescription

result

The REST API result.

id

The ID of the launched job.

link

A link to the launched job.

Launch and Wait a Job Template

This procedure launches a job template and waits for its execution.

Launch and Wait a Job Template parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Job Template Id

The ID of the job template to launch.

Job Template Parameters

Parameters of the job template to launch. For example: { "extra_vars": {"foo": "bar"} }

Job Status Polling Interval

Specifies the frequency, in seconds, to check the job status.

Depend On Ansible Tower Job Result?

Checks to enable depend on job status mechanics. In this case, the job result is synchronized with the Ansible Tower job result.

Output parameters

ParameterDescription

result

The REST API result.

id

The ID of the launched job.

link

A link to the launched job

job_status

The status of the launched Job.

stdout

STDOUT from the finished job.

List Inventories

This procedure lists all the inventories.

List Inventories parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Output parameters

ParameterDescription

result

The REST API result.

List Job Templates

This procedure lists all job templates.

List Job Templates parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Output parameters

ParameterDescription

result

The REST API result.

List Organizations

This procedure lists all the organizations.

List Organizations parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Output parameters

ParameterDescription

result

The REST API result.

List Projects

This procedure lists all the projects.

List Projects parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Output parameters

ParameterDescription

result

The REST API result.

Retrieve a Job Template

This procedure retrieves a job template.

Retrieve a Job Template parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Job Template Id

The ID of the job template to retrieve.

Output parameters

ParameterDescription

result

The REST API result.

link

A link to the job template.

Retrieve an Inventory

This procedure retrieves an inventory.

Retrieve an Inventory parameters

ParameterDescription

Configuration Name

Previously defined configuration for the plugin

Inventory Id

The ID of the inventory to retrieve.

Output parameters

ParameterDescription

result

The REST API result.

link

A link to the inventory.

Release notes

EC-AnsibleTower 1.1.0

  • First release.