Publishing an Ansible collection using Ansible client CLI bypasses what is configured in the ansible.cfg file. This method is known as being Server Explicit. You may want to use this method for publishing Ansible collections to a repository other than that configured in the ansible.cfg file.
Note: Using a server explicit command overrides the registry URL your ansible.cfg.
To publish Ansible collections via the Ansible CLI:
Craft the CLI command using your namespace collection name, server name , repository name and token.
ansible-galaxy collection publish <NAMESPACE.COLLECTION_NAME> -s https://<SERVER_NAME>/artifactory/api/ansible/<REPOSITORY_NAME> --token=<TOKEN>
Replace the placeholders in bold with the namespace and collection name, server name, repository name, and token.
For example:
ansible-galaxy collection publish geerlingguy.k8s.tar.gz -s https://my-awesome.jfrog.io/artifactory/api/ansible/ansible-virtual --token=<TOKEN>
Note
You can also use JFrog Set me up to copy the snippet populated with your token and environment. For more information, see Use Artifactory Set Me Up for Configuring Package Manager Clients.