Bookmark this page

Initial Configuration of Automation Controller and Private Automation Hub

Objectives

  • Perform initial configuration of automation controller and private automation hub and explore the services' web UIs.

Configuration Overview

Red Hat Ansible Automation Platform includes private automation hub, which allows an organization to provide curated Ansible content. You might use this content in your playbooks or to create customized automation execution environments. Because automation controller can also use this same content, a playbook developed and tested with ansible-navigator can run without modification on automation controller.

One of the first steps after installing private automation hub is to configure it by uploading and publishing content. This is especially important if automation controller expects to be able to download automation execution environments from private automation hub.

Aside from activating its subscription, automation controller does not require any initial configuration. If you configured automation controller to use automation execution environments provided by private automation hub, then you might perform some basic functionality tests to verify that Red Hat Ansible Automation Platform works as expected.

Making Automation Execution Environments Available from Private Automation Hub

Private automation hub includes a simple container registry. Administrators of private automation hub can synchronize container images from remote repositories, such as from the Red Hat Ecosystem Catalog, and can also manually upload container images.

Note

Although the web interface navigation for the included container registry is titled Execution Environments, it is not restricted to hosting automation execution environment images.

Synchronizing Automation Execution Environments

If you plan to host automation execution environments on private automation hub, then you might add one or more remote registries to private automation hub. You can choose how frequently you synchronize images from the remote registries, and you might even remove images from private automation hub. By hosting container images on private automation hub, you have a standard location for them to help control which images are used in your organization.

Use the following procedure to add the Red Hat Ecosystem Catalog remote registry to a private automation hub.

  1. Log in to the private automation hub web UI as a user that has permissions to manage remote registries.

  2. Navigate to Execution EnvironmentsRemote Registries and then click Add remote registry.

  3. Enter a name, such as Red Hat Ecosystem Catalog.

  4. Enter the remote registry URL, such as https://registry.redhat.io.

  5. Enter a valid username and password combination for a user that has permission to download container images from the URL.

  6. Click Save to create the remote registry.

You can selectively synchronize specific container repositories.

  • Navigate to Execution EnvironmentsRemote Registries to display the configured remote registries.

  • Find the row for the remote registry, such as Red Hat Ecosystem Catalog, and then select Index execution environments from the vertical ellipsis icon.

  • Navigate to Execution EnvironmentsExecution Environments to display the container repositories available for synchronization.

  • To synchronize a specific container repository, such as the ansible-automation-platform-22/ee-supported-rhel8 container repository, select Sync from registry from the vertical ellipsis icon for the desired container repository row.

After synchronization completes, you can view the available images. Navigate to Execution EnvironmentsExecution Environments, click the name of a container repository, and then select the Images tag. Some images have more than one tag. For Ansible Automation Platform 2.1, the most recent image has several tags, such as 1.0 and latest.

Figure 1.10: Multiple image tags

Rather than synchronizing individual container repositories, you can synchronize all Ansible Automation Platform container repositories (this includes versions of the Ansible Automation Platform 2.0, 2.1, and 2.2 automation execution environment container images).

  • From the Remote Registries page, find the row for the Red Hat Ecosystem Catalog remote registry and select Index execution environments from the vertical ellipsis icon.

  • Click Sync from registry to start the synchronization.

    Although the task completes quickly, it also creates additional tasks to synchronize each container registry. These additional tasks are visible by navigating to Task Management.

Figure 1.11: Synchronizing a remote registry

Manually Adding Container Images

Organizations might choose to manually upload container images to private automation hub, such as custom automation execution environments or other approved container images.

The skopeo command (provided by the skopeo RPM) can perform several tasks on container images, such as inspecting both local and remote images, uploading a local archive to a remote repository, and copying container images from one repository to another without needing to download it to the local machine.

If a remote repository requires authentication, then use the skopeo login command to log in to the container registry. This is typically required in order to push or copy a container image to a remote repository. Authentication might also be required to inspect or copy a remote repository image.

[user@host ~]$ skopeo login registry.redhat.io
Username: your-username
Password: your-password
Login Succeeded!

