This topic describes how to install Ansible roles without .netrc
file using Ansible client CLI by connecting directly to a Galaxy server by including a token when connecting to the Ansible LabKey server.
To install roles via CLI without using the .netrc file:
Craft the CLI command using the below syntax. Make sure to replace the placeholders in bold with your namespace role name, server name, repository name and Token, then run the command.
ansible-galaxy role install <NAMESPACE.ROLE_NAME>.tar.gz -s https://<SERVER_NAME>/artifactory/api/ansible/<REPOSITORY_NAME> --token=<TOKEN>
For example:
ansible-galaxy role install 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.