community.general.bitbucket_pipeline_variable module – Manages Bitbucket pipeline variables
Note
This module is part of the community.general collection (version 8.6.7).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.bitbucket_pipeline_variable
.
Synopsis
Manages Bitbucket pipeline variables.
Aliases: source_control.bitbucket.bitbucket_pipeline_variable
Parameters
Parameter |
Comments |
---|---|
The OAuth consumer key. If not set the environment variable |
|
The OAuth consumer secret. If not set the environment variable |
|
The pipeline variable name. |
|
The App password. If not set the environment variable |
|
The repository name. |
|
Whether to encrypt the variable value. Choices:
|
|
Indicates desired state of the variable. Choices:
|
|
The pipeline variable value. |
|
The repository owner. Note: |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Notes
Note
Check mode is supported.
For secured values return parameter
changed
is alwaystrue
.Bitbucket OAuth consumer key and secret can be obtained from Bitbucket profile -> Settings -> Access Management -> OAuth.
Bitbucket App password can be created from Bitbucket profile -> Personal Settings -> App passwords.
If both OAuth and Basic Auth credentials are passed, OAuth credentials take precedence.
Examples
- name: Create or update pipeline variables from the list
community.general.bitbucket_pipeline_variable:
repository: 'bitbucket-repo'
workspace: bitbucket_workspace
name: '{{ item.name }}'
value: '{{ item.value }}'
secured: '{{ item.secured }}'
state: present
with_items:
- { name: AWS_ACCESS_KEY, value: ABCD1234, secured: false }
- { name: AWS_SECRET, value: qwe789poi123vbn0, secured: true }
- name: Remove pipeline variable
community.general.bitbucket_pipeline_variable:
repository: bitbucket-repo
workspace: bitbucket_workspace
name: AWS_ACCESS_KEY
state: absent