IBM® watsonx™ Code Assistant(WCA) for Red Hat® Ansible Lightspeed demystifies the process of Ansible Playbook creation through generative AI-powered content recommendations. This repository contains sample end-to-end demos, guidelines for best prompting practices, and guidelines for model customization.
- Introduction
- Single-Task Generation
- Multi-Task Generation
- Playbook Generation
- Playbook Explanation
- Model Customization
- Ansible Lightspeed Prompting Guide - Practical hands-on
- Questions, Bug(Issue) or New Features(Contribute)
- License
- Copyright
IBM® watsonx™ Code Assistant for Ansible Lightspeed offers a chat-style experience that allows users to generate and explain Ansible content from single task prompts. This tool collects user prompts and returns an outline of an Ansible playbook, simplifying the process of creating and understanding Ansible content.
🚀 Take a look at the example GIF below to see it in action! 🚀
---
- name: Configure Database servers
hosts: databases
become: true
tasks:
- name: Install postgresql-server
- Move your cursor to the end of the
- name: Install postgresql-server
task description. - Press "ENTER" to generate a suggestion.
- Press "TAB" to accept 👍 the suggestion.
Check out sample playbooks to see Single-Task Generation in action 👉 Click here to explore the demonstrations and get hands-on experience in real-world scenarios.
IBM® watsonx™ Code Assistant for Ansible Lightspeed offers a chat-style experience that allows users to generate multiple tasks with a single prompt entry, by chaining multiple tasks descriptions using ampersand (&) sign in a YAML comment at the task level.
🚀 Take a look at the example GIF below to see it in action! 🚀
Move your cursor to the end of the line
# Run postresql-setup command & Start and enable postgresql service & Allow the traffic
- Press "ENTER" to generate a suggestion with multiple.
- Press "TAB" to accept 👍 the suggestion.
Note: Generating contextually aware, accurate Ansible content suggestions saves you time and helps you create efficiently. One of Red Hat Ansible Lightspeed’s superpowers is context. The last task just asks to "Allow the traffic", which might seem counterintuitive as an AI "ask", but the Red Hat Ansible Lightspeed service is aware of the Ansible Playbook it's working in and suggests a port suggestion to open which corresponds to the default port for PostgreSQL(5432).
Check out sample playbooks to see Multi-Task Generation in action 👉 Click here to explore the demonstrations and get hands-on experience in real-world scenarios.
Playbook generation is designed to overcome the challenges of generating Ansible content Playbooks from scratch. It leverages a chat-style experience that generates Full Ansible Playbooks from both single and multi-task prompts.
The new feature Playbook generation eases that burden by leveraging a chat-style and generative AI-powered user interface that allows users to write prompts using natural language to generate full Ansible Playbooks. Users simply input a prompt and the tool will generate a set of steps that will be needed in order to run the Playbook. Once accepted, watsonx Code Assistant for Red Hat Ansible Lightspeed will provide a Full Ansible Playbook.
🚀 Take a look at the example GIF below to see it in action! 🚀
How to access Playbook Generation?
Click on the 'Ansible' icon on VS Code's Activity Bar
Under 'Ansible Content Creator' -> 'Get Started'
Under 'Create' -> 'Playbook with Ansible Lightspeed'
🎯 Copy the content below and paste into the textarea.
Install and enable PostgreSQL
- Press "Analyze" to proceed.
- Review the suggested steps for your playbook and modify as needed. (Prompt refinement)
- Press "Generate playbook" to open a new tab file with the full playbook.
Note: The feature exclusively creates self-contained Full Playbooks — it does not generate Ansible roles.
Check out sample playbooks to see Full Playbook Generation in action 👉 Click here to explore the demonstrations and get hands-on experience in real-world scenarios.
Playbook explanation is designed to overcome the challenges of understanding complex Playbooks.
users can acquire explanations of each Playbook including a detailed summary of what the Playbook is doing, the perquisites for running the Playbook and a description of each task.
This ensures that each development team member — regardless of expertise — can understand each task and Playbook efficiently to help minimize the learning curve for faster automation content creation.
With Playbook explanation, developers can get AI-generated explanations with the click of a button. This includes a summary of the Playbook and a description of each task to better understand what the Playbook is doing.
This especially helps to:
- Reduce the knowledge gap: with a chat-style experience and real-time explanation of Ansible content, developers without deep Ansible expertise can quickly learn what the code is doing to accelerate content creation or automation efforts
- Free up your senior subject matter experts: for simpler Ansible content creation, developers can leverage the playbook generation feature to generate syntactically correct content recommendations faster. This allows them to focus their time on more complex work.
- Increase Ansible Playbook understanding: explanation helps to understand new and existing Ansible Playbooks faster, saving developers time to focus on more critical tasks and accelerate their productivity for future maintainability.
How to access Playbook Explanation?
There are 2 ways you can initiate Playbook explanation:
Right click on the Playbook -> 'Explain the playbook with Ansible Lightspeed'
Click on the 'Ansible' icon on VS Code's Activity Bar -> Under 'Ansible Lightspeed' -> 'Explain the current playbook'
❗ Note: ❗
- You can run playbook explanation on any existing Ansible playbooks.
- Playbook explanations are strictly limited to self-contained Full Playbooks—they do not cover task files or role files.
Video by Anshul Behl Principal Technical Marketing Manager by Red Hat® 👇
🎥 Playbook Generation using Ansible Lightspeed with IBM watsonx Code Assistant
Video by Ian Smalley Editor by IBM® Technology 👇
🎥 Ansible Playbook Creation with IBM watsonx Code Assistant
As a customer grows their Ansible Content library (or when IBM releases an updated base model), it makes sense to re-tune the model.
Since every organization is different, watsonx Code Assistant for Red Hat Ansible Lightspeed allows users to customize the AI model with their existing Ansible data. This helps provide personalized content recommendations that are more accurate and a better fit for your business.
Model Customization is done using Prompt Tuning: This empowers organizations to tune its domain-specific LLM with their own Ansible data
- Model customization empowers organizations to tune its domain-specific LLM with their own Ansible data
- Customization is beneficial for Ansible because of the many modules that might exist within an Ansible Playbook
- Discovery of unique modules increases quality code recommendations based on organization’s preferences
Don't miss out! Discover more information by clicking here.
❗ Note: ❗
- We recommend providing a data set with at least "1,000 samples = 1000 Ansible tasks" to generate better content recommendations.
- If the data set includes more than one module, it is recommended to provide at least 100 samples per module(Does it mean 100 example of same module usage)
- You don't need to be a data scientist to effectively use watsonx Code Assistant. The UI provides helpful contextual information and guidance along the way.
If you have any questions or issues with the documentation, or if there's something you'd like to add here then you can create a new issue > Click Here <
©️ Copyright IBM Corporation 2024