Ansible roles are used to manage tasks, templates, files, and variables related to Ansible operation. You can configure your Ansible client to resolve roles by configuring Ansible registry credentials in the .netrc file. The .netrc file contains information used by the automatic login feature of the rexec and ftp commands. Artifactory supports the resolving of roles through remote repositories.
Prerequisites: Configure your ansible.cfg file to connect to Artifactory. For more information, see Configure the Ansible Client to work with Collections.
To configure the Ansible client to work with roles:
Navigate to the
.netrcdirectory.Run the following command to change the permissions of the credentials file to 600:
chmod 600 .netrc
Open the
.netrcfile in a text editor.Add the following snippet:
machine [JFrogPlatformURL] login <YOUR_JFROG_USERNAME> <AUTH-METHOD> <AUTH>Where:
[JFrogPlatformURL]: URL of your JPD<YOUR_JFROG_USERNAME>: Your Artifactory username<AUTH-METHOD>: Your chosen authentication method, eitherpasswordoridentity-token<AUTH>: Your JPD password or Identity Token
For example:
machine company.jfrog.io login admin password cmVmdGtuOjAxOjE3NTA0jfauruYYt3u73totu1JqRVNSMWhUS1htQXlzb2lTcnVHSave the changes.
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.
Next Steps: