theforeman.foreman.product 模块 – 管理产品

注意

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

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

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

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

theforeman.foreman 1.0.0 中的新增功能

概要

  • 创建和管理产品

别名:katello_product

要求

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

  • requests

参数

参数

注释

描述

字符串

可能很长的描述,在详细视图中向用户显示

gpg_key

字符串

附加到此产品的内容 GPG 密钥名称

标签

字符串

向用户显示的标签

名称

字符串 / 必需

产品名称

组织

字符串 / 必需

实体所在的组织

密码

字符串 / 必需

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

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

server_url

字符串 / 必需

Foreman 服务器的 URL。

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

ssl_ca_cert

字符串

附加到此内容的内容 SSL CA 证书名称

ssl_client_cert

字符串

附加到此内容的内容 SSL 客户端证书名称

ssl_client_key

字符串

附加到此内容的内容 SSL 客户端私钥名称

状态

字符串

实体的状态

present_with_defaults 将确保实体存在,但不会更新现有实体

选项

  • "present" ← (默认)

  • "present_with_defaults"

  • "absent"

sync_plan

字符串

附加到此产品的同步计划名称

用户名

字符串 / 必需

访问 Foreman 服务器的用户名。

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

validate_certs

布尔值

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

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

选项

  • true ← (默认)

属性

属性

支持

描述

check_mode

支持:完全

可以在 check_mode 中运行,并在不修改实体的情况下返回更改状态预测

diff_mode

支持:完全

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

示例

- name: "Create Fedora product with a sync plan"
  theforeman.foreman.product:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "Fedora"
    organization: "My Cool new Organization"
    sync_plan: "Fedora repos sync"
    state: present

- name: "Create CentOS 7 product with content credentials"
  theforeman.foreman.product:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    name: "CentOS 7"
    gpg_key: "RPM-GPG-KEY-CentOS7"
    organization: "My Cool new Organization"
    state: present

返回值

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

描述

实体

字典

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

返回:成功

产品

列表 / 元素=字典

产品列表。

返回:成功

作者

  • Eric D Helms (@ehelms)

  • Matthias Dellweg (@mdellweg) ATIX AG