How to work with Bitbucket private repositories in Automation Platform or Event-Driven Ansible?

Solution Verified - Updated -

Environment

  • Red Hat Ansible Automation Platform (AAP)
    • 2.4
    • 2.5
  • Red Hat Event-Driven Ansible (EDA)

Issue

  • Trying to synchronize a project using a bitbucket private repository returns a authentication error in the WebUI.
  • There is no credential type for bitbucket among the options available. Which one should be chosen in order to create a credential for authenticating in the bitbucket repository?
  • How should the bitbucket's Access Token be used in order to sync a project with bitbucket's repository?
  • Connecting to Bitbucket repositories

Resolution

  • Use these steps as a workaround to address this problem:

    1. Create a credential with the following configuration:

      Credential type: GitHub Personal Access Token; (for 2.5 use type Source Control)
      Username: x-token-auth (do not use your bitbucket account);
      Token: The token generated for the bitbucket repository (in the bitbucket WebUI: user's repository >> Repository Settings >> Access tokens >> Create repository access token).

    2. Set the project to use the credential created in the past step and synchronize it.

Root Cause

  • There are three types of credentials available:

    • GitHub Personal Access Token;
    • GitLab Personal Access Token;
    • Container registry

    There is not a specific credential type for bitbucket repositories.

  • In Ansible Automation Platform 2.5 you can use the Source Control credential type to address a different number of source control platforms, including Bitbucket

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments