esp.bitbucket.bitbucket_project_permissions_info (1.4.1) — module

Retrieve Bitbucket project permissions information

| "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

Retrieve a list of groups and users that have been granted at least one permission for the specified project.

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 Bitbucket project permissions information
  esp.bitbucket.bitbucket_project_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 Bitbucket project permissions, only group or user names containing the supplied filter strings will be returned
  esp.bitbucket.bitbucket_project_permissions_info:
    url: 'https://bitbucket.example.com'
    token: 'MjA2M...hqP58'
    project_key: FOO
    filters: [ admin, read ]
    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

filters:
    default:
    - '*'
    description:
    - If specified, only group or user names containing the supplied filter strings will
      be returned.
    - This can be '*' which means all groups and users.
    - Filters are concatenated with OR operator.
    required: false
    type: list

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

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

groups:
  contains:
    group:
      contains:
        name:
          description: Bitbucket group name.
          returned: success
          sample: group-read
          type: str
      description: Bitbucket group details.
      returned: success
      type: dict
    permission:
      description: Bitbucket permission name.
      returned: success
      sample: PROJECT_READ
      type: str
  description: List of Bitbucket groups that have been granted at least one permission
    for the specified project.
  elements: dict
  returned: always
  type: list
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
users:
  contains:
    permission:
      description: Bitbucket permission name.
      returned: success
      sample: PROJECT_ADMIN
      type: str
    user:
      contains:
        active:
          description: Bitbucket user active status.
          returned: success
          sample: true
          type: bool
        displayName:
          description: Bitbucket user displayName.
          returned: success
          sample: admin
          type: str
        id:
          description: Bitbucket user id.
          returned: success
          sample: 9000
          type: int
        name:
          description: Bitbucket user name.
          returned: success
          sample: admin
          type: str
        slug:
          description: Bitbucket user slug.
          returned: success
          sample: admin
          type: str
        type:
          description: Bitbucket user type.
          returned: success
          sample: NORMAL
          type: str
      description: Bitbucket user details.
      returned: success
      type: dict
  description: List of Bitbucket users that have been granted at least one permission
    for the specified project.
  elements: dict
  returned: always
  type: list