theforeman.foreman.setting 模块 – 管理设置

注意

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

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

要安装它,请使用: ansible-galaxy collection install theforeman.foreman。您需要其他要求才能使用此模块,请参阅 要求 获取详细信息。

要在 playbook 中使用它,请指定: theforeman.foreman.setting

theforeman.foreman 1.0.0 中的新增功能

概要

  • 管理设置

别名:foreman_setting

要求

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

  • requests

参数

参数

注释

name

字符串 / 必需

设置的名称

password

字符串 / 必需

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

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

server_url

字符串 / 必需

Foreman 服务器的 URL。

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

username

字符串 / 必需

访问 Foreman 服务器的用户名。

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

validate_certs

布尔值

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

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

选项

  • false

  • true ← (默认)

value

任意

要将设置设为的值

如果缺失,则重置为默认值

属性

属性

支持

描述

check_mode

支持:完全

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

diff_mode

支持:完全

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

备注

注意

  • 要获取您的安装中可能的设置列表,请使用 theforeman.foreman.setting_info 模块或 hammer settings list 命令,并查找 name 属性。

  • Web 界面默认显示 full_name 属性,该属性不能与此模块一起使用。

示例

- name: "Set a Setting"
  theforeman.foreman.setting:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "http_proxy"
    value: "https://127.0.0.1:8088"

- name: "Reset a Setting"
  theforeman.foreman.setting:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "http_proxy"

返回值

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

描述

entity

字典

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

返回:成功

settings

列表 / 元素=字典

设置列表。

返回:成功

foreman_setting

字典

设置的创建/更新状态(已弃用)

返回:成功

作者

  • Matthias M Dellweg (@mdellweg) ATIX AG