Chapter 3. Setting up Red Hat Ansible Lightspeed for your organization


As a Red Hat customer portal administrator, you must configure Red Hat Ansible Lightspeed to connect to your IBM watsonx Code Assistant instance. This chapter provides information about configuring both the Red Hat Ansible Lightspeed cloud service and on-premise deployment.

3.1. Configuration requirements

3.1.1. Licensing requirements

  • Red Hat Ansible Lightspeed cloud service

    To use the Red Hat Ansible Lightspeed cloud service, you must meet one of the following requirements:

    • Your organization has a trial or paid subscription to both the Red Hat Ansible Automation Platform and IBM watsonx Code Assistant.
    • Your organization has a trial or paid subscription to the Red Hat Ansible Automation Platform, and you have a Red Hat Ansible Lightspeed trial account.

      Note

      A Red Hat Ansible Lightspeed trial account does not require an IBM watsonx Code Assistant subscription.

  • Red Hat Ansible Lightspeed on-premise deployment

    To use an on-premise deployment of Red Hat Ansible Lightspeed, your organization must have the following subscriptions:

    • A trial or paid subscription to the Red Hat Ansible Automation Platform
    • An installation of IBM watsonx Code Assistant for Red Hat Ansible Lightspeed on Cloud Pak for Data

3.1.2. Setup requirements

To set up Red Hat Ansible Lightspeed for your organization, you need the following IBM watsonx Code Assistant information:

  • API key

    A unique API key authenticates all requests made from Red Hat Ansible Lightspeed to IBM watsonx Code Assistant. Each Red Hat organization with a valid Ansible Automation Platform subscription must have a configured API key. When an authenticated RH-SSO user creates a task request in Red Hat Ansible Lightspeed, the API key associated with the user’s Red Hat organization is used to authenticate the request to IBM watsonx Code Assistant.

  • Model ID

    A unique model ID identifies an IBM watsonx Code Assistant model in your IBM Cloud account. The model ID that you configure in the Ansible Lightspeed administrator portal is used as the default model, and can be accessed by all Ansible Lightspeed users within your organization.

Important

You must configure both the API key and the model ID when you are initially configuring Red Hat Ansible Lightspeed.

3.2. Setting up Red Hat Ansible Lightspeed cloud service

As a Red Hat customer portal administrator, you must configure Red Hat Ansible Lightspeed cloud service to connect to your IBM watsonx Code Assistant instance.

3.2.1. Logging in to the Ansible Lightspeed administrator portal

Use the Ansible Lightspeed administrator portal to connect Red Hat Ansible Lightspeed to IBM watsonx Code Assistant.

Prerequisites

  • You have organization administrator privileges to a Red Hat Customer Portal organization with a valid Red Hat Ansible Automation Platform subscription.

Procedure

  1. Log in to the Ansible Lightspeed portal as an organization administrator.
  2. Click Log in Log in with Red Hat.
  3. Enter your Red Hat account username and password. The Ansible Lightspeed Service uses Red Hat Single Sign-On (RH-SSO) for authentication.

    As part of the authentication process, the Ansible Lightspeed Service checks whether your organization has an active Ansible Automation Platform subscription. On successful authentication, the login screen is displayed along with your username and your assigned user role.

  4. From the login screen, click Admin Portal.

    You are redirected to the Red Hat Ansible Lightspeed with IBM watsonx Code Assistant administrator portal where you can connect Red Hat Ansible Lightspeed to your IBM watsonx Code Assistant instance.

3.2.2. Configuring Red Hat Ansible Lightspeed cloud service

Use this procedure to configure the Red Hat Ansible Lightspeed cloud service.

Prerequisites

  • You have obtained an API key and a model ID from IBM watsonx Code Assistant that you want to use in Red Hat Ansible Lightspeed.

    For information about how to obtain an API key and model ID from IBM watsonx Code Assistant, see the IBM watsonx Code Assistant documentation.

