Red Hat Ansible Automation

Preview

When you integrate your Dynatrace environment with Red Hat Ansible Automation controller using Red Hat Ansible Connector Red Hat Ansible for Workflows, you can automatically start job templates based on your monitoring data.

Configure the integration

To use Red Hat Ansible workflow actions, you first need to install Red Hat Ansible Connector Red Hat Ansible for Workflows from Dynatrace Hub.

  1. In Dynatrace Hub Hub, select Red Hat Ansible.
  2. Select Install and then follow the process below to grant permissions, get an Ansible API key, and configure the connection.

Step 1 Grant permissions to Workflows

Some permissions are required by Workflows to run actions on your behalf.

To fine-tune permissions granted to Workflows

  1. Go to Workflows and select Settings > Authorization settings.
  2. Select the following permissions besides the general Workflows permission.
  • Permissions needed for workflow actions:
    • app-settings:objects:read
    • state:app-states:read
    • state:app-states:write
    • state:app-states:delete

For more on general Workflows user permissions, see User permissions for workflows.

Step 2 Create Red Hat Ansible API key

To interact with Red Hat Ansible Automation Controller, you need an API key. To learn how to obtain it, see the Red Hat official documentation.

Step 3 Configure Red Hat Ansible connection

You need a configured connection for of your Red Hat Automation environments.

To configure a connection for Red Hat Ansible Automation Controller

  1. Go to Settings and select Connections > Connectors > Red Hat Ansible.
  2. Select the tab Automation Controller.
  3. Select Add Connection.
  4. Provide a meaningful name for your connection.
  5. Provide the Red Hat Ansible API URL. For example, http://your-ansible-host.com/api/v2 (must include the api/v2, no trailing slash).
  6. Provide your Red Hat Ansible API key.
  7. Select Create.

Step 4 optional Configure EdgeConnect

If you connect to a self-hosted Red Hat Ansible Automation Controller or AWX instance, you might require EdgeConnect to establish a connection behind your firewall.

To configure an EdgeConnect connection

  1. Go to EdgeConnect Management.
  2. Select EdgeConnect.
  3. Enter Name for your EdgeConnect.
  4. Enter Host pattern which is a URL.
  5. Select Create.

You have a new EdgeConnect connection.

Available actions

The following workflow actions are available for the Red Hat Ansible Automation integration. Each action corresponds to an endpoint of the Red Hat Ansible API. For details on endpoints, see the Ansible Tower API Reference Guide.

Action

Description

Red Hat Ansible API endpoint

Launch job template

Launch a job template on Red Hat Ansible

POST /api/v2/job_templates/{id}/launch/
Launch a Job Template

List job status

List job status on Red Hat Ansible

GET /api/v2/jobs/{id}/
Retrieve a Job Host Summary

Relaunch job

Relaunch a job on Red Hat Ansible

POST /api/v2/jobs/{id}/relaunch/
Relaunch a Job

Launch a job template

To launch a job template, you need to provide the information listed below.

Field
Description
Required
TemplateId
The ID of the template that you want to launch
required
ExtraVars
Extra variables to be used in the job template
optional

For details on the parameters, see the Ansible Tower API Reference Guide (/api/v2/job_templates/{id}/launch/ "Launch a Job Template").

To create a workflow that launches a job template

  1. Go to Workflows Workflows and select Add to create a new workflow.
  2. In the Choose trigger panel, select the trigger best suited to your needs.
  3. On the trigger node, select Add to browse available actions.
  4. On one of the information-extracting nodes, select Add, search for Ansible, and select Launch job template.
  5. On each of the remaining information-extracting nodes, select Add and drag the line to the Launch job template action.
  6. In the Launch job template action, select the connection to your Red Hat Ansible Automation Controller.
  7. Configure the input fields as needed. To learn how to use the output of information-extracting notes, see Expression reference.
  8. To test your workflow, select Run.

Troubleshooting

The following are solutions to problems some people have.