theforeman.foreman.webhook 模块 – 管理 Webhooks
注意
此模块是 theforeman.foreman 集合(版本 4.2.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install theforeman.foreman
。您需要进一步的要求才能使用此模块,有关详细信息,请参阅要求。
要在 Playbook 中使用它,请指定:theforeman.foreman.webhook
。
theforeman.foreman 4.0.0 中的新增功能
概要
管理 Webhooks
要求
执行此模块的主机需要满足以下要求。
requests
参数
参数 |
注释 |
---|---|
启用或禁用 Webhook 选项
|
|
应触发 Webhook 的事件的名称 创建新 Webhook 时为必填项 |
|
Webhook 的 HTTP 内容类型 |
|
Webhook 的 HTTP 标头 |
|
Webhook 中使用的 HTTP 方法 选项
|
|
实体应分配到的位置列表 |
|
Webhook 的名称 |
|
实体应分配到的组织列表 |
|
访问 Foreman 服务器的用户的密码。 如果未在任务中指定该值,则将改用环境变量 |
|
使用客户端证书授权并从“设置”验证 CA 选项
|
|
Foreman 服务器的 URL。 如果未在任务中指定该值,则将改用环境变量 |
|
以 PEM 格式连接的 X509 证书颁发机构 |
|
实体的状态 选项
|
|
触发 Webhook 时要调用的 URL 创建新 Webhook 时为必填项 |
|
访问 Foreman 服务器的用户名。 如果未在任务中指定该值,则将改用环境变量 |
|
是否验证 Foreman 服务器的 TLS 证书。 如果未在任务中指定该值,则将改用环境变量 选项
|
|
验证 Webhook 的 SSL 证书 选项
|
|
Webhook 的密码(如果需要) |
|
Webhook 模板的名称 |
|
Webhook 的用户名(如果需要) |
属性
属性 |
支持 |
描述 |
---|---|---|
支持: 完全 |
可以在 check_mode 中运行并返回已更改状态的预测,而无需修改实体 |
|
支持: 完全 |
在 diff 模式下,将返回有关已更改的内容(或可能需要在 check_mode 中更改的内容)的详细信息 |
示例
- name: 'Create Webhook'
theforeman.foreman.webhook:
username: 'admin'
password: 'secret_password'
server_url: 'https://foreman.example.com'
name: 'test-webhook'
target_url: 'https://google.com'
http_method: 'GET'
event: 'actions.katello.content_view.promote_succeeded'
enabled: true
organizations:
- 'MyOrg'
locations:
- 'DC1'
- name: 'Remove Webhook'
theforeman.foreman.webhook:
username: 'admin'
password: 'secret_password'
server_url: 'https://foreman.example.com'
name: 'test-webhook'
state: 'absent'
返回值
常见的返回值记录在此处,以下是此模块特有的字段
键 |
描述 |
---|---|
受影响实体的最终状态按其类型分组。 返回: 成功 |
|
Webhooks 列表。 返回: 成功 |