Procedure

  1. Log in to the Ansible Lightspeed portal as an organization administrator.
  2. From the login screen, click Admin Portal.
  3. Specify the API key of your IBM watsonx Code Assistant instance:

    1. Under IBM Cloud API Key, click Add API key. A screen to enter the API Key is displayed.
    2. Enter the API Key.
    3. Optional: Click Test to validate the API key.
    4. Click Save.
  4. Specify the model ID of the model that you want to use:

    1. Click Model Settings.
    2. Under Model ID, click Add Model ID. A screen to enter the Model Id is displayed.
    3. Enter the Model ID that you obtained in the previous procedure as the default model for your organization.
    4. Optional: Click Test model ID to validate the model ID.
    5. Click Save.

      When the API key and model ID is successfully validated, Red Hat Ansible Lightspeed is connected to your IBM watsonx Code Assistant instance.

3.3. Setting up Red Hat Ansible Lightspeed on-premise deployment

As an Red Hat Ansible Automation Platform administrator, you can set up a Red Hat Ansible Lightspeed on-premise deployment and connect it to an IBM watsonx Code Assistant instance. After the on-premise deployment is successful, you can start using the Ansible Lightspeed service with the Ansible Visual Studio (VS) Code extension.

Note

Red Hat Ansible Lightspeed on-premise deployments are supported on Red Hat Ansible Automation Platform version 2.4 and later.

3.3.1. Overview

This section provides information about the system requirements, prerequisites, and the process for setting up a Red Hat Ansible Lightspeed on-premise deployment.

3.3.1.1. Deployment models

You can use one of the following modes of deployment:

  • On-premise deployment

    Both Red Hat Ansible Lightspeed and the IBM watsonx Code Assistant model (IBM Cloud Pak for Data) are on-premise deployments. Telemetry data is not collected for an on-premise mode of deployment.

  • Hybrid deployment

    Red Hat Ansible Lightspeed is an on-premise deployment, while IBM watsonx Code Assistant model is a cloud deployment. For hybrid deployments, telemetry data is gathered and can be accessed from the Admin dashboard.

    A hybrid deployment model provides the following benefits:

    • Enables you to set up an on-premise deployment of Red Hat Ansible Lightspeed, with an option to use an IBM watsonx Code Assistant model that is on either an on-premise environment or a cloud environment.
    • Provides the freedom and flexibility to choose an environment that best suits your organizational needs.
    • Enables organizations to use the Ansible Automation Platform for user authentication, instead of logging into the Red Hat cloud.
    • Enables organizations to deploy the Ansible Automation Platform in their preferred region.

3.3.1.2. System requirements

Your system must meet the following minimum system requirements to install and run the Red Hat Ansible Lightspeed on-premise deployment.

RequirementMinimum requirement

RAM

5 GB

CPU

1

Local disk

40 GB

To see the rest of the Red Hat Ansible Automation Platform system requirements, see the System requirements section of Planning your installation.

Note

You must also have installed IBM watsonx Code Assistant for Red Hat Ansible Lightspeed on Cloud Pak for Data. The installation includes a base model that you can use to set up your Red Hat Ansible Lightspeed on-premise deployment. For installation information, see the watsonx Code Assistant for Red Hat Ansible Lightspeed on Cloud Pak for Data documentation.

3.3.1.3. Prerequisites

  • You have installed Red Hat Ansible Automation Platform on your Red Hat OpenShift Container Platform environment.
  • You have administrator privileges for Red Hat Ansible Automation Platform.
  • You have installed IBM watsonx Code Assistant for Red Hat Ansible Lightspeed on Cloud Pak for Data.
  • Your system meets the minimum system requirements to set up Red Hat Ansible Lightspeed on-premise deployment.
  • You have obtained an API key and a model ID from IBM watsonx Code Assistant.

    For information about obtaining an API key and model ID from IBM watsonx Code Assistant, see the IBM watsonx Code Assistant documentation. For information about installing IBM watsonx Code Assistant for Red Hat Ansible Lightspeed on Cloud Pak for Data, see the watsonx Code Assistant for Red Hat Ansible Lightspeed on Cloud Pak for Data documentation.

  • You have an existing external PostgreSQL database configured for the Red Hat Ansible Automation Platform, or have a database created for you when configuring the Red Hat Ansible Lightspeed on-premise deployment.

3.3.1.4. Process for configuring a Red Hat Ansible Lightspeed on-premise deployment

