esp.bitbucket.bitbucket_branch_permissions_info (1.4.1) — module

Retrieve branch permissions

| "added in version" 1.0.0 of esp.bitbucket"

Authors: Krzysztof Lewandowski (@klewan)

Install collection

Install with ansible-galaxy collection install esp.bitbucket:==1.4.1


Add to requirements.yml

  collections:
    - name: esp.bitbucket
      version: 1.4.1

Description

Search for branch restrictions for the supplied project or repository.

A restriction means preventing writes on the specified branch by all except a set of users and/or groups, or preventing specific operations such as branch deletion.

Authentication can be done with I(token) or with I(username) and I(password).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve branch permissions for the supplied project
  esp.bitbucket.bitbucket_branch_permissions_info:
    url: 'https://bitbucket.example.com'
    username: jsmith
    password: secrect
    project_key: FOO
    validate_certs: no
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve branch permissions for the supplied repository
  esp.bitbucket.bitbucket_branch_permissions_info:
    url: 'https://bitbucket.example.com'
    username: jsmith
    password: secrect
    project_key: FOO
    repository: bar
    validate_certs: no

Inputs

    
url:
    description:
    - Bitbucket Server URL.
    required: false
    type: str

sleep:
    default: 5
    description:
    - Number of seconds to sleep between API retries.
    type: int

token:
    description:
    - Token parameter for authentication.
    - This is only needed when not using I(username) and I(password).
    required: false
    type: str

retries:
    default: 3
    description:
    - Number of retries to call Bitbucket API URL before failure.
    type: int

password:
    description:
    - Password used for authentication.
    - This is only needed when not using I(token).
    - Required when I(username) is provided.
    required: false
    type: str

username:
    description:
    - Username used for authentication.
    - This is only needed when not using I(token).
    - Required when I(password) is provided.
    required: false
    type: str

use_proxy:
    default: true
    description:
    - If C(no), it will not use a proxy, even if one is defined in an environment variable
      on the target hosts.
    type: bool

repository:
    description:
    - Repository name.
    required: false
    type: str

project_key:
    aliases:
    - project
    description:
    - Bitbucket project key.
    required: true
    type: str

validate_certs:
    default: true
    description:
    - If C(no), SSL certificates will not be validated.
    - This should only set to C(no) used on personally controlled sites using self-signed
      certificates.
    type: bool

Outputs

messages:
  description: List of error messages.
  returned: always
  sample:
  - Project `FOOO` does not exist.
  type: list
project_key:
  description: Bitbucket project key.
  returned: always
  sample: FOO
  type: str
repository:
  description: Bitbucket repository name.
  returned: success
  sample: bar
  type: str
restrictions:
  contains:
    accessKeys:
      description: Bitbucket access keys.
      elements: str
      returned: success
      sample: []
      type: list
    groups:
      description: Bitbucket groups.
      elements: str
      returned: success
      sample:
      - bitbucket-admin
      type: list
    matcher:
      description: Matcher description.
      returned: success
      sample:
        active: true
        displayId: Release
        id: RELEASE
        type:
          id: MODEL_CATEGORY
          name: Branching model category
      type: dict
    scope:
      description: Scope.
      returned: success
      sample:
        resourceId: 292
        type: PROJECT
      type: dict
    users:
      description: Bitbucket users.
      elements: str
      returned: success
      sample:
      - joe
      - jsmith
      type: list
  description: List of branch restrictions for the supplied project or repository.
  elements: dict
  returned: always
  type: list