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.
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.
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.
Facts Only
* The Ansible VS Code extension has undergone multiple iterations since its 2021 release.
* The extension features an automation coding assistant for generating Ansible playbooks and roles using LLMs.
* The assistant automatically lints generated code to check for errors.
* Users can retrieve documentation on unfamiliar modules via a single click within the extension.
* The extension supports model integrations through Google Gemini and OpenAI-compatible endpoints via Red Hat AI.
* The automation coding assistant integrates with an open-source model served via a preconfigured OpenAI-compatible endpoint in the lab.
* An interactive lab demonstrates using the extension to install a database server and deploy an HTML landing page template across web servers.
* The lab teaches prompt writing for generation, playbook execution, and role generation from tasks.
* The updated lab features faster setup and more accurate code generation.
* The assistant demonstrates "bring your own model" capability by connecting to an endpoint within the lab.
Executive Summary
Full Take
The development points toward shifting the locus of automation skill from manual command construction to sophisticated prompt engineering and contextual validation within an integrated environment. The evolution from a single-model integration to support for multiple LLMs via interchangeable endpoints suggests a move away from vendor lock-in and toward establishing a flexible, agnostic layer over automation generation. The emphasis on real-time linting coupled with instant documentation retrieval embeds quality assurance directly into the code creation workflow, addressing the historical gap between AI-generated code and practical deployment realities. The interactive lab structure is crucial because it moves the concept of an advanced assistant from theoretical potential to tangible, verifiable outcomes. The pattern observed is the systemic push toward embedding governance (linting) and flexibility (multi-model support) directly into the developer experience to manage the inherent uncertainty of generative AI outputs. This suggests a larger industry trend where value shifts from mere code generation to verified, context-aware automation scaffolding.
Bridge Questions: How does the reliance on 'bring your own model' in lab environments impact trust when moving to production systems? What mechanisms are required to ensure that the quality of documentation retrieval is as robust as the code linting? If users rely heavily on LLM assistants for role generation, what cognitive shifts occur regarding deep architectural understanding versus surface-level functional execution?