Perform the following tasks to install and configure a Red Hat Ansible Lightspeed on-premise deployment:

3.3.2. Installing the Red Hat Ansible Automation Platform operator

Use this procedure to install the Ansible Automation Platform operator on the Red Hat OpenShift Container Platform.

Prerequisites

  • You have installed and configured automation controller.

Procedure

  1. Log in to the Red Hat OpenShift Container Platform as an administrator.
  2. Create a namespace:

    1. Go to Administration Namespaces.
    2. Click Create Namespace.
    3. Enter a unique name for the namespace.
    4. Click Create.
  3. Install the operator:

    1. Go to Operators OperatorHub.
    2. Select the namespace where you want to install the Red Hat Ansible Automation Platform operator.
    3. Search for the Ansible Automation Platform operator.
    4. From the search results, select the Ansible Automation Platform (provided by Red Hat) tile.
    5. Select an Update Channel. You can select either stable-2.x or stable-2.x-cluster-scoped as the channel.
    6. Select the destination namespace if you selected “stable-2.x” as the update channel.
    7. Select Install. It takes a few minutes for the operator to be installed.
  4. Click View Operator to see the details of your newly installed Red Hat Ansible Automation Platform operator.

3.3.3. Creating an OAuth application

Use this procedure to create an OAuth application for your Red Hat Ansible Lightspeed on-premise deployment.

Prerequisites

  • You have an operational Ansible automation controller instance.