Use the skopeo inspect command to inspect details of a container image. For example, you might use the command to inspect the ee-minimal-rhel8:latest container image, available from the Red Hat Ecosystem Catalog.

[user@host ~]$ skopeo inspect \
> docker://registry.redhat.io/ansible-automation-platform-22/ee-minimal-rhel8
...output omitted...

Use the skopeo copy command to copy a container image (either local or remote) to a remote registry. When copying from one remote registry to another, you might need to log in to both registries. If you prefer not to log in, then the skopeo copy command has options for specifying credentials from the command line. The following example copies a local archive to a remote registry and adds the 1.0 tag to the container image.

[user@host ~]$ skopeo copy docker-archive:///tmp/ee-29-rhel8.tar \
> docker://hub.lab.example.com/ansible-automation-platform-22/ee-29-rhel8:1.0
...output omitted...

Managing Container Repositories, Images, and Tags

Synchronizing content from a remote registry can download more content than you need. If you do not need a container repository, then you can delete it. For example, you might not need the Ansible Automation Platform 2.0 container repositories that appear when you synchronize all of container repositories from the https://registry.redhat.io remote registry.

To delete a container registry:

  1. Navigate to Execution EnvironmentsExecution Environments to display all container repositories.

  2. Select Delete from the vertical ellipsis icon on the container repository row that you wish to delete, such as ansible-automation-platform-20-early-access/ee-29-rhel8.

  3. Confirm your decision to delete the container repository.

Figure 1.12: Deleting a container repository

An individual container repository can contain many container images, especially if it is synchronized from a remote registry. To delete an individual container image:

  1. Navigate to Execution EnvironmentsExecution Environments to display all container repositories.

  2. Click the name of a container repository, such as ansible-automation-platform-21/ee-supported-rhel8.

  3. Identify a container image to delete, such as 1.0.1-15-source, and select Delete from the vertical ellipsis icon.

  4. Confirm your decision to delete the container image.

Figure 1.13: Deleting a container image

If you manually upload container images, then you might need to add new tags or remove tags from container images. Container images can have more than one tag, but the tags used within a container repository must be unique. For example, only one container image in a container repository can have the latest tag or the 1.0 tag.

Use the skopeo inspect command to display details about a container image. You can filter the output with the --format option to only display specific information, such as the version and release of the image. When not specified, the container image tag defaults to the latest tag. In the following example, the version and release of the latest container image available from the Red Hat Ecosystem Catalog is 1.0.1-27.

[user@host ~]$ skopeo inspect \
> --format "{{ .Labels.version }}-{{ .Labels.release }}" \
> docker://registry.redhat.io/ansible-automation-platform-22/ee-supported-rhel8
1.0.0-113

The 1.0.0-113 matches a tag visible from the Red Hat Ecosystem Catalog for the ansible-automation-platform-22/ee-supported-rhel8 container repository.

Figure 1.14: Tags visible from the Red Hat Ecosystem Catalog

You can manage container image tags from the private automation hub web UI.

  1. Navigate to Execution EnvironmentsExecution Environments to display all container repositories.

  2. Click the name of a container repository, such as ansible-automation-platform-22/ee-supported-rhel8.

  3. Find a container name to manage and then select Manage tags from the vertical ellipsis icon.

  4. Add or remove tags and then click Save.

Synchronizing Ansible Content Collections

To provide Ansible Content Collections from your private automation hub, you must synchronize or upload them from another source. These content collections can include:

Synchronizing Red Hat Certified Ansible Content Collections

