community.general.bitbucket_pipeline_variable 模块 – 管理 Bitbucket 流水线变量
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您正在使用 ansible
包,您可能已经安装了这个集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。
要在 playbook 中使用它,请指定:community.general.bitbucket_pipeline_variable
。
概要
管理 Bitbucket 流水线变量。
参数
参数 |
注释 |
---|---|
OAuth 消费者密钥。 如果未设置,将使用环境变量 |
|
OAuth 消费者密钥。 如果未设置,将使用环境变量 |
|
流水线变量名称。 |
|
App 密码。 如果未设置,将使用环境变量 |
|
仓库名称。 |
|
是否加密变量值。 选择
|
|
指示变量的期望状态。 选择
|
|
流水线变量值。 |
|
仓库所有者。 注意: |
属性
属性 |
支持 |
描述 |
---|---|---|
支持: 完全 |
可以在 |
|
支持: 无 |
当处于 diff 模式时,将返回有关已更改(或可能需要在 |
说明
注意
支持检查模式。
对于安全值,返回参数
changed
始终为true
。Bitbucket OAuth 消费者密钥和密钥可以从 Bitbucket 个人资料 -> 设置 -> 访问管理 -> OAuth 中获得。
Bitbucket App 密码可以从 Bitbucket 个人资料 -> 个人设置 -> App 密码中创建。
如果同时传递 OAuth 和基本身份验证凭据,则 OAuth 凭据优先。
示例
- 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