This topic describes how to install Ansible collections using the Ansible client CLI. This bypasses the ansible.cfg file and allows you to connect to any Ansible repository.
To install Collections via CLI using the Server Explicit method:
Run the following command:
ansible-galaxy collection install <NAMESPACE.COLLECTION_NAME>.tar.gz -s https://[JFrogPlatformURL]/artifactory/api/ansible/<REPOSITORY_NAME> --token=<TOKEN>Where:
<NAMESPACE.COLLECTION_NAME>: The namespace and collection name[JFrogPlatformURL]: The URL of your JPD<REPOSITORY_NAME>: The name of the target repository<TOKEN>: Your Artifactory identity token
For example:
ansible-galaxy collection install geerlingguy.k8s.tar.gz -s https://company.jfrog.io/artifactory/api/ansible/ansible-virtual --token=w8RvZ3tGkP7sVbNfHjMqYxAcX2pLdE9jU1oI5uC6yFzTmK4rB0eSgWlQhOaDNote
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.