theforeman.foreman.content_export_version 模块 – 管理内容视图版本内容导出

注意

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

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

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

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

theforeman.foreman 3.6.0 中的新增功能

概要

  • 将内容视图版本导出到目录。

要求

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

  • requests

参数

参数

注释

chunk_size_gb

整数

将导出的内容拆分为不超过指定大小(以千兆字节为单位)的存档。

仅适用于 format=importablesyncable 导出无法拆分。

content_view

字符串 / 必需

内容视图名称。

content_view_version

字符串 / 必需

内容视图版本,例如“7.0”

destination_server

字符串

目标服务器名称;可选参数,用于区分不同的导出

fail_on_missing_content

布尔值

如果此版本中的任何存储库不可导出,则失败。

选择

  • false

  • true

format

字符串

在 theforeman.foreman 3.10.0 中添加

导出格式。

如果导出的内容需要为 yum 格式,请选择 syncable

选择

  • "syncable"

  • "importable"

from_history_id

整数

用于增量导出的导出历史标识符。如果未提供,将使用最近的导出历史记录。

incremental

布尔值

仅导出自上次导出以来已更改的内容。

选择

  • false

  • true

organization

字符串 / 必需

实体所在的组织

password

字符串 / 必需

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

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

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: "Export content view version (full)"
  theforeman.foreman.content_export_version:
    content_view: RHEL8
    content_view_version: '1.0'
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    organization: "Default Organization"
    destination_server: "airgapped.example.com"

- name: "Export content view version (full) in chunks of 10 GB"
  theforeman.foreman.content_export_version:
    content_view: RHEL8
    content_view_version: '1.0'
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    organization: "Default Organization"
    destination_server: "airgapped.example.com"
    chunk_size_gb: 10

- name: "Export content view version (full) and fail if any repos are unexportable"
  theforeman.foreman.content_export_version:
    content_view: RHEL8
    content_view_version: '1.0'
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    organization: "Default Organization"
    destination_server: "airgapped.example.com"
    fail_on_missing_content: true

- name: "Export content view version (incremental) since the most recent export"
  theforeman.foreman.content_export_version:
    content_view: RHEL8
    content_view_version: '1.0'
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    organization: "Default Organization"
    destination_server: "airgapped.example.com"
    incremental: true

- name: "Export content view version (incremental) since a specific export"
  theforeman.foreman.content_export_version:
    content_view: RHEL8
    content_view_version: '1.0'
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    organization: "Default Organization"
    destination_server: "airgapped.example.com"
    incremental: true
    from_history_id: 12345

作者

  • Jeremy Lenz (@jeremylenz)