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 cloud.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 cloud.redhat.com and to your choice of collections in Ansible Galaxy by configuring remote repositories.

Each remote repository located in menu[Repo Management > Remote] 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 cloud.redhat.com to your local Automation Hub.

Prerequisites

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

Procedure

  1. Log in to cloud.redhat.com as an Organization Administrator.
  2. Navigate to Automation HubRepo Management.
  3. Locate the Sync URL and click Copy to clipboard . Paste the Sync URL in a file to use when configuring the rh-certified remote.
  4. Click More actions 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-cerftified remote repository and syncing Red Hat Certified collections.

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 only use those collections specified by your organization, you need to 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 cloud.redhat.com.

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 will close and return you to the Repo Management page. You can now sync collections between your organization synclist on cloud.redhat.com and your local Automation Hub.

  1. Click Sync to sync collections.

The Sync status notification will update 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/v2/collections.

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 Ansible Galaxy.
  - name: geerlingguy.php_roles
    version: 0.9.3
    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 More actions and click Edit.
  5. In the modal, click Browse and locate the requirements.yml file on your local machine.
  6. Click Save.

The modal will close and return 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 will update 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.