Introduction

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.

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 then 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 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.
  • Verify if the Ansible Control Node is visible and active at OpsRamp Console by navigating to Setup > Infrastructure.

Install Ansible integration

Install the Ansible integration directly from the OpsRamp console.

To install the Ansible integration:

  1. From the console, go to Setup > Integrations > Integrations > Available Integration > Configuration Automation and click Ansible.
  2. From the Ansible Integration page, click Install and enter the following details in the dialog box:
    • Name: Enter the desired name for the integration.
      For example, Ansible playbook automation.
    • Controller Host Name: Select a name from the available options. The drop-down menu displays Ansible Control nodes configured with an OpsRamp agent.
  3. Click Install.
    The Integrations page displays the installed Ansible integration. An integration can have one or more playbooks.

Create playbooks

Create one or more playbooks for the installed integration. One playbook can execute only one automation script.
For example, find ipconfig details.

Prerequisite: Keep handy the name and complete path of the script required for creating a playbook.

To create a playbook:

  1. From the installed Ansible Integration page, click +.
  2. In the Add Ansible Playbook dialog box, provide a name for the playbook.
    For example, Check Server.
  3. Enter the complete path of the script.
  4. (Optional) In the Input field, enter more parameters for the script.
  5. Click Save.
    Add Ansible Playbook

    Add Ansible playbook

The new playbook appears in Playbook list. To add more playbook, click + again. To update, click the existing playbook.

Now, the playbook added with the installed integration is ready to use in a process workflow.

Using Ansible integration

The installed Ansible integration is used while creating business process workflows. See Getting Started with Process Definition for more information.

Using Ansible Playbook in Workflow

Using Ansible playbook in workflow