Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

From incident to remediation: Building an AI-driven AIOps workflow with Red Hat Ansible Automation Platform

AI-driven AIOps workflow using Red Hat Ansible Automation Platform

September 5, 2026
Neha Chugh
Related topics:
Artificial intelligence
Related products:
Red Hat Ansible Automation Platform

    AI can help operations teams make sense of an incident, but understanding a problem is only half the challenge. The next question is: How do you turn that insight into a safe, repeatable action? To explore this, I built a simple AIOps workflow using an AWS EC2 instance running Red Hat Enterprise Linux (RHEL), Red Hat Ansible Automation Platform, Claude Code, and model context protocol (MCP).

    The goal was straightforward: Intentionally break a sample application, investigate the problem, let AI analyze the evidence, and use Red Hat Ansible Automation Platform to perform and verify the remediation.

    Demo repository: The application code, Ansible playbooks, and configuration used in this demo are available in the GitHub repository.

    The workflow

    The important part is that AI never directly logs into the RHEL server. Ansible remains the execution layer. Figure 1 illustrates the workflow:

    The steps in this workflow are detection, investigation, analysis with AI, remediation with Ansible, health check for verification, and resolution.
    Figure 1: The steps in this workflow are detection, investigation, analysis with AI, remediation with Ansible, health check for verification, and resolution.

    Start with a real application problem

    The demo uses a product catalog application running on an instance of Red Hat Enterprise Linux on AWS. Before introducing failure, I tested the application with curl and confirmed that it was healthy:

    curl -i http://localhost:8080/health

    The application returned (see figure 2):

    HTTP 200 OK
    {"status": "healthy"}
    Before injecting a CPU spike, contact with a known endpoint was successful and returned the expected response.
    Figure 2: Before injecting a CPU spike, contact with a known endpoint was successful and returned the expected response.

    I then injected a CPU spike into the application:

    curl http://localhost:8080/fault/cpu-spike

    The fault injection returned (figure 3):

    {
      "fault": "cpu-spike",
      "status": "injected"
    }
    Injecting a CPU spike is confirmed by the endpoint's response.
    Figure 3: Injecting a CPU spike is confirmed by the endpoint's response.

    Verify the impact:

    curl -i http://localhost:8080/health
    HTTP/1.0 503 Service Unavailable
    
    {"status": "degraded", "message": "Application experiencing high CPU load"}
    The application enters a degraded state after the CPU fault is injected.
    Figure 4: The application enters a degraded state after the CPU fault is injected.

    This gave us an actual operational problem to investigate (see figure 4) rather than a hypothetical alert.

    Use Ansible Automation Platform to investigate

    The first step is to collect evidence. The first Ansible playbook collected the information we would normally look at during troubleshooting:

    • CPU utilization
    • Top CPU-consuming processes
    • Application process
    • Application health
    • HTTP status

    For example:

    - name: Check CPU utilization
      ansible.builtin.shell: |
        top -bn1 | grep "Cpu(s)" | awk '{print 100 - $8}'
      register: cpu_usage
      changed_when: false
    
    - name: Find top CPU-consuming processes
      ansible.builtin.shell: |
        ps -eo pid,ppid,%cpu,%mem,comm,args --sort=-%cpu | head -10
      register: top_processes
      changed_when: false
    
    - name: Check application health
      ansible.builtin.uri:
        url: "http://localhost:8080/health"
        method: GET
        status_code:
          - 200
          - 503
        return_content: true
      register: app_health
      failed_when: false

    The investigation produced structured information such as:

    {
      "cpu_utilization": "53.1",
      "application_status": "degraded",
      "http_status": "503",
      "incident": "High CPU / application degradation"
    }

    It also identified the processes consuming CPU on the host. This is important because the AI wasn't asked to simply guess what was wrong. Ansible first collected the operational evidence, as in figure 5, and gave the AI something concrete to reason about.

    The Ansible investigation playbook collects evidence from the RHEL host.
    Figure 5: The Ansible investigation playbook collects evidence from the RHEL host.

    The complete investigation playbook is available in the repository under investigate_cpu.yml.

    AI analyzes the incident

    I passed the investigation results to Claude Code. The prompt was intentionally simple:

    Analyze this operational incident.
    
    CPU utilization: 53.1%
    Application status: degraded
    HTTP status: 503
    Top process: python3 app.py
    
    Determine:
    1. Probable root cause
    2. Application impact
    3. Recommended remediation
    4. Which approved AAP workflow should be executed

    Claude analyzed the CPU utilization, application state, HTTP response, and process information and identified the Python application process as the likely contributor to the degradation.

    It then recommended an existing Ansible workflow: AIOps - Remediate High CPU (see figure 6).

    Claude Code analyzed the incident and recommended the Ansible remediation workflow.
    Figure 6: Claude Code analyzed the incident and recommended the Ansible remediation workflow.

    This is where AI added value. Rather than replacing the automation platform, the AI helped interpret the information and determine which existing automation was appropriate for the incident.

    MCP connects AI to Ansible Automation Platform

    Claude Code used the MCP server for Red Hat Ansible Automation Platform to discover the remediation Job Template and verify that it could be launched. The architecture was deliberately simple, and is illustrated in figure 7:

    Claude Code talks to the MCP server for Red Hat Ansible Automation Platform using the model context protocol, and Ansible executes the required automation.
    Figure 7: Claude Code talks to the MCP server for Red Hat Ansible Automation Platform using the model context protocol, and Ansible executes the required automation.

    Claude was able to identify:

    AIOps - Remediate High CPU
    Job Template ID: 12
    Permission: start = true

    The AI did not have and did not need direct SSH access to the RHEL host. Instead, Ansible Automation Platform remained responsible for credentials, inventory, job execution, and the actual Ansible automation.

    Ansible performs the remediation

    The AI asked MCP to launch the approved Ansible workflow.

    Claude Code has a choice of only approved Ansible workflows.
    Figure 8: Claude Code has a choice of only approved Ansible workflows.

    Ansible Automation Platform executed the Ansible playbook against the RHEL host. The result (also see figure 9):

    Before:  HTTP 503 / degraded
    After:   HTTP 200 / healthy
    Claude Code uses MCP to launch the approved Ansible remediation Job Template.
    Figure 9: Claude Code uses MCP to launch the approved Ansible remediation Job Template.

    This is the part I like most about the design: AI made the recommendation, but Ansible did the actual work.

    Verify the recovery

    Remediation isn't complete until recovery is verified. The final step is for the AI to use MCP to run the existing AIOps - Health Check workflow:

    Remediate
        ↓
    Health Check
        ↓
    HTTP 200
        ↓
    Incident resolved

    In this scenario, the application was confirmed healthy, as shown in figure 10:

    The Ansible health check confirms that the application has recovered.
    Figure 10: The Ansible health check confirms that the application has recovered.

    Conclusion

    The complete workflow is:

    Detect → Investigate → Analyze → Recommend → Execute → Verify

    The key takeaway for me is that AIOps doesn't have to mean giving AI direct access to production systems.

    AI can analyze the problem and choose the appropriate action, while Ansible Automation Platform provides the controlled, repeatable, and auditable execution layer.

    Event-driven Ansible can be added later to automatically trigger the investigation when an alert arrives. For now, this gives you a simple and practical foundation for AI + MCP + Ansible Automation Platform.

    Learn more

    Explore how the MCP server for Red Hat Ansible Automation Platform can connect AI assistants with Ansible Automation Platform and enable AI-assisted automation workflows:

    • Deploy the MCP server on Ansible Automation Platform
    • IT automation with agentic AI: Introducing the MCP server for Red Hat Ansible Automation Platform

    Related Posts

    • Red Hat Ansible development workspaces for governed automation content creation

    • Accelerate automation with AI and the Ansible development tools MCP servers

    • How to collaborate with AI to improve your Ansible skills

    Recent Posts

    • From incident to remediation: Building an AI-driven AIOps workflow with Red Hat Ansible Automation Platform

    • Build AI-assisted firewall workflows with Ansible Automation Platform

    • Configure admission fair sharing in Red Hat build of Kueue 1.4

    • Speeding up LLM inference with P-EAGLE in vLLM Speculators

    • Evaluating LLM guardrail configs locally with EvalHub

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI