Questo contenuto non è disponibile nella lingua selezionata.
Chapter 2. Configuring Red Hat automation hub as the primary source for content
Configure Red Hat automation hub as your primary source of content to access Ansible Certified Content Collections. You can configure automation hub in the command-line interface (CLI) or the web console.
2.1. Configuring Red Hat automation hub as the primary source for content using the CLI Copia collegamentoCollegamento copiato negli appunti!
Configure Red Hat automation hub as your primary source of content by using the CLI. To configure automation hub, you must modify the ansible.cfg configuration file. With automation hub, you have access to certified, supported collections.
Prerequisites
- You have obtained the API token for the automation hub server. See Creating the Red Hat automation hub API token for more information.
Creating a new token revokes any previous tokens
generated for {PrivateHubName}. Ensure that you update any Controller or scripts that you created with the previous token.
Creating a new token revokes any previous tokens
generated for {PrivateHubName}. Ensure that you update any Controller or scripts that you created with the previous token.
Procedure
-
Add the
server_listoption under the[galaxy]section and provide one or more server names. Create a new section for each server name:
[galaxy_server._<server_name>_]
[galaxy_server._<server_name>_]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
urloption for each server name. You must include theapi/galaxy/subdirectory in the server URL:https://<server_fully_qualified_domain_name>/api/galaxy/
https://<server_fully_qualified_domain_name>/api/galaxy/Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Optional: Set the
auth_urloption. The community Ansible Galaxy does not require anauth_url. - Set the API token for the automation hub server.
The following ansible.cfg configuration file example shows how to configure multiple servers in prioritized order, with automation hub configured as your primary source and an Ansible Galaxy server as a secondary source:
ansible.cfg
All API URLs must end with a trailing slash / to prevent receiving a 301 redirect.
You have now configured automation hub as your primary server using CLI, and can proceed to download and install supported collections.
2.2. Configuring Red Hat automation hub as the primary source for content using the web console Copia collegamentoCollegamento copiato negli appunti!
Configure Red Hat automation hub as your primary source of content by using the web console. To configure automation hub, you must create a credential and add it to the Organization’s Galaxy Credentials field. With automation hub, you have access to certified, supported collections.
Prerequisites
- You have obtained the API token for the automation hub server. See Creating the Red Hat automation hub API token for more information.
Creating a new token revokes any previous tokens
generated for {PrivateHubName}. Ensure that you update any Controller or scripts that you created with the previous token.
Creating a new token revokes any previous tokens
generated for {PrivateHubName}. Ensure that you update any Controller or scripts that you created with the previous token.
Procedure
- Go to your automation controller.
Create a new credential.
- Click from the Credentials screen.
- Enter the name for your new credential in the Name field.
- Optional: Enter a description and enter or select the name of the organization with which the credential is associated.
- Under Organization, select the organization that you would like to use the credential for.
- Select Ansible Galaxy/Automation Hub API Token as the credential type.
- Under Type Details, enter the Galaxy Server URL, Authentication Server URL, and API Token created in the Prerequisite.
- Click .
Select the credential you created from the Organization’s Galaxy Credentials field.
-
Navigate to
. - Select the organization where you’d like to add your Galaxy credentials.
- Click .
- Under Galaxy Credentials, click the Search icon.
- Select the credential you created for automation hub, and place it at the beginning of the list.
- Optional: If you have a secondary source of content, such as Ansible Galaxy, place this credential after the credential you created for automation hub.
- Click .
- Click .
-
Navigate to
Verification
To validate the credential, update an existing source control management (SCM)-based project by selecting the project and clicking the Refresh icon.
- Navigate to your project repository.
-
Select a project that uses a
collections/requirements.ymlfile. - Update the project by clicking the refresh icon [refresh icon].
If the status of the project is Successful, then the credential is valid.
You have now configured automation hub as your primary server using the web console, and you can proceed to download and install supported collections.