Ansible is a popular configuration automation tool that helps to automate infrastructure processes without exposing credentials. The Ansible integration helps IT administrators and process analysts to create Ansible playbooks to automate the administration tasks and commands. Integrating Ansible with OpsRamp helps to do agentless automation tasks for process workflows.
The Ansible integration is available only at the client level.
Target users: Client administrators and process analysts
Why use Ansible integration?
The Ansible integration enables the following:
Automating workflows using SSH without installing agents on all the remote systems.
Performing auto-remediation actions.
Scheduling tasks.
Executing an ad hoc workflow.
Integrating Ansible with OpsRamp
The Ansible integration involves installing Ansible and creating playbooks. One Ansible integration can have multiple playbooks. Every playbook represents an automation script in the YAML format. The playbook is assigned to a process automation workflow to execute the related automation tasks.
Prerequisites
Install Ansible on one of the servers in a specific environment (Ansible Control Node).
Verify if the target managed nodes and hosts are accessible through SSH with the Ansible Control Node.
Copy the full path of each Ansible script with the file name to create a playbook.
Allow OpsRamp URL in the Ansible server to download all the latest Agent packages. To download, go to the OpsRamp Console and navigate to Setup > Downloads > Agent.
Sudo permissions are required for the device user.
Navigate to Infrastructure > Resources and verify if the Ansible Control Node is visible and active.
Configure Ansible integration
Install the Ansible integration directly from the OpsRamp console.
Before starting the installation, verify if the host name and Ansible server are visible on the Infrastructure > Resources page.
Click All Clients, select a client.
Click Setup > Account.
Select the Integrations tile.
The Installed Integrations screen is displayed, with all the installed applications. Click + ADD on the Installed Integrations page.
If you do not have any installed applications, you will be navigated to the Available Integrations page. The Available Integrations page displays all the available applications along with the newly created application with the version. Note: Search for the application using the search option available. Alternatively, use the All Categories option to search.
Click +Add on the Ansible tile.
Controller Host Node Not Appearing
Problem:
You have installed the Agent on your Linux (Ansible) server, but during the Ansible integration setup, the device does not appear in the Controller Host Node dropdown.
Solution:
If the device is missing from the Controller Host Node dropdown, create an Asset Information–type job for the Linux server by navigating to: Automation → Jobs → Create Job. Once the job completes successfully and OpsRamp updates the device details, the Ansible Controller Node will now visible in the Controller Host Node dropdown.
BASIC DETAILS: Enter the following information:
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th width="30%">Field Name</th>
<th width="20%">Field Type</th>
<th width="50%">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Name</td>
<td>String</td>
<td>Enter a name for the integration.
<br> <b> Example: </b> Ansible playbook automation. <br>
</td>
</tr>
<tr>
<td>Controller Host Name</td>
<td>Dropdown</td>
<td>Select a name from the available options. The drop-down list displays Ansible Control nodes configured with an OpsRamp agent. </td>
</tr>
</tbody>
</table>
**Add playbooks**
Add one or more playbooks. One playbook can execute only one automation script.
<br>
**Example:** Find ipconfig details.
**Prerequisite:** Keep handy the name and complete path of the script required for creating a playbook.
**PLAYBOOK:** Click **ADD** in the PLAYBOOK section and enter the following information in the **ADD PLAYBOOK** dialog box.
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th width="30%">Field Name</th>
<th width="20%">Field Type</th>
<th width="50%">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Name</td>
<td>String</td>
<td>Provide a name for the playbook. <br>
<b> Example: </b> Check Server.
</td>
</tr>
<tr>
<td>Full Qualified Path</td>
<td>String</td>
<td>Enter the complete path of the script. </td>
</tr>
<tr>
<td>input(Optional)</td>
<td>String</td>
<td> Enter more parameters for the script. </td>
</tr>
</tbody>
</table>
Click ADD PLAYBOOK.
The playbook is added and displayed in the PLAYBOOK section.
An integration can have one or more playbooks. To add more playbooks, click ADD.
To update an existing playbook, click the menu (three dots) icon and select Edit.
To delete a playbook, click the menu (three dots) icon and select Remove.
Click FINISH.
The playbook added with the installed integration is ready to use in a process workflow.
Actions on Integration
You can perform actions like Export, Edit, and Uninstall on the integration.