Loading full navigation.

Disclaimer: This feature is currently in Beta. To become a Beta participant, contact Customer Success.

LogicMonitor enables you to run your Ansible Playbook configured in Red Hat AAP to remediate issues directly from a resource. You can run multiple playbooks at the same time across one or more resources, but the same playbook cannot be run in parallel on a single resource. 

When LogicMonitor runs a playbook, the status changes as the execution progresses. The following table describes the supported execution status:

Execution StatusIndicates
Not startedThe Ansible Playbook is not yet run. 
In progressThe Ansible Playbook is currently running. 
SuccessThe Ansible Playbook is run successfully and has collected relevant data. 
Invalid RequestLogicMonitor server received an invalid JSON request. 
RejectLogicMonitor Collector could not handle the incoming request from the server.
ExceptionThe Ansible Playbook failed to run due to an error in the Collector.
TimeoutTimeout occurs when a script fails to run due to reasons such as the resource is dead, Collector is down, and so on.

After running the playbook, you can view the result generated by the script. This helps identify how the issue is resolved. You can view the history of playbook runs on a resource. The history provides details of the issues and remediation performed to resolve the issue. You can view the run history of the resource for a specific time range for the past 30 days.

When you run the playbook, a log entry is added to the Audit logs. For more information, see Audit Logs.

Output Format

The result is presented in plain-text execution log. The LogicMonitor script prints job metadata and polling status, then Ansible stdout between --- Playbook Output --- and --- Final Status: ... ---.

  • Section 1—Confirms template ID, target host, API path, job ID, and polling status
  • Section 2—Marks the beginning of playbook output. Here, warnings are usually informational
  • Section 3—Displays each Ansible task and per-host results (ok, changed, failed, and so on)
  • Section 4—Provides PLAY RECAP total and the final job status (SUCCESSFUL or FAILED)

Ansible Playbook Output Format

Note: By default, the supported output length is 16 KB which can be increased up to 32 KB in the agent.conf settings. If the output exceeds the configured limit, it is truncated.

Requirements for Running Ansible Playbook

To run a playbook, you need the following:

  • A LogicMonitor user with resource permissions for “Remediation: Execute” settings for the resource group to run playbooks.
  • A LogicMonitor user with resource permissions for “Remediation: View” settings for the resource group to view discovered playbooks and run result.
    For more information, see Resources Role Permissions.
  • The host name from AAP must match with either system.hostname, system.ips, or system.displayname of the resource added in LogicMonitor portal.
  • Install EA Collector 40.500 or later on your machine.
    For more information, see Adding Collector.
  • Collector configured in Ansible integration for playbook discovery and operations.
  • Ansible Actions integrated with LogicMonitor and applied to the resources.
    For more information, see Ansible Action Integration.

Running Ansible Playbook

  1. In LogicMonitor, navigate to Resource Tree.
  2. Locate the resource to which a playbook is applied.
  3. Select the Actions tab.
  4. In the Actions column, select  Run for the playbook that you want to run.
    If you have enabled survey when configuring playbook, Run Playbook: create_file_with_input dialog box displays.

Note: Currently, only the text parameter configured through survey is displayed in the dialog box.

  1. (Optional) Modify the value of the parameters.
    If you do not modify, the default value is used to run playbook.
    Run Playbook: create_file_with_input dialog box

Warning: When the system begins to run the playbook, you cannot pause or cancel the process.

The system runs the playbook and updates the execution status.

Ansible playbook execution started

When the process is complete, you can view the output of the recent run in the Overview tab.

Viewing Ansible Playbook Run Result

  1. In LogicMonitor, navigate to Resource Tree.
  2. Locate the resource to which a playbook is applied.
  3. Select the Actions tab.
  4. Select a playbook.
    By default, the Overview tab displays the following details:
    • Name of the playbook
    • Execution status
    • Date and time when the playbook run started
    • Username of the user who triggered the playbook
    • Output details
    • Option to view output in fullscreen mode, download, and copy the output
      View Ansible Result Overview tab
  5. Select the History tab.
  6. (Optional) Select a time range.
  7. Select a record to view the run history.
    View Ansible Result History tab