> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Setting Up Lightspeed

> Guide to configuring and using Red Hat Ansible Lightspeed in VS Code to generate and autocomplete Ansible playbooks, authenticate, and validate suggestions

In this lesson we'll configure Red Hat Ansible Lightspeed — the AI assistant embedded in the [Red Hat Ansible extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=redhat.ansible). Lightspeed is purpose-built for Ansible: it understands Ansible modules, playbook syntax, and (optionally) your Automation Controller context so suggestions align with enterprise automation best practices.

Unlike general-purpose assistants such as [ChatGPT](https://chat.openai.com/) or [GitHub Copilot](https://github.com/features/copilot), Lightspeed is tightly coupled with the Ansible ecosystem and helps reduce YAML errors, accelerate development, and enforce consistent playbook patterns.

This demo will:

* Prepare your environment and prerequisites.
* Open the Lightspeed setup panel and authenticate to Red Hat if prompted.
* Generate a simple playbook using Lightspeed and validate autocomplete suggestions.

<Callout icon="lightbulb" color="#1CB2FE">
  Ensure you have the [Red Hat Ansible extension for VS Code](https://marketplace.visualstudio.com/items?itemName=redhat.ansible) installed and that you're signed in with your Red Hat account (if prompted). Some Lightspeed features may require an active subscription or access to your Automation Controller context.
</Callout>

Quick demo flow

| Step                | Action                                                  | Expected result                                                 |
| ------------------- | ------------------------------------------------------- | --------------------------------------------------------------- |
| Prepare environment | Install the Ansible extension and open VS Code          | Lightspeed UI available in the Ansible side panel               |
| Generate playbook   | Enter a natural language prompt in the Lightspeed panel | Lightspeed analyzes and creates a proposed playbook             |
| Test autocomplete   | Type natural-language task descriptions in the editor   | Lightspeed suggests Ansible tasks that can be accepted with Tab |

Now we'll generate a playbook. In the Lightspeed panel I type a natural-language prompt such as:

Create a playbook which installs Apache on [RHEL](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) servers.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/zrm8HSwMCH5tF427/images/AI-Assisted-Ansible/Red-Hat-Ansible-Lightspeed/Demo-Setting-Up-Lightspeed/vscode-ansible-lightspeed-apache-playbook-analyze.jpg?fit=max&auto=format&n=zrm8HSwMCH5tF427&q=85&s=5ea777288024f035845abae3fac59b85" alt="A dark-themed Visual Studio Code window displaying the Ansible Lightspeed &#x22;Create a playbook&#x22; panel, with the text &#x22;Create a playbook which installs apache&#x22; entered and an &#x22;Analyze&#x22; button. Sidebars show Ansible development tools on the left and a &#x22;Build with agent mode&#x22; pane on the right." width="1920" height="1080" data-path="images/AI-Assisted-Ansible/Red-Hat-Ansible-Lightspeed/Demo-Setting-Up-Lightspeed/vscode-ansible-lightspeed-apache-playbook-analyze.jpg" />
</Frame>

I click Analyze. Lightspeed parses the request and summarizes the intended tasks. For this example the analysis shows:

```text theme={null}
1. Install apache

No problems have been detected in the workspace.
```

Click Continue to let Lightspeed create a new playbook file. The generated YAML appears in the editor. To test Lightspeed’s autocomplete, add another task by typing a natural description in the editor (for example: "Create a user called test") and press Enter. Lightspeed will present a suggestion for the corresponding Ansible task — accept it with Tab to insert the task into your playbook.

Resulting playbook (with become set to escalate privileges where needed):

```yaml theme={null}
---
- name: Install apache on rhel
  hosts: rhel
  become: true
  tasks:
    - name: Install apache
      ansible.builtin.package:
        name: httpd
        state: present

    - name: Create a user called test
      ansible.builtin.user:
        name: test
        state: present
```

What to expect

* Generated suggestions appear inline in the editor and can be accepted or edited.
* You can refine prompts, add variables, or extend tasks to match your organization's requirements.
* If you provide Automation Controller context or inventories, Lightspeed can generate suggestions that better match your environment.

<Callout icon="warning" color="#FF6B6B">
  If Lightspeed does not produce suggestions, verify you are signed in to the Red Hat Ansible extension, your extension is up to date, and any required subscription or Automation Controller access is available.
</Callout>

Links and references

* [Red Hat Ansible extension for VS Code](https://marketplace.visualstudio.com/items?itemName=redhat.ansible)
* [Ansible documentation — modules and playbooks](https://docs.ansible.com/ansible/latest/)
* [Automation Controller (Ansible Tower) documentation](https://docs.ansible.com/automation-controller/latest/)
* [Red Hat Enterprise Linux (RHEL)](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux)

Troubleshooting tips

* Ensure VS Code and the Ansible extension are updated.
* Restart VS Code if the Lightspeed panel does not load.
* Check extension logs (View → Output → Ansible) for authentication or connectivity issues.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/ai-assisted-ansible/module/c9159d88-f95d-4a1b-b9e9-faec8628aa03/lesson/6a15f706-251d-4e42-bd5a-1daa9dc6e12e" />
</CardGroup>
