Managing Ansible content

You can import Ansible collections from several sources to orcharhino Server.

For more information about Ansible integration in orcharhino, see Configuring hosts by using Ansible.

Synchronizing Ansible Collections

On orcharhino, you can synchronize your Ansible Collections from any Ansible Galaxy and other orcharhino instances. Ansible Collections will appear on orcharhino as a new repository type in the orcharhino management UI menu under Content after the sync.

Prerequisites
  • To sync Ansible collections from Red Hat Private Automation Hub, you need to provide orcharhino with an authentication token. To obtain it, go to Connect to Hub, and click Load token.

  • To sync Ansible collections from console.redhat.com, you need an authentication token and SSO URL. To obtain them, go to Connect to Hub. Click Load token to obtain the token. Locate the SSO URL section to obtain the SSO URL.

Procedure
  1. In the orcharhino management UI, navigate to Content > Products.

  2. Select the required product name.

  3. In the Products window, select the name of a product that you want to create a repository for.

  4. Click the Repositories tab, and then click New Repository.

  5. In the Name field, enter a name for the repository.

    The Label field is populated automatically based on the name.

  6. From the Type list, select ansible collection.

  7. In the Upstream URL field, enter the URL for the upstream collections repository.

    The URL can be any Ansible Galaxy endpoint. For example, https://galaxy.ansible.com/.

  8. Optional: In the Requirements.yml field, you can specify the list of collections you want to sync from the endpoint, as well as their versions.

    If you do not specify the list of collections, everything from the endpoint will be synced.

    ---
    collections:
    - name: my_namespace.my_collection
      version: 1.2.3

    For more information, see Installing roles and collections from the same requirements.yml file in the Galaxy User Guide.

  9. Optional: Deselect Sync Dependencies if you do not want orcharhino to resolve and synchronize dependencies. By default, orcharhino synchronizes all required dependencies.

  10. Authenticate:

    1. To sync Ansible collections from Private Automation Hub, enter your token in the Auth Token field.

    2. To sync Ansible collections from console.redhat.com, enter your token in the Auth Token field and enter your SSO URL in the Auth URL field.

    3. To sync Ansible collections from orcharhino, leave both authentication fields blank.

  11. Click Save.

  12. Navigate to the Ansible Collections repository.

  13. From the Select Action menu, select Sync Now.

Consuming content from an Ansible Collection repository

Your hosts can consume content from an Ansible Collection repository on orcharhino Server or orcharhino Proxy Server. Configure the Ansible Galaxy client to use your orcharhino Server or orcharhino Proxy Server as a Galaxy server.

Prerequisites
  • You have synchronized an Ansible Collection to a orcharhino repository.

  • The ansible-core package is installed on the host. This package is available in AppStream repositories.

Procedure
  1. On the host, configure the ansible-galaxy client to use orcharhino Server or orcharhino Proxy Server as the Galaxy server. Add the required sections to an ansible.cfg file, for example:

    [galaxy]
    server_list = My_Library_Server, My_Promoted_CV_Server
    
    [galaxy_server.My_Library_Server]
    url = https://server.example.com/pulp_ansible/galaxy/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/api/
    
    [galaxy_server.My_Promoted_CV_Server]
    url = https://server.example.com/pulp_ansible/galaxy/My_Organization_Label/My_Lifecycle_Environment_Label/My_Content_View_Label/custom/My_Product_Label/My_Repository_Label/api/

    Replace server.example.com with the fully qualified domain name of your orcharhino Server or orcharhino Proxy Server.

  2. Install an Ansible Collection from your Galaxy server. For example:

    $ ansible-galaxy collection install My_Namespace.My_Collection \
    --server My_Library_Server

The text and illustrations on this page are licensed by ATIX AG under a Creative Commons Attribution Share Alike 4.0 International ("CC BY-SA 4.0") license. This page also contains text from the official Foreman documentation which uses the same license ("CC BY-SA 4.0").