Getting started with Red Hat Ansible Automation Hub
Configuring Red Hat Automation Hub as your default server for Ansible collections content
Red Hat Ansible Automation Hub provides a place for Red Hat subscribers to quickly find and use content that is supported by Red Hat and our technology partners to deliver additional reassurance for the most demanding environments.
The Ansible Galaxy client,
ansible-galaxy, manages roles and collections from the command line. To ensure that the
ansible-galaxy client uses certified, supported Ansible collections whenever possible, you should update your
ansible.cfg file to use Red Hat Automation Hub as your primary source of Ansible collections.
This guide walks you through the steps required to configure your
ansible.cfg file to use Red Hat Automation Hub as the default source for certified Ansible collections content.
Chapter 1. Creating the Red Hat Automation Hub API token
Before you can interact with Automation Hub by uploading or downloading collections, you need to create an API token. The Automation Hub API token authenticates your
ansible-galaxy client to the Red Hat Automation Hub server.
You can create an API token using Automation Hub Token management.
- Valid subscription credentials for Red Hat Ansible Automation Platform.
- Navigate to https://cloud.redhat.com/ansible/automation-hub/token/.
- Click Load Token.
- Click copy icon to copy the API token to the clipboard.
- Paste the API token into a file and store in a secure location.
The API token is a secret token used to protect your content. Store your API token in a secure location.
The API token is now available to use to configure Automation Hub as your default collections server or when uploading collections using the
ansible-galaxy command line tool.
Chapter 2. Configuring Red Hat Automation Hub as the primary source for content
You can define Red Hat Automation Hub as the default source for content in the
ansible.cfg configuration file.
- Obtain the API token for the Automation Hub server. See Creating the Automation Hub API token for more information.
server_listoption under the
[galaxy]section and provide one or more server names.
Create a new section for each server name:
urloption if necessary. The community Ansible Galaxy does not require an
auth_urloption for each server name.
- Set the API token for the Automation Hub server.
ansible.cfg 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:
server_list = automation_hub, my_org_hub
- A trailing slash / must follow the server URL.
You have now configured Automation Hub as your default server and can proceed to download and install supported collections.
For more information on server list configuration options and using Ansible Galaxy as an Ansible content source, see the Ansible Galaxy User Guide.