On this page
community.general.bitbucket_pipeline_variable – Manages Bitbucket pipeline variables
Note
This plugin is part of the community.general collection (version 3.8.1).
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.
 
Parameters
| Parameter | Choices/Defaults | Comments | 
|---|---|---|
| client_id
        
        string
         | 
      
        
        The OAuth consumer key.
        
       
        If not set the environment variable  BITBUCKET_CLIENT_ID will be used.
        | 
     |
| client_secret
        
        string
         | 
      
        
        The OAuth consumer secret.
        
       
        If not set the environment variable  BITBUCKET_CLIENT_SECRET will be used.
        | 
     |
| name
        
        string / required
         | 
      
        
        The pipeline variable name.
         | 
     |
| repository
        
        string / required
         | 
      
        
        The repository name.
         | 
     |
| secured
        
        boolean
         | 
      
       
  | 
      
        
        Whether to encrypt the variable value.
         | 
     
| state
        
        string / required
         | 
      
       
  | 
      
        
        Indicates desired state of the variable.
         | 
     
| username
        
        string / required
         | 
      
        
        The repository owner.
         | 
     |
| value
        
        string
         | 
      
        
        The pipeline variable value.
         | 
     
Notes
Note
- Bitbucket OAuth consumer key and secret can be obtained from Bitbucket profile -> Settings -> Access Management -> OAuth.
 - Check mode is supported.
 - For secured values return parameter 
changedis alwaysTrue. 
Examples
- name: Create or update pipeline variables from the list
  community.general.bitbucket_pipeline_variable:
    repository: 'bitbucket-repo'
    username: bitbucket_username
    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
    username: bitbucket_username
    name: AWS_ACCESS_KEY
    state: absent
  Authors
- Evgeniy Krysanov (@catcombo)
 
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
 https://docs.ansible.com/ansible/latest/collections/community/general/bitbucket_pipeline_variable_module.html