Chapter 17. Managing Ansible content
Managing Ansible content in Satellite includes importing Ansible collections from different sources, synchronizing them, and distributing them to your hosts. This enables maintaining consistent automation across your infrastructure.
Additional resources
17.1. Synchronizing Ansible Collections Copy linkLink copied to clipboard!
On Satellite, you can synchronize your Ansible Collections from Private Automation Hub, console.redhat.com, and other Satellite instances to centrally manage and distribute automation content across your infrastructure. Ansible Collections will appear on Satellite as a new repository type in the Satellite web UI menu under Content after the sync.
Procedure
- In the Satellite web UI, navigate to Content > Products.
- Select the required product name.
- In the Products window, select the name of a product that you want to create a repository for.
- Click the Repositories tab, and then click New Repository.
In the Name field, enter a name for the repository.
The Label field is populated automatically based on the name.
- From the Type list, select ansible collection.
In the Upstream URL field, enter the URL for the upstream collections repository.
The URL can be any Ansible Galaxy endpoint. For example,
https://console.redhat.com/api/automation-hub/.Optional: In the Requirements.yml field, you can specify the list of collections you want to sync from the endpoint and their versions.
If you do not specify a list of collections, Satellite synchronizes all Ansible collections from the endpoint.
--- collections: - name: my_namespace.my_collection version: 1.2.3For more information, see Installing roles and collections from the same requirements.yml file in the Galaxy User Guide.
- Optional: Deselect Sync Dependencies if you do not want Satellite to resolve and synchronize dependencies. By default, Satellite synchronizes all required dependencies.
Authenticate:
To sync Ansible collections from Private Automation Hub:
- Navigate to Connect to Hub. Click Load token.
- Enter the token in the Auth Token field in the Satellite web UI.
To sync Ansible collections from
console.redhat.com:- Navigate to Connect to Hub. Click Load token.
- Enter the authentication token in the Auth Token field in the Satellite web UI.
- Copy the SSO URL from the SSO URL section.
- Enter the SSO URL in the Auth URL field in the Satellite web UI.
- To sync Ansible collections from Satellite, leave both authentication fields blank.
- Click Save.
- Navigate to the Ansible Collections repository.
- From the Select Action menu, select Sync Now.
Additional resources
17.2. Consuming content from an Ansible Collection repository Copy linkLink copied to clipboard!
Configure hosts to consume content from an Ansible Collection repository on Satellite Server or Capsule Server to ensure consistent automation content across your infrastructure. You can configure the Ansible Galaxy client to use your Satellite Server or Capsule Server as a Galaxy server.
Prerequisites
- You have synchronized an Ansible Collection to a Satellite repository.
-
The
ansible-corepackage is installed on the host. This package is available in AppStream repositories.
Procedure
On the host, configure the
ansible-galaxyclient to use Satellite Server or Capsule Server as the Galaxy server. Add the required sections to anansible.cfgfile, 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.comwith the fully qualified domain name of your Satellite Server or Capsule Server.Install an Ansible Collection from your Galaxy server. For example:
# ansible-galaxy collection install My_Namespace.My_Collection \ --server My_Library_Server