Network Management

How to Run Ansible Runbooks and Commands Using the "Execute External Program" Alert Action in SolarWinds Platform

This article explains how to trigger Ansible playbooks from the SolarWinds Platform without requiring additional modules or native Ansible integrations. The solution uses the Execute External Program alert action combined with remote SSH execution from a Windows server to a Linux Ansible control node.

First published date

1/14/2026 4:12 PM

Last published date

1/14/2026 4:12 PM

Overview

A fully working integration is achievable by configuring the SolarWinds Platform to run a local Windows script (BAT or PowerShell) that uses SSH (e.g., via plink.exe) to connect to the Linux control node and execute Ansible commands remotely.

Prerequisites

  • Administrative access to the Windows server hosting the SolarWinds Platform.
  • Configured Ansible control node on Linux machine.
  • SSH access to the Linux Ansible control node.
  • Plink.exe installed on the Windows server (recommended for SSH; optional if another SSH client is used).
  • SSH key pair generated and installed on the Linux control node for passwordless authentication.
  • Appropriate permissions on the Linux node to execute Ansible playbooks.

Product section

Orion Platform

Resolution

Configuring the Alert Action in the SolarWinds Platform

  • When editing or adding an alert, select Add Action in the Trigger or Reset Action section.
  • Choose Execute an External Program.
  • Configure the action to run the Windows script (e.g., C:\Scripts\run_playbook.bat).
  • Select the appropriate user account for running the script (preferably a low-privilege account tailored for this purpose).
  • Save and test the action using the Simulate button.
  • When the alert triggers, the SolarWinds Platform will execute the script, which remotely runs the Ansible playbook.

 

Alternative Local Execution Option: Windows Subsystem for Linux (WSL)

An alternative approach may be to run Ansible locally on the SolarWinds Platform server using WSL:
  • This method allows executing Ansible playbooks locally via commands like:
    wsl.exe ansible-playbook <playbook> -i <inventory>
  • Advantages: Eliminates the need for SSH keys, remote inventory, and Linux host configuration.
  • Considerations:
    • WSL availability depends on Windows OS version and infrastructure policies.
    • Virtualized environments may restrict enabling WSL.
    • This approach is not officially supported by SolarWinds and was evaluated only as an optional local optimization.
The supported method remains remote execution on a dedicated Linux host.

Working Example

Windows Script stored on the SolarWinds Platform server:

Path: C:\Scripts\run_playbook.bat

@echo off
set PLINK="plink.exe"
set KEY="C:\Scripts\keys\id_rsa.ppk"
set LNXUSER=root
set LNXHOST=10.218.202.10

%PLINK% -ssh -i %KEY% %LNXUSER%@%LNXHOST% "/root/ansible/run_ansible.sh"

Linux Script stored on Ansible control node:

Path: /root/ansible/run_ansible.sh

#!/bin/bash
cd /root/ansible
ansible-playbook test.yml -i hosts.ini

Configured Action:

Limitations

  • The SolarWinds Platform cannot run Ansible directly: Ansible requires a Linux control node; Windows cannot serve as the control node.
  • SSH connection required: The Windows script must successfully connect to the Linux VM via SSH.
  • Static playbook paths: The Windows script must explicitly specify the Linux script or playbook path; dynamic paths are not supported in this setup.