Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Will Hallam
ServiceNow Employee

DISCLAIMER: The examples and code included in this article are provided for educational purposes, with no support or warranty, implied or explicit.  Caveat emptor!

LEAP

Learning-Enhanced Automation Platform, or "LEAP", has been around for a while now.  Its focus is to group incidents into groups (and now sub-groups) which share common threads, weighting those groups based on criticality and effort, and using AI-based tooling to author reusable artifacts for resolving those issues in a repeatable and automated fashion.

Ansible

Ansible is a mature, agentless, automation platform.  It excels at configuration management, host patching, application installation and updating.  It is available in both open source and commercial forms, the latter being owned by IBM by way of its RedHat purchase.

LEAP/Ansible Integration

LEAP has recently picked up an integration with Ansible Automation Platform ("AAP"), the UI and middleware component which wraps Ansible content in an enterprise grade framework which provides multiple layers for managing RBAC, multiple inventories and content collections.  Two AI agents were added to LEAP which allow it to discover and leverage existing automation content residing in AAP.  These agents communicate with the AAP tenant via the included MCP (Model Context Protocol) server to enumerate existing automation job templates which match the use cases bubbled up by LEAP, and then execute those job templates to remediate live incidents.

The Challenge

Because it was implemented to use MCP, LEAP support for Ansible is focused on the commercial AAP offering.  The community-level equivalent, AWX, provides comparable functionality except it does not include the MCP channel.  This means that an enterprise-level subscription for AAP would be needed in order to evaluate the LEAP integration.

The Solution

For my own use case, which was to do some basic testing and demonstrating of the LEAP-Ansible integration, I was able to overcome the need for an enterprise AAP subscription by creating an on-instance version of the Ansible MCP server.  I initially focused on my demo use case, which didn't actually communicate with an Ansible system and provided canned responses to the LEAP Ansible agents.  I then enhanced the code so it would act as a full-fledged MCP server, converting AI-driven MCP tool requests into compliant Ansible REST calls, working in tandem with the standard Ansible Integration Hub Spoke.

The Toolset

I created the on-platform server using the ServiceNow IDE and Build Agent, which significantly decreased the time to write and test it.  The intrinsic Git integration also greatly facilitated agility while giving me a great safety net in case of an "oops" moment.  The result was a fit for purpose tool which feeds the LEAP Ansible agents with either simulated or real Ansible automation data, enabling both demonstration and testing scenarios for the capability.

Conclusion

The integration with Ansible can unlock a treasure trove of existing automation for LEAP to harvest and align with the top use cases in a ServiceNow incident table.  For shops or individuals who use  the community flavor of Ansible, this is an example of how you might tap into that capability, for such use cases as testing, development, or demonstration.  You can take a look at the code and documentation, including a prompt suitable for feeding back into Build Agent, in the attached ZIP archive.

 

 

Version history
Last update:
6m ago
Updated by:
Contributors