Synchronizing Ansible Content Collections from automation hub (available at https://console.redhat.com/ansible/automation-hub) is the most efficient way to make Red Hat Ansible Certified Content Collections available to your private automation hub. Red Hat reviews, maintains, updates, and fully supports those collections. By using Red Hat Ansible Certified Content Collections instead of the collections from Ansible Galaxy, you benefit from the support from Red Hat.

Figure 1.15: Allowing collection synchronization

Within automation hub, navigate to Collections. If you are an automation hub administrator for your organization, then each collection has a Sync button. When enabled, this button allows the collection to be synchronized with your private automation hub. By synchronizing, you can provide a curated set of collections to your users from your private automation hub.

Warning

Never use your corporate account for testing purposes. The test configuration you perform might corrupt your existing organization configuration.

If you do not have a customer portal account or do not want to use your corporate account, then create a personal account. Navigate to https://access.redhat.com/, click the user icon at the upper left, and then click Register.

The following process synchronizes Ansible Content Collections (that have been marked for synchronization) from automation hub to private automation hub.

  1. Log in to the private automation hub web UI as a user that has permissions to manage remote collections.

  2. Navigate to CollectionsRepository Management and then click the Remote tab.

  3. On the rh-certified row, select Edit from the vertical ellipsis icon.

  4. Enter your token for downloading content from automation hub. You can copy your automation hub token from https://console.redhat.com/ansible/automation-hub/token.

  5. Click Save to save your changes.

  6. From the Repo Management page, click Sync to synchronize Ansible Content Collections from automation hub. If successful, then the Sync status column eventually displays a status of Completed.

Remote repository synchronization creates the relevant namespaces for the Ansible Content Collections.

Synchronizing Ansible Content Collections from Ansible Galaxy

You can also synchronize Ansible Content Collections from Ansible Galaxy.

Important

Content collections that are published on Ansible Galaxy are managed by the upstream community and are not Red Hat Certified Ansible Content Collections officially supported by Red Hat. Content provided through the cloud-based automation hub at https://console.redhat.com/ansible/automation-hub is officially supported.

  1. Log in to the private automation hub web UI as a user who can manage remote collections.

  2. Navigate to CollectionsRepository Management and then click the Remote tab.

  3. On the community row, click Configure.

  4. Click Browse and locate a requirements.yml file containing a list of Ansible Content Collections to synchronize.

  5. Ansible Galaxy does not require the Username and Password fields. You can remove any populated values.

  6. Click Save to save your changes.

  7. From the Repo Management page, click Sync to synchronize Ansible Content Collections from Ansible Galaxy. If successful, then the Sync status column eventually displays a status of Completed.

Figure 1.16: Successful remote repository synchronization

Manually Adding Ansible Content Collections

You can manually add Ansible Content Collections to private automation hub, such as custom Ansible Content Collections created by your organization. Organizations in a disconnected environment can also use this method to add previously downloaded Ansible Content Collections to their private automation hub.

Both automation hub (available at https://console.redhat.com/ansible/automation-hub) and Ansible Galaxy (available at https://galaxy.ansible.com) allow downloading Ansible Content Collections as TAR files. After locating an Ansible Content Collection, select a specific version and then click the Download tarball link. If you do not select a version, then you download the latest version of the Ansible Content Collection.

Figure 1.17: Downloading an Ansible Content Collection

The following procedure creates an Ansible Content Collection namespace.

  1. Log in to the private automation hub web UI as a user who can manage collections and collection namespaces.

  2. Navigate to CollectionsNamespaces and then click Create.

  3. Specify a name for the namespace. This name must match the first part of the name of the archive file that you intend to upload. For example: use ansible as the namespace name for the ansible-posix-1.3.0.tar.gz archive; use community as the namespace name for the community-crypto-2.2.2.tar.gz archive; and use containers as the namespace name for the containers-podman-1.9.1.tar.gz archive.

  4. (Optional) Select one or more existing groups as namespace owners. Namespace owners can change the namespace and can upload to the namespace.

  5. Click Create to create the new namespace.

The following procedure uploads an Ansible Content Collection to an existing namespace.

  1. Log in to the private automation hub web UI as a user who can upload collections.

  2. Navigate to CollectionsNamespaces and then click the View collections link for the desired namespace.

  3. Click Upload collection.

  4. Click Select file and then browse to the archive file that you want to upload.

  5. Click Upload to upload the Ansible Content Collection.

By default, private automation hub requires a user to approve uploaded Ansible Content Collections. Use the following procedure to approve or reject an uploaded Ansible Content Collection.

  1. Navigate to CollectionsApproval and then locate the collection.

  2. (Optional) Select View Import Logs from the vertical ellipsis icon.

  3. Click the vertical ellipsis icon and choose either Approve or Reject.

You can configure private automation hub to automatically approve uploaded Ansible Content Collections. Set the automationhub_require_content_approval variable to False in the installation inventory file. If you change this value after installation, then run the setup.sh installation script again to apply the change.

Testing Basic Automation Controller Functionality

When you install automation controller, it is initially configured with a Demo project, which includes resources that you can use to perform basic functionality tests. Performing these tests can help verify that automation controller is working as expected.

The Demo Project

The Demo Project project resource pulls content from the Git repository located at https://github.com/ansible/ansible-tower-samples. Navigate to ResourcesProjects and click the Sync Project icon.

Initiating a project synchronization verifies two things:

  1. It verifies that automaton controller can download the Control Plane Execution Environment defined at AdministrationExecution Environments. If not already present on automation controller, then automation controller uses the Default Execution Environment Registry Credential credential (defined at ResourcesCredentials) to pull the container image defined by the Control Plane Execution Environment resource.

    In the classroom environment, the initial project synchronization failed because the Control Plane Execution Environment container image did not initially exist on private automation hub.

  2. The project synchronization verifies that the Control Plane Execution Environment container image can clone the project source control repository to automation controller.

Default Execution Environment Registry Credential

The installer uses the registry_url, registry_username, and registry_password variables in the installer inventory file to create the Default Execution Environment Registry Credential container registry credential. Navigate to ResourcesCredentials on your automation controller to display existing credentials. The automation controller web UI does not allow you to make changes to the Default Execution Environment Registry Credential container registry credential. If you need to make a change, then modify the relevant inventory variables and run the setup.sh installation script again.

The Demo Credential

The installer creates the Demo Credential machine credential. The Demo Credential machine credential is not immediately useful by default. Recall that a machine credential allows automation controller to connect to machines.

You might modify the Demo Credential machine credential to use a valid username, and either a password or SSH private key for authentication, so that it can connect to machines in your environment.

The Demo Inventory

The installer creates the Demo Inventory inventory resource, which includes the localhost host resource. When you run a playbook in an automation execution environment with automation controller, localhost refers to the automation execution environment container, not the automation controller that launched the job.

Navigate to ResourcesInventories to display existing inventories. Navigate to ResourcesHosts to display existing hosts.

To test functionality, you might consider adding a host from your environment to the Demo Inventory inventory. If so, then you should also update the Demo Credential machine credential. You might also delete the localhost host from the Demo Inventory inventory.

The Demo Job Template

The Demo Job Template job template uses the hello_world.yml playbook from the Demo Project project. The job template targets all hosts defined in the Demo Inventory and uses the Demo Credential machine credential. Because localhost in the default inventory is configured to use a local connection, it is not necessary to use the Demo Credential machine credential when targeting just this host.

Navigate to ResourcesTemplates to display existing templates. Launching the Demo Job Template template initiates a job. The hello_world.yml playbook uses the debug module to print a Hello, World! message.

References

For more information about private automation hub namespaces, refer to Curating Collections Using Namespaces in Automation Hub at https://access.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/2.1/html-single/curating_collections_using_namespaces_in_automation_hub/index

For more information about publishing content to private automation hub, refer to Publishing Proprietary Content Collections in Automation Hub at https://access.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/2.1/html-single/publishing_proprietary_content_collections_in_automation_hub/index

For more information about managing containers in private automation hub, refer to Managing Containers in Private Automation Hub at https://access.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/2.1/html-single/managing_containers_in_private_automation_hub/index

For more information about using Ansible Content Collections in private automation hub, refer to Managing Red Hat Certified and Ansible Galaxy Collections in Automation Hub at https://access.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/2.1/html-single/managing_red_hat_certified_and_ansible_galaxy_collections_in_automation_hub/index

For more information, refer to the Automation Controller User Guide at https://docs.ansible.com/automation-controller/latest/html/userguide/

skopeo-login(1), skopeo-inspect(1), and skopeo-copy(1) man pages

Revision: do467-2.2-08877c1