Red Hat Ansible Automation
Preview
When you integrate your Dynatrace environment with Red Hat Ansible Automation controller using 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 for Workflows from Dynatrace Hub.
- In Dynatrace Hub , select Red Hat Ansible for Workflows.
- Select Install and then follow the process below to grant permissions, get an Ansible API key, and configure the connection.
Grant permissions to Workflows
Create Red Hat Ansible API key
Configure Red Hat Ansible Automation connection
Grant permissions to Workflows
Some permissions are required by Workflows to run actions on your behalf.
To fine-tune permissions granted to Workflows
- Go to Workflows and select Settings > Authorization settings.
- 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.
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.
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
- Go to Settings and select Connections > Connectors > Red Hat Ansible.
- Select the tab Automation Controller.
- Select Connection.
- 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 Create.
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.
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
- Go to 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 Automation Controller.
- 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
The following are solutions to problems some people have.