Chapter 2. Configuring automation hub remote repositories to sync content from Red Hat Certified and Ansible Galaxy collections

You can configure your local automation hub to sync with Red Hat Certified Collections hosted in your organization repository on console.redhat.com or to your choice of collections in Ansible Galaxy.

2.1. About remote repositories

You can configure your local automation hub to sync with Red Hat Certified Collections hosted in your organization repository on console.redhat.com and to your choice of collections in Ansible Galaxy by configuring remote repositories.

Each remote repository located in Repo ManagementRemote provides information for both community and rh-certified about when the repo was last updated and when content was last synced. You can add new content to automation hub at any time using the Edit and Sync features included on the Repo ManagementRemote page.

2.2. Retrieving your Red Hat Certified Collections Sync URL and API token.

You can sync Red Hat certified collections curated by your organization from console.redhat.com to your local automation hub.

Prerequisites

  • You have Organization Administrator permissions for console.redhat.com.

Procedure

  1. Log in to console.redhat.com as an Organization Administrator.
  2. Navigate to Automation HubRepo Management.
  3. Locate the Sync URL and click the Copy to clipboard icon ( Copy ). Paste the Sync URL in a file to use when configuring the rh-certified remote.
  4. Click the More actions icon ( More ) and click Get token.
  5. On the Token management page, click Load token.
  6. Click Copy to clipboard to copy the API token.
  7. Paste the API token into a file and store in a secure location.
Important

The API token is a secret token used to protect your content. Store your API token in a secure location.

2.3. Configuring the rh-certified remote repository and synchronizing Red Hat Ansible Certified Content Collection.

You can edit the rh-certified remote repository to sync collections from automation hub hosted on cloud.redhat.com to your local automation hub. By default, your local automation hub rh-certified repository includes the URL for the entire group of Red Hat Certified Collections available on cloud.redhat.com. To use only those collections specified by your organization, you must include a unique URL.

Prerequisites

  • You have Modify Ansible repo content permissions. See Managing user access in Automation Hub for more information on permissions.
  • You have retrieved the Sync URL and API Token from the automation hub hosted service on console.redhat.com.
  • You have configured access to port 443. This is required for synchronizing certified collections. For more information, see the automation hub table in the Network ports and protocols chapter of the Red Hat Ansible Automation Platform Planning Guide.

Procedure

  1. Log in to your local automation hub.
  2. Navigate to Repo Management.
  3. Click the Remotes tab.
  4. In the rh-certified remote, click More actions and click Edit.
  5. In the modal, paste the Sync URL and Token you acquired from cloud.redhat.com.
  6. Click Save.

The modal closes and returns you to the Repo Management page. You can now synchronize collections between your organization synclist on console.redhat.com and your private automation hub.

+ . Click Sync to synchronize collections.

The Sync status notification updates to notify you of completion of Red Hat Certified collections sync.

Verification

You can confirm that your collections content has synced successfully by selecting Red Hat Certified from the collections content drop-down list.

2.4. Configuring the community remote repository and syncing Ansible Galaxy collections

You can edit the community remote repository to sync chosen collections from Ansible Galaxy to your local automation hub. By default, your local automation hub community repository directs to https://galaxy.ansible.com/api/.

Prerequisites

  • You have Modify Ansible repo content permissions. See Managing user access in Automation Hub for more information on permissions.
  • You have a requirements.yml file that identifies those collections to sync from Ansible Galaxy. See example below.

Requirements.yml example

collections:
  # Install a collection from {Galaxy}.
  - name: community.aws
    version: 5.2.0
    source: https://galaxy.ansible.com

Procedure

  1. Log in to your local automation hub.
  2. Navigate to Repo Management.
  3. Click the Remotes tab.
  4. In the community remote, click the More Actions icon More and click Edit.
  5. In the modal, click Browse and locate the requirements.yml file on your local machine.
  6. Click Save.

The modal closes and returns you to the Repo Management page. You can now sync collections identified in your requirements.yml file from Ansible Galaxy to your local automation hub.

  1. Click Sync to sync collections from Ansible Galaxy and automation hub.

The Sync status notification updates to notify you of completion or failure of Ansible Galaxy collections sync to your automation hub.

Verification

You can confirm successful sync by selecting Community from the collections content drop-down list.