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

Try the Ansible playbook generation lab with Gemini and OpenAI

August 26, 2026
Andrew Sergison
Related topics:
Automation and managementArtificial intelligenceDeveloper tools
Related products:
Red Hat Ansible Automation Platform

    Red Hat Ansible Automation Platform's official Visual Studio Code (VS Code) extension has undergone many iterations and improvements since its initial release in 2021. Along with its automatic linting and easy documentation access, one of the most helpful features of the extension is its ability for users to generate Ansible playbooks and roles using their AI large language model of choice. This is known as the automation coding assistant (formerly Ansible Lightspeed). While initially integrated with IBM watsonx (an agent platform released by IBM in 2023), the extension now supports additional model integrations via Google Gemini and OpenAI-compatible endpoints through Red Hat AI.

    Integrated into the Ansible VS Code extension, the automation coding assistant generates an Ansible playbook or role, which the extension then automatically lints to check for errors. When reviewing the code, if there are unfamiliar modules or keywords, the user can retrieve documentation with a single click and make manual edits as needed. Watch a 60-second video demonstration of real-time linting and playbook generation in action.

    Hands-on lab updated

    This blog post introduces an update to the interactive lab demonstrating the VS Code extension's capabilities through a real Ansible use case: installing a database server and deploying an HTML landing page template to a set of web servers. The automation coding assistant lab walks you through using the Ansible extension, writing accurate prompts, understanding model generation, and evaluating the generated playbook's output.

    The 1st lab module gives an overview of the lab environment and a basic introduction to the Ansible VS Code extension. The lab hosts a VS Code window (via code-server) for generating and running playbooks, and a web view of the 2 nodes the HTML template deploys against.

    Throughout the 2nd and 3rd lab modules, you prompt the automation coding assistant with a detailed description of the playbook to generate. This approach teaches you how to write clear, effective prompts while building a solid foundation in Ansible playbook structure.

    You then run the playbook, see the landing page fully deployed (Figure 1), and in the final step, learn how to generate an Ansible role from individual Ansible tasks using the automation coding assistant and understand how its structure relates to the playbook.

    Server details page for node1 displaying hostname, IP address 10.0.2.2, system specs, and a Managed by Ansible status label.
    Figure 1: The final landing page deployed by the AI-assisted playbook.

    The updated lab includes several improvements over the previous version, resulting in faster setup, more accurate code generation, and a greater focus on the automation coding assistant's practical applications.

    About the lab

    The automation coding assistant now connects to an open source model served via a preconfigured OpenAI-compatible endpoint (Figure 2). This demonstrates the extension's "bring your own model" capability and eliminates the setup process that previously required leaving the lab environment to obtain credentials.

    LLM Provider Settings menu listing IBM watsonx, Google Gemini, and Red Hat AI, with Red Hat AI marked as configured and active.
    Figure 2: Model provider selection in the automation coding assistant.

    Try it out

    The refreshed lab provides a realistic environment to test how the Ansible VS Code extension performs in real-world workflows. Setup improvements allow you to spend your lab time engaging directly with the automation coding assistant, Paired with a more capable AI model, the lab ensures you leave with a working playbook and a clear understanding of the extension's value.

    Ready to test the automation coding assistant? Launch the interactive lab directly on Red Hat Interactive Labs or explore the Ansible VS Code extension documentation to get started.

    Additional resources

    • E-book: Accelerate your IT automation with AI

    Related Posts

    • Create an efficient Ansible development environment in VS Code

    • Leverage AI for root-cause analysis with MCP servers in VS Code and Cursor

    • Just-in-time access to HashiCorp Vault using the Red Hat Ansible Automation Platform OIDC provider

    • Remote container development with VS Code and Podman

    • Just-in-time automated elevated access with Red Hat Ansible Automation Platform and ServiceNow ITSM

    • What's new in Red Hat Ansible Automation Platform 2.7

    Recent Posts

    • Try the Ansible playbook generation lab with Gemini and OpenAI

    • Automating Red Hat OpenShift AI installations with Helm and GitOps

    • Red Hat OpenShift autoscaling with Cluster Autoscaler

    • Run LoRA fine-tuning on Red Hat OpenShift AI with Ray

    • Improved failure reports on Red Hat OpenShift with the event-driven diagnostic operator

    What’s up next?

    Learning Path Ansible LP_featured_image

    Get started with the Ansible Visual Studio Code extension

    Take a guided walkthrough of the Ansible extension for Visual Studio...
    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