theforeman.foreman.smart_class_parameter 模块 – 管理智能类参数
注意
此模块是 theforeman.foreman 集合(版本 4.2.0)的一部分。
如果您正在使用 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install theforeman.foreman
。您需要其他要求才能使用此模块,有关详细信息,请参阅 要求。
要在 Playbook 中使用它,请指定:theforeman.foreman.smart_class_parameter
。
theforeman.foreman 1.0.0 中的新增功能
概要
更新智能类参数。
智能类参数是在导入期间为 Puppet 类创建/删除的,否则无法创建或删除。
别名:foreman_smart_class_parameter
要求
执行此模块的主机需要以下要求。
requests
参数
参数 |
注释 |
---|---|
删除重复值(仅限数组类型) 选项
|
|
默认使用的值。 |
|
智能类参数的描述 |
|
启用后,该参数将在 UI 中隐藏。 选项
|
|
在合并所有匹配值时包括默认值。 选项
|
|
合并所有匹配的值(仅限数组/哈希类型)。 选项
|
|
不要在分类输出中发送此参数。 Puppet 将为此参数使用 Puppet 清单中定义的值。 选项
|
|
智能类参数值是否由 Foreman 管理 选项
|
|
解析值的顺序。 |
|
值覆盖 |
|
覆盖匹配 |
|
不要在分类输出中发送此参数,替换 use_puppet_default。 选项
|
|
覆盖值,如果 omit 为 false,则必需 |
|
参数的名称 |
|
变量值的类型。如果为 选项
|
|
访问 Foreman 服务器的用户的密码。 如果任务中未指定该值,则将使用环境变量 |
|
拥有该参数的 Puppet 类的名称 |
|
如果为 true,则如果没有默认值且没有匹配器提供值,则会引发错误。 选项
|
|
Foreman 服务器的 URL。 如果任务中未指定该值,则将使用环境变量 |
|
实体的状态。 选项
|
|
访问 Foreman 服务器的用户名。 如果任务中未指定该值,则将使用环境变量 |
|
是否验证 Foreman 服务器的 TLS 证书。 如果任务中未指定该值,则将使用环境变量 选项
|
|
用于强制执行参数值的某些值。 |
|
验证值的类型。 选项
|
属性
属性 |
支持 |
描述 |
---|---|---|
支持:完整 |
可以在 check_mode 中运行并返回已更改的状态预测,而无需修改实体 |
|
支持:完整 |
当处于 diff 模式时,将返回有关已更改的内容(或可能需要在 check_mode 中更改的内容)的详细信息 |
示例
- name: "Update prometheus::server alertmanagers_config param default value"
theforeman.foreman.smart_class_parameter:
puppetclass_name: "prometheus::server"
parameter: alertmanagers_config
override: true
required: true
default_value: /etc/prometheus/alert.yml
server_url: "https://foreman.example.com"
username: "admin"
password: "changeme"
state: present
- name: "Update prometheus::server alertmanagers_config param default value"
theforeman.foreman.smart_class_parameter:
puppetclass_name: "prometheus::server"
parameter: alertmanagers_config
override: true
override_value_order:
- fqdn
- hostgroup
- domain
required: true
default_value: /etc/prometheus/alert.yml
server_url: "https://foreman.example.com"
username: "admin"
password: "changeme"
override_values:
- match: domain=example.com
value: foo
- match: domain=foo.example.com
omit: true
state: present
返回值
常见返回值记录在此处,以下是此模块特有的字段
键 |
描述 |
---|---|
受影响实体的最终状态,按其类型分组。 返回:成功 |
|
智能类参数的列表。 返回:成功 |