Installing the Ansible VS Code extension¶
You need the latest version of the Ansible VS Code extension to access Ansible Lightspeed with IBM watsonx Code Assistant functionality.
Open VS Code.
Click the Extensions icon on the left sidebar.
- Search for Ansible in the search box.
- Click the Ansible language support extension that is published by Red Hat.
- Click Install to install the extension.
To verify your installation:
- Create a new YAML file using the “.yml” or “.yaml” file extension.
- Associate the Ansible language type with the new YAML file by clicking on the language indicator - which is located on the right hand of the Status Bar, and selecting Ansible from the dropdown.
- Start writing a test playbook. You should see contextual aids as you create your content.
Configuring the Ansible VS Code extension¶
To configure the Ansible VS Code extension for Ansible Lightspeed with IBM watsonx Code Assistant:
Open VS Code.
- In the Search settings bar, type
- Check all of the following boxes if they are not already selected:
- Ansible>Lightspeed: Enabled.
- Ansible>Lightspeed>Suggestions: Enabled.
- In Ansible>Lightspeed: Base Path, enter the following: https://c.ai.ansible.redhat.com/ 1
- Close the Settings tab.
Logging In to Ansible Lightspeed¶
- Open the Ansible extension icon on the left-hand side of the Visual Studio Code interface and click Connect.
- Follow the prompts to sign in to Ansible Lightspeed with IBM watsonx Code Assistant using your GitHub credentials.2
- Carefully review the Terms and Agree or Disagree. If you click Disagree, you will not be able to complete the login. Lastly, follow the prompt to allow VS Code to interact with Ansible Lightspeed with IBM watsonx Code Assistant on your behalf.
- Upon successful completion of the login flow, you should see a “Logged in as \<your GitHub id>” message in the Ansible side bar.
Logging Out of Ansible Lightspeed¶
To logout of Ansible Lightspeed, follow these steps:
- Click on the "person" icon in the bottom-left panel of the VS Code window. This icon will have a list of accounts that VS Code is logged into.
- Click "Ansible Lightspeed", then "Sign Out" to logout of the service.
- Open your browser.
- Navigate to https://c.ai.ansible.redhat.com/.
- Click "Log out".
These steps in both VS Code and your web browser will ensure that you are completely logged out of Ansible Lightspeed.
You may log back into the service at any time.