Procedure

  1. Log in to the automation controller as an administrator.
  2. Under Administration, click Applications Add.
  3. Enter the following information:

    1. Name: Specify a unique name for your application.
    2. Organization: Select a preferred organization.
    3. Authorization grant type: Select Authorization code.
    4. Redirect URIs: Enter a temporary URL for now, for example, https://temp/.

      The exact Red Hat Ansible Lightspeed application URL is generated after the on-premise deployment is completed. After the deployment is completed, you must change the Redirect URI to point to the generated Red Hat Ansible Lightspeed application URL. For more information, see Updating the Redirect URIs.

    5. From the Client type list, select Confidential.
  4. Click Save.

    A pop-up window is displayed along with the generated application client ID and client secret.

  5. Copy and save both the generated client ID and client secret for future use.

    Important

    This is the only time the pop-up window is displayed. Therefore, ensure that you copy both the client ID and client secret, as you need these tokens to create connections secrets for Red Hat Ansible Automation Platform and IBM watsonx Code Assistant both.

    The following image is an example of the generated client ID and client secret:

    {Example of a generated client ID and client secret

3.3.4. Creating connection secrets

You must create an authorization secret to connect to Red Hat Ansible Automation Platform, and a model secret to connect to IBM watsonx Code Assistant. If you need to trust a custom Certificate Authority, you must create a bundle secret.

Prerequisites

3.3.4.1. Creating authorization and model secrets

Use this procedure to create secrets to connect to both Red Hat Ansible Automation Platform and IBM watsonx Code Assistant.

Procedure

  1. Go to the Red Hat OpenShift Container Platform.
  2. Select Workloads Secrets.
  3. Click Create Key/value secret.
  4. From the Projects list, select the namespace that you created when you installed the Red Hat Ansible Automation Platform operator.
  5. Create an authorization secret to connect to the Red Hat Ansible Automation Platform:

    1. Click Create Key/value secret.
    2. In Secret name, enter a unique name for the secret. For example, auth-aiconnect.
    3. Add the following keys and their associated values individually:

      KeyValue

      auth_api_url

      Enter the API URL of the automation controller in the following format based on the Ansible Automation Platform version you are using:

      • For Ansible Automation Platform 2.4: https://<CONTROLLER_SERVER_NAME>/api
      • For Ansible Automation Platform 2.5: https://<GATEWAY_SERVER_NAME>

      auth_api_key

      Enter the client ID of the OAuth application that you recorded earlier.

      auth_api_secret

      Enter the client secret of the OAuth application that you recorded earlier.

      auth_allowed_hosts

      Enter the list of strings representing the host/domain names used by the underlying Django framework to restrict which hosts can access the service. This is a security measure to prevent HTTP Host header attacks. For more information, see Allowed hosts in django documentation.

      auth_verify_ssl

      Enter the value as true.

      Important

      Ensure that you do not accidentally add any whitespace characters (extra line, space, and so on) to the value fields. If there are any extra or erroneous characters in the secret, the connection to Red Hat Ansible Automation Platform fails.

    4. Click Create.

      The following image is an example of an authorization secret:

      {Example of an authorization secret
  6. Similarly, create a model secret to connect to an IBM watsonx Code Assistant model:

    1. Click Create Key/value secret.
    2. In Secret name, enter a unique name for the secret. For example, model-aiconnect.
    3. Add the following keys and their associated values individually:

      KeyValue

      username

      Enter the username you use to connect to your IBM watsonx Code Assistant model.

      model_type

      Enter one of the following values per your IBM watsonx Code Assistant model:

      • For on-premise deployment of IBM watsonx Code Assistant model (IBM Cloud Pak for Data): wca-onprem
      • For cloud deployment of IBM watsonx Code Assistant model (IBM Cloud): wca

      model_url

      Enter the URL of the IBM watsonx Code Assistant model.

      model_api_key

      Enter the API key of your IBM watsonx Code Assistant model that was generated during the model installation.

      model_id

      Enter the ID of your IBM watsonx Code Assistant model.

      model_verify_ssl

      Optional, and supported on Red Hat Ansible Automation Platform 2.5 only

      This key controls whether the SSL certificate of the IBM watsonx Code Assistant model is verified.

      Default = true

      Important

      Ensure that you do not accidentally add any whitespace characters (extra line, space, and so on) to the value fields. If there are any extra or erroneous characters in the secret, the connection to IBM watsonx Code Assistant fails.

    4. Click Create.

After you create the authorization and model secrets, you must select the secrets when you create and deploy a Red Hat Ansible Lightspeed instance.

3.3.4.2. Creating a bundle secret to trust a custom Certificate Authority

If you encounter a scenario where you need to trust a custom Certificate Authority, you can customize a few variables for the Red Hat Ansible Lightspeed instance. Trusting a custom Certificate Authority enables the Red Hat Ansible Lightspeed instance to access network services configured with SSL certificates issued locally, such as cloning a project from an internal Git server via HTTPS.

If you encounter the following error when syncing projects, it indicates that you need to customize the variables.

Copy to Clipboard Toggle word wrap
fatal: unable to access 'https://private.repo./mine/ansible-rulebook.git': SSL certificate problem: unable to get local issuer certificate

Procedure

Use one of the following methods to create a custom bundle secret using the CLI:

  • Using a Certificate Authority secret

    Create a bundle_cacert_secret using the following command:

    Copy to Clipboard Toggle word wrap
    # kubectl create secret generic <resourcename>-custom-certs \
        --from-file=bundle-ca.crt=<PATH/TO/YOUR/CA/PEM/FILE> 
    1

    Where:

    <1>: Path of the self-signed certificate. Modify the file path to point to where your self-signed certificates are stored. The Red Hat Ansible Lightspeed instance looks for the data field bundle-ca.crt in the specified bundle_cacert_secret secret.

    The following is an example of a bundle CA certificate:

    Copy to Clipboard Toggle word wrap
    spec:
      ...
      bundle_cacert_secret: <resourcename>-custom-certs
  • Using the kustomization.yaml configuration file

    Use the following command:

    Copy to Clipboard Toggle word wrap
    secretGenerator:
      - name: <resourcename>-custom-certs
        files:
          - bundle-ca.crt=<path+filename>
        options:
          disableNameSuffixHash: true

After you create the bundle secret, you must select the secret when you create and deploy a Red Hat Ansible Lightspeed instance.

3.3.5. Creating and deploying a Red Hat Ansible Lightspeed instance

Use this procedure to create and deploy a Red Hat Ansible Lightspeed instance to your namespace.

Prerequisites

  • You have created connection secrets for both Red Hat Ansible Automation Platform and IBM watsonx Code Assistant.

Procedure

  1. Go to Red Hat OpenShift Container Platform.
  2. Select Operators Installed Operators.
  3. From the Projects list, select the namespace where you want to install the Red Hat Ansible Lightspeed instance and where you created the connection secrets.
  4. Locate and select the Ansible Automation Platform (provided by Red Hat) operator that you installed earlier.
  5. Select All instances Create new.
  6. From the Create new list, select the Ansible Lightspeed modal.
  7. Ensure that you have selected Form view as the configuration mode.
  8. Provide the following information:

    1. Name: Enter a unique name for your Red Hat Ansible Lightspeed instance.
    2. Secret where the authentication information can be found: Select the authentication secret that you created to connect to the Red Hat Ansible Automation Platform.
    3. Secret where the model configuration can be found: Select the model secret that you created to connect to IBM watsonx Code Assistant.
  9. Optional: If you created a bundle secret to trust a custom Certificate Authority, select the bundle_cacert_secret from Advanced Bundle CA Certificate Secret list.
  10. Click Create.

    The Red Hat Ansible Lightspeed instance takes a few minutes to deploy to your namespace. After the installation status is displayed as Successful, the Ansible Lightspeed portal URL is available under Networking Routes in Red Hat OpenShift Container Platform.

3.3.6. Updating the Redirect URIs

When Ansible users log in or log out of Ansible Lightspeed service, the Red Hat Ansible Automation Platform redirects the user’s browser to a specified URL. You must configure the redirect URLs so that users can log in and log out of the application successfully.

Prerequisites

  • You have created and deployed a Red Hat Ansible Lightspeed instance to your namespace.

Procedure

  1. Get the URL of the Ansible Lightspeed instance:

    1. Go to Red Hat OpenShift Container Platform.
    2. Select Networking Routes.
    3. Locate the Red Hat Ansible Lightspeed instance that you created.
    4. Copy the Location URL of the Red Hat Ansible Lightspeed instance.
  2. Update the login redirect URI:

    1. In the automation controller, go to Administration Applications.
    2. Select the Lightspeed Oauth application that you created.
    3. In the Redirect URIs field of the Oauth application, enter the URL in the following format:

      https://<lightspeed_route>/complete/aap/

      An example of the URL is https://lightspeed-on-prem-web-service.com/complete/aap/.

      Important

      The Redirect URL must include the following information:

      • The prefix https://
      • The <lightspeed_route> URL, which is the URL of the Red Hat Ansible Lightspeed instance that you copied earlier
      • The suffix /complete/aap/ that includes a backslash sign (/) at the end
    4. Click Save.
  3. Update the logout redirect URI based on your setup:

    Procedure when both the Red Hat Ansible Lightspeed instance and automation controller are installed using Ansible Automation Platform operator:

    1. Log in to the cluster on which the Ansible Automation Platform instance is running.
    2. Identify the AutomationController custom resource.
    3. Select [YAML view].
    4. Add the following entry to the YAML file:

      Copy to Clipboard Toggle word wrap
      ```yaml
        spec:
        ...
        extra_settings:
          - setting: LOGOUT_ALLOWED_HOSTS
            value: "'<lightspeed_route-HostName>'"
        ```
      Important

      Ensure the following while specifying the value: parameter:

      • Specify the hostname without the network protocol, such as https://.

        For example, the correct hostname would be my-aiconnect-instance.somewhere.com, and not https://my-aiconnect-instance.somewhere.com.

      • Use the single and double quotes exactly as specified in the codeblock.

        If you change the single quotes to double quotes and vice versa, you will encounter errors when logging out.

      • Use a comma to specify multiple instances of Red Hat Ansible Lightspeed deployment.

        If you are running multiple instances of Red Hat Ansible Lightspeed application with a single Red Hat Ansible Automation Platform deployment, add a comma (,) and then add the other hostname values. For example, you can add multiple hostnames, such as "'my-lightspeed-instance1.somewhere.com','my-lightspeed-instance2.somewhere.com'"

    5. Apply the revised YAML. This task restarts the automation controller pods.

Procedure when the Ansible Automation Platform operator is run on a virtual machine:

  1. Log in to the virtual machine with the Ansible Automation Platform controller.
  2. In the /etc/tower/conf.d/custom.py file, add the following parameter:
    LOGOUT_ALLOWED_HOSTS = "<lightspeed_route-HostName>"

    Important
    • If the /etc/tower/conf.d/custom.py file does not exist, create it.
    • Specify the hostname without the network protocol, such as https://.

      For example, the correct hostname would be my-aiconnect-instance.somewhere.com, and not https://my-aiconnect-instance.somewhere.com.

    • Use the single and double quotes in pairs; do not mix single quotes with double quotes.
  3. Restart the automation controller by executing the following command:
    $ automation-controller-service restart

Procedure when the platform gateway is run on a virtual machine:

  1. Log in to the virtual machine with the platform gateway.
  2. Add the following parameter in either the gateway/settings.py file or in the ansible-automation-platform/gateway/settings.py file:
    LOGOUT_ALLOWED_HOSTS = "<lightspeed_route-HostName>"

    Important
    • Specify the hostname without the network protocol, such as https://.

      For example, the correct hostname would be my-aiconnect-instance.somewhere.com, and not https://my-aiconnect-instance.somewhere.com.

    • Use double quotes exactly as specified in the codeblock.

3.3.7. Configuring Ansible VS Code extension for Red Hat Ansible Lightspeed on-premise deployment

To access the on-premise deployment of Red Hat Ansible Lightspeed, all Ansible users within your organization must install the Ansible Visual Studio (VS) Code extension in their VS Code editor, and configure the extension to connect to the on-premise deployment.

Prerequisites

  • You have installed VS Code version 1.70.1 or later.

Procedure

  1. Open the VS Code application.
  2. From the Activity bar, click the Extensions icon.
  3. From the Installed Extensions list, select Ansible.
  4. From the Ansible extension page, click the Settings icon ( Settings icon ) and select Extension Settings.
  5. Select Ansible Lightspeed settings and specify the following information:

    • In the URL for Ansible Lightspeed field, enter the Route URL of the Red Hat Ansible Lightspeed on-premise deployment. Ansible users must have Ansible Automation Platform controller credentials.
    • Optional: If you want to use a custom model instead of the default model, in the Model ID Override field, enter the custom model ID. Your settings are automatically saved in VS Code.

      After configuring Ansible VS Code extension to connect to Red Hat Ansible Lightspeed on-premise deployment, you must log in to Ansible Lightspeed through the Ansible VS Code extension.

      Note

      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.

3.3.8. Updating connection secrets on an existing Red Hat Ansible Automation Platform operator

After you have set up the Red Hat Ansible Lightspeed on-premise deployment successfully, you can modify the deployment if you want to connect to another IBM watsonx Code Assistant model. For example, you connected to the default IBM watsonx Code Assistant model but now want to connect to a custom model instead. To connect to another IBM watsonx Code Assistant model, you must create new connection secrets, and then update the connection secrets and parameters on an existing Red Hat Ansible Automation Platform operator.

Prerequisites

  • You have set up a Red Hat Ansible Lightspeed on-premise deployment.
  • You have obtained an API key and a model ID of the IBM watsonx Code Assistant model you want to connect to.
  • You have created new authorization and model connection secrets for the IBM watsonx Code Assistant model that you want to connect to. For information about creating authorization and model connection secrets, see Creating connection secrets.

Procedure

  1. Go to the Red Hat OpenShift Container Platform.
  2. Select Operators Installed Operators.
  3. From the Projects list, select the namespace where you installed the Red Hat Ansible Lightspeed instance.
  4. Locate and select the Ansible Automation Platform (provided by Red Hat) operator that you installed earlier.
  5. Select the Ansible Lightspeed tab.
  6. Find and select the instance you want to update.
  7. Click Actions Edit AnsibleLightspeed. The editor switches to a text or YAML view.
  8. Scroll the text to find the spec: section.

    Setting to update the connection secrets )

  9. Find the entry for the secret you have changed and saved under a new name.
  10. Change the name of the secrets to the new secrets.
  11. Click Save.

    The new AnsibleLightspeed Pods are created. After the new pods are running successfully, the old AnsibleLightspeed Pods are terminated.

3.3.9. Monitoring your Red Hat Ansible Lightspeed on-premise deployment

After the Red Hat Ansible Lightspeed on-premise deployment is successful, use the following procedure to monitor the metrics on an API endpoint /metrics.

Procedure

  1. Create a system auditor user:

    1. Create a user with a system auditor role in the Red Hat Ansible Automation Platform. For the procedure, see the Creating a user section of Getting started with Ansible Automation Platform.
    2. Verify that you can log in to the Ansible Lightspeed portal for on-premise deployment (https://<lightspeed_route>/) as the newly-created system auditor user, and then log out.
  2. Create a token for the system auditor user:

    1. Log in to the Ansible Lightspeed portal for on-premise deployment (https://<lightspeed_route>/admin) as an administrator by using the following credentials:

      • Username: admin
      • Password: The secret that is named as <lightspeed-custom-resource-name>-admin-password in the Red Hat OpenShift Container Platform cluster namespace where Red Hat Ansible Lightspeed is deployed.
    2. On the Django administration window, select Users from the Users area. A list of users is displayed.
    3. Verify that the user with the system auditor role is listed in the Users list.
    4. From the Django Oauth toolkit area, select Access tokens Add.
    5. Provide the following information and click Save:

      • User: Use the magnifying glass icon to search and select the user with the system auditor role.
      • Token: Specify a token for the user. Copy this token for later use.
      • Id token: Select the token ID.
      • Application: Select Ansible Lightspeed for VS Code.
      • Expires: Select the date and time when you want the token to expire.
      • Scope: Specify the scope as read write.

        An access token is created for the user with a system auditor role.

    6. Log out from the Ansible Lightspeed portal for on-premise deployment.
  3. Monitor your Red Hat Ansible Lightspeed on-premise deployment, by using the authorization token of the user with the system auditor role, to access the metrics endpoint https://<lightspeed_route>/metrics.

3.3.10. Using the Ansible Lightspeed REST API

As the platform administrator, you can configure and use the Ansible Lightspeed REST API to build a custom automation development and tooling workflow outside of VS Code. For information about the Ansible Lightspeed REST API, see Ansible AI Connect. 1.0.0 (v1) in the API catalog.

Note

The Ansible Lightspeed REST API is available for Ansible Automation Platform 2.5 and later.

Prerequisite

  • Ensure that you are using the Red Hat Ansible Automation Platform operator patch version 2.5-20250305.9 and Red Hat Ansible Lightspeed operator version 2.5.250225.

Procedure

  1. Select the platform user for whom you want to grant REST API access.

    You can select an existing user or create a platform user in the Red Hat Ansible Automation Platform. For the procedure, see the Creating a user section of Getting started with Ansible Automation Platform.

  2. Verify that you can log in to the Ansible Lightspeed portal for on-premise deployment (https://<lightspeed_route>/) as the platform user you selected or created, and then log out.
  3. Create a token for the platform user:

    1. Log in to the Ansible Lightspeed portal for on-premise deployment (https://<lightspeed_route>/admin) as an administrator by using the following credentials:

      • Username: admin
      • Password: The secret that is named as <lightspeed-custom-resource-name>-admin-password in the Red Hat OpenShift Container Platform cluster namespace where Red Hat Ansible Lightspeed is deployed.
    2. On the Django administration window, select Users from the Users area. A list of users is displayed.
    3. Verify that the platform user is listed in the Users list.
    4. From the Django Oauth toolkit area, select Access tokens Add.
    5. Provide the following information and click Save:

      • User: Use the magnifying glass icon to search and select the newly-created or existing user for whom you want to grant API access.
      • Token: Specify a token for the user. Copy this token for later use.
      • Id token: Select the token ID.
      • Application: Select Ansible Lightspeed for VS Code.
      • Expires: Select the date and time when you want the token to expire.
      • Scope: Specify the scope as read write.

        An access token is created for the user.

    6. Log out from the Ansible Lightspeed portal for on-premise deployment.
  4. Make a direct call to the Ansible Lightspeed REST API by specifying the newly-created token in the authorization header:

    Copy to Clipboard Toggle word wrap
    curl -H "Authorization: Bearer <token>"
    https://<lightspeed_route>/api/v1/me/
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat, Inc.