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服务器的用户的密码。 如果任务中未指定该值,则将使用环境变量 | |
| 拥有该参数的puppetclass的名称 | |
| 如果为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
返回值
常见返回值已在此处记录 此处,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 按类型分组的受影响实体的最终状态。 返回:成功 | |
| 智能类参数列表。 返回:成功 | 
