community.general.bitbucket_pipeline_key_pair 模块 – 管理 Bitbucket pipeline SSH 密钥对
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了这个集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。
要在 playbook 中使用它,请指定:community.general.bitbucket_pipeline_key_pair
。
概要
管理 Bitbucket pipeline SSH 密钥对。
参数
参数 |
注释 |
---|---|
OAuth 消费者密钥。 如果未设置,将使用环境变量 |
|
OAuth 消费者密钥。 如果未设置,将使用环境变量 |
|
App 密码。 如果未设置,将使用环境变量 |
|
私钥。 |
|
公钥。 |
|
仓库名称。 |
|
指示密钥对的期望状态。 选择
|
|
仓库所有者。 注意: |
属性
属性 |
支持 |
描述 |
---|---|---|
支持:完全 |
可以在 |
|
支持:无 |
在 diff 模式下,将返回已更改(或可能需要在 |
备注
注意
支持检查模式。
Bitbucket OAuth 消费者密钥和密钥可以从 Bitbucket 个人资料 -> 设置 -> 访问管理 -> OAuth 获取。
Bitbucket App 密码可以从 Bitbucket 个人资料 -> 个人设置 -> App 密码创建。
如果同时传递 OAuth 和基本身份验证凭据,则 OAuth 凭据优先。
示例
- name: Create or update SSH key pair
community.general.bitbucket_pipeline_key_pair:
repository: 'bitbucket-repo'
workspace: bitbucket_workspace
public_key: '{{lookup("file", "bitbucket.pub") }}'
private_key: '{{lookup("file", "bitbucket") }}'
state: present
- name: Remove SSH key pair
community.general.bitbucket_pipeline_key_pair:
repository: bitbucket-repo
workspace: bitbucket_workspace
state: absent