theforeman.foreman.setting_info 模块 – 获取有关设置的信息

注意

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

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

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

要在剧本中使用它,请指定:theforeman.foreman.setting_info

theforeman.foreman 2.1.0 中的新增功能

概要

  • 获取有关设置的信息

要求

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

  • requests

参数

参数

注释

location

字符串

用于限定搜索范围的位置标签。

name

字符串

要获取信息的资源名称。

search 互斥。

organization

字符串

用于限定搜索范围的组织名称。

password

字符串 / 必需

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

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

字符串

要使用的搜索查询

如果为 None,并且未设置 name,则返回所有资源。

name 互斥。

server_url

字符串 / 必需

Foreman 服务器的 URL。

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

username

字符串 / 必需

访问 Foreman 服务器的用户名。

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

validate_certs

布尔值

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

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

选项

  • false

  • true ←(默认)

属性

属性

支持

描述

check_mode

支持:完整

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

diff_mode

支持:完整

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

示例

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

- name: "Show all settings with proxy"
  theforeman.foreman.setting_info:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    search: "name = proxy"

返回值

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

描述

setting

字典

有关找到的设置的详细信息

返回:成功且传递了 name

settings

列表 / 元素=字典

所有找到的设置及其详细信息的列表

返回:成功且传递了 search

作者

  • Eric Helms (@ehelms)