Configure Ansible Client to Work with Collections using ansible.cfg File

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

This section describes the steps to configure Ansible client to work with collections using ansible.cfg file.

To locate configure code snippet based on your repository selection, follow these steps:

  1. Click Application tab, and then click Artifacts under Artifactory.

  2. Locate the repository you want to configure, and then click Set Me Up.

    SetMeUpAnsible1.png

    Note

    Alternatively, you can also choose the repository from the Repository drop-down list under Set UP An Ansible Client modal.

  3. Enter your JFrog account password to generate a token, and then click Generate Token & Create Instructions.

    AnsibleGenerateToken.png
  4. Click the Configure tab, copy and paste the snippet of Collections to your ansible.cfg file.

    SetMeUpAnsibleCollections.png

The sample ansible.cfg snippet structure is as follows:

Note

Make sure to replace the placeholders in bold with your JFrog host domain, desired repository path and token.

[galaxy]
server_list = <REPOSITORY_NAME>

[galaxy_server.<REPOSITORY_NAME>]
url=https://<SERVER_NAME>/artifactory/api/ansible/<REPOSITORY_NAME>
token=<TOKEN>
  • <REPOSITORY_NAME>: Name of the repository/repository key.

  • <SERVER_NAME>: URL of your Jfrog instance (AKA JPD).

  • <TOKEN>: Your JPD access token

For example:

[galaxy]
server_list = ansible-virtual

[galaxy_server.ansible-virtual]
url=https://my-awesome.jfrog.io/artifactory/api/ansible/ansible-virtual
token=<TOKEN>

Note

The server_list parameter can include multiple repositories separated by a comma.

For example: server_list = ansible-virtual, ansible-local

Alternatively, you can choose to use the Artifactory <URL> and <Token> explicitly in your Publish and Install commands.