theforeman.foreman.smart_class_parameter_override_value 模块 – 管理智能类参数覆盖值

注意

此模块是 theforeman.foreman 集合(版本 4.2.0)的一部分。

如果您使用的是 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install theforeman.foreman。您需要进一步的要求才能使用此模块,请参阅 要求 了解详细信息。

要在 Playbook 中使用它,请指定:theforeman.foreman.smart_class_parameter_override_value

theforeman.foreman 3.14.0 中的新增功能

概要

  • 管理智能类参数覆盖值

要求

以下要求需要在执行此模块的主机上满足。

  • requests

参数

参数

注释

match

字符串 / 必需

覆盖匹配

omit

布尔值

Foreman 将不会在分类输出中发送此参数

选择

  • false

  • true

password

字符串 / 必需

访问 Foreman 服务器的用户的密码。

如果任务中未指定该值,则将使用环境变量 FOREMAN_PASSWORD 的值。

puppetclass

别名:puppetclass_name

字符串 / 必需

智能类参数所属的 Puppet 类

server_url

字符串 / 必需

Foreman 服务器的 URL。

如果任务中未指定该值,则将使用环境变量 FOREMAN_SERVER_URL 的值。

smart_class_parameter

别名:parameter

字符串 / 必需

覆盖值所属的智能类参数

state

字符串

实体的状态

选择

  • "present" ← (默认)

  • "absent"

username

字符串 / 必需

访问 Foreman 服务器的用户名。

如果任务中未指定该值,则将使用环境变量 FOREMAN_USERNAME 的值。

validate_certs

布尔值

是否验证 Foreman 服务器的 TLS 证书。

如果任务中未指定该值,则将使用环境变量 FOREMAN_VALIDATE_CERTS 的值。

选择

  • false

  • true ← (默认)

value

任何

覆盖值,如果 omit 为 false,则为必需项

属性

属性

支持

描述

check_mode

支持:完全

可以在 check_mode 下运行并返回已更改状态的预测,而无需修改实体

diff_mode

支持:完全

当处于 diff 模式时,将返回有关已更改内容(或可能需要在 check_mode 中更改的内容)的详细信息

示例

- name: Set ntp::servers override value
  theforeman.foreman.smart_class_parameter_override_value:
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    puppetclass: ntp
    smart_class_parameter: servers
    match: domain=example.org
    value:
      - ntp1.example.org
      - ntp2.example.org
    state: present

返回值

常用返回值记录在 此处,以下是此模块特有的字段

描述

entity

字典

按类型分组的受影响实体的最终状态。

返回:成功

override_values

列表 / 元素=字典

override_values 的列表。

返回:成功

作者

  • Evgeni Golov (@evgeni)