Install and configure the Ansible VS Code extension
Red Hat Ansible Lightspeed with IBM watsonx Code Assistant integrates with the Ansible Visual Studio (VS) Code extension. When enabled, the extension automatically collects recommendations, usage telemetry, and Ansible YAML file state through automated events.
To access Red Hat Ansible Lightspeed, all Ansible users must install and configure the Ansible VS Code extension in their VS Code. The Ansible VS Code extension uses the Ansible-specific IBM watsonx Granite model configured in the Red Hat Ansible Lightspeed administrator portal as the default mode for all users in your organization.
Connectivity requirements Copy linkLink copied!
To generate code recommendations, the Ansible Lightspeed service in Visual Studio (VS) Code editor requires access to the following outbound domain:
-
Red Hat Ansible Lightspeed with IBM watsonx Code Assistant, this is linked below.
The outbound connections are encrypted on TCP protocol port 443.
Install and configure the Ansible VS Code extension Copy linkLink copied!
Red Hat Ansible Lightspeed with IBM watsonx Code Assistant integrates with the Ansible Visual Studio (VS) Code extension. When enabled, the extension automatically collects recommendations, usage telemetry, and Ansible YAML file state through automated events.
To access Red Hat Ansible Lightspeed, all Ansible users must install and configure the Ansible VS Code extension in their VS Code. The Ansible VS Code extension uses the Ansible-specific IBM watsonx Granite model configured in the Red Hat Ansible Lightspeed administrator portal as the default mode for all users in your organization.
Connectivity requirements Copy linkLink copied!
To generate code recommendations, the Ansible Lightspeed service in Visual Studio (VS) Code editor requires access to the following outbound domain:
-
Red Hat Ansible Lightspeed with IBM watsonx Code Assistant, this is linked below.
The outbound connections are encrypted on TCP protocol port 443.
Install the Ansible VS Code extension Copy linkLink copied!
Use the following procedure to install the Ansible Lightspeed extension in VS Code.
Before you begin Copy linkLink copied!
- VS Code version 1.70.1 or later.
You can also install VScode derivatives, such as VScode Insider or VS Codium.
Procedure Copy linkLink copied!
- Open the VS Code application.
- From the navigation menu, click the Extensions icon.
- In the Search field, enter Ansible.
- Select Ansible to choose the Ansible language support extension published by Red Hat.
- Click Install.
- After installation is complete, verify your VSCode installation:
- Create a new YAML file using the
.ymlor.yamlfile extension. - From the Status toolbar, click the language indicator and select Ansible to associate the Ansible language type with the new YAML file.
- Start writing a test playbook. Contextual aids are displayed as you start creating your content.
- Create a new YAML file using the
Configure the Ansible VS Code extension Copy linkLink copied!
Configure third-party LLM providers, such as IBM watsonx Code Assistant or Google Gemini, within the Ansible VS Code extension.
Before you begin Copy linkLink copied!
- You have installed the Ansible VS Code extension v25.12.3.
- You have obtained a valid API key for your chosen third-party LLM provider.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
Your settings are automatically saved in VS Code.
If your organization recently subscribed to the Red Hat Ansible Automation Platform, it might take a few hours for Red Hat Ansible Lightspeed to detect the new subscription. In VS Code, use the Refresh button in the Ansible extension from the Activity bar to check again.
Log in to Ansible Lightspeed through the Ansible VS Code extension Copy linkLink copied!
After installing and configuring the VS Code extension, you can log in to the Ansible Lightspeed service.
About this task Copy linkLink copied!
Red Hat Ansible Lightspeed provides different sign-in methods depending on whether you are using the cloud service or the on-premise deployment.
- Ansible Lightspeed on-premise deployments
Users are authenticated using your Red Hat Ansible Automation Platform login.
To sign in, you can use the Connect button in the Ansible Lightspeed view, or the Sign in with Ansible Lightspeed to use Ansible option in the menu. Once prompted in the browser, select Log in with Ansible Automation Platform, and log in with the authorization mechanism that your automation controller is configured with.
- Ansible Lightspeed cloud service
Users are authenticated using Red Hat Single Sign-On (RH-SSO).
To sign in from VS Code, you can use the Connect button in the Ansible Lightspeed view, or the Sign in with Ansible Lightspeed to use Ansible option in the menu. Follow the on-screen prompts to log in and access the Ansible Lightspeed service using your RH-SSO.
Note If you are using a cloud development environment at a domain unknown by Ansible Lightspeed, such as on-premise Red Hat OpenShift Dev Spaces, your sign-in menu provides the option Sign-in with Red Hat to use Ansible.
This option uses a device code flow to successfully complete the sign-in process and requires the Red Hat Authentication extension v0.2.0 or later. If you require this authentication flow but don’t see the Sign-in with Red Hat to use Ansible option, ensure you are using the Ansible VS Code extension v24.5.2 or later.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
On successful authentication, the login screen is displayed along with your username and your assigned user role.