Red Hat Ansible for Workflows
Preview
When you integrate your Dynatrace environment with Red Hat Ansible, 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 the Red Hat Ansible for Workflows app from the Dynatrace Hub.
- In Dynatrace Hub
, search for Red Hat Ansible for Workflows.
- Select the Red Hat Ansible for Workflows app, select Install, and then follow the procedures below to grant permissions, get an Ansible API key, and configure the connection.
Grant permissions to Workflows
Some permissions are required by Workflows to run actions on your behalf. Other permissions are required by actions that come bundled with Red Hat Ansible for Workflows itself.
To fine-tune permissions granted to Workflows
- Open Workflows and go to Settings > Authorization settings.
- Make sure the following permissions are selected.
- Permissions needed for Workflows:
app-engine:functions:run
- Permissions needed for Red Hat Ansible workflow actions:
app-settings:objects:read
state:app-states:read
state:app-states:write
state:app-states:delete
- Permissions needed for Workflows:
Create Red Hat Ansible API key
To interact with Red Hat Ansible, you need an API key. To learn how to obtain it, see the Red Hat official documentation.
Configure Red Hat Ansible connection
You need a configured connection for each of your Red Hat Ansible environments.
To configure a connection
- Open the Settings app and go to Dynatrace Apps > Red Hat Connections.
- Select Add item.
Provide a meaningful name for your connection.
- Provide the Red Hat Ansible API URL. For example,
http://your-ansible-host.com/api/v2
(must include theapi/v2
, no trailing slash). Provide your Red Hat Ansible API key.
- Select Save changes.
Available actions
The following workflow actions are available for the Red Hat Ansible 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 |
|
List job status | List job status on Red Hat Ansible |
|
Relaunch job | Relaunch a job on Red Hat Ansible |
|
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
- Open Workflows
and select
to create a new workflow.
- In the Choose trigger panel, select the trigger best suited to your needs.
- On the trigger node, select
to browse available actions.
- On one of the information-extracting nodes, select
, search for
Ansible
, and select Launch job template. - On each of the remaining information-extracting nodes, select
and drag the line to the Launch job template action.
- In the Launch job template action, select the connection to your Red Hat Ansible.
- Configure the input fields as needed. To learn how to use the output of information-extracting notes, see Expression reference.
- To test your workflow, select Run.
Troubleshooting
TemplateId is required in the Launch job template action. Workflow execution fails if it's not provided.
Even with all mandatory fields provided, however, it's still possible for a workflow execution to fail. For example, a connection token could have expired or the result of an expression could lead to an input that's considered invalid.
To run workflows, Workflows needs to be allowed to read app settings on your behalf. Insufficient permissions can lead to an execution error.
To grant this permission, open Workflows , go to Settings > Authorization Settings, and select
app-settings:objects:read
.