Breadcrumb

  1. Red Hat Interactive Learning Portal
  2. Ansible Automation learning
  3. Get started with the Ansible Visual Studio Code extension
  4. Connect the extension to Ansible Lightspeed with IBM watsonx Code Assistant

Get started with the Ansible Visual Studio Code extension

Take a guided walkthrough of the Ansible extension for Visual Studio Code (VS Code).

Red Hat Ansible automation coding assistant, formerly Ansible Lightspeed, is the latest offering of Red Hat and IBM which bring the power of generative artificial intelligence (AI) in your Ansible creation experience.

Prerequisites:

  • VS Code and Ansible Development setup done on your workstation.
  • A Red Hat customer portal account (that is attached to your organization) with an active Ansible Automation Platform subscription.
  • An IBM watsonx Code Assistant subscription.

In this lesson, you will:

  • Learn about integration Ansible extension for VS Code with Ansible automation coding assistant.

Getting connected: installation and configuration

To enable the Red Hat Ansible Lightspeed service within the extension, follow these steps:

  1. Access the Settings by clicking the gear icon.
  2. Enable both the Enable Ansible Lightspeed and Enable inline suggestions checkboxes in the settings. You can enable Ansible Lightspeed in the User or Workspace settings, based on your preference. Figure 1 depicts this procedure. 
Enable Red Hat Ansible Lightspeed in the User or Workspace settings.
Figure 1: Enable Red Hat Ansible Lightspeed in the User or Workspace settings.

Click on the Ansible A in the VS Code activity bar on the left-hand side of your editor to open the extension. Click Connect and follow the prompts to log into your Red Hat account using your credentials.

Next, authorize Ansible Lightspeed for VS Code by clicking Authorize. Follow the browser prompts to redirect you back to VS Code.

Click Open in the VS Code confirmation dialog box (Figure 2).

Figure shows how to log in using Red Hat credentials.
Figure 2: Log in using your Red Hat credentials.
Figure 2: Log in using your Red Hat credentials.

Congratulations! You’ve successfully configured the Ansible automation coding assistant in VS Code. You can confirm that the Ansible Lightspeed service is enabled by checking the VS Code status bar at the bottom of the editor window (Figure 3).

Figure shows VS Code status bar at the bottom of the editor window.
Figure 3: VS Code status bar.
Figure 3: VS Code status bar.

Additional resources: 

Previous resource
Ansible lint integration with the Ansible VS Code extension
Next resource
Execute Ansible playbooks and integrated version control