Configure Ansible Client to work with Roles

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

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:

  1. Navigate to the .netrc directory.

  2. Run the following command to change the permissions of the credentials file to 600:

    chmod 600 .netrc
  3. Open the .netrc file in a text editor.

  4. 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, either password or identity-token

    • <AUTH>: Your JPD password or Identity Token

    For example:

    machine company.jfrog.io login admin password cmVmdGtuOjAxOjE3NTA0jfauruYYt3u73totu1JqRVNSMWhUS1htQXlzb2lTcnVH
  5. Save 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: