theforeman.foreman.content_export_info 模块 – 列出内容导出
注意
此模块是 theforeman.foreman 集合(版本 4.2.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install theforeman.foreman
。您需要其他要求才能使用此模块,请参阅 要求 以了解详细信息。
要在 playbook 中使用它,请指定:theforeman.foreman.content_export_info
。
theforeman.foreman 3.5.0 中的新增功能
概要
列出有关内容导出的信息。
要求
在执行此模块的主机上需要以下要求。
requests
参数
参数 |
注释 |
---|---|
内容视图名称。 |
|
内容视图版本。 |
|
目标服务器名称 |
|
导出历史标识符。 |
|
用于限定搜索范围的位置标签。 |
|
用于限定搜索范围的组织名称。 |
|
访问 Foreman 服务器的用户的密码。 如果未在任务中指定该值,则将改用环境变量 |
|
要使用的搜索查询 如果为 None,则返回所有资源。 |
|
Foreman 服务器的 URL。 如果未在任务中指定该值,则将改用环境变量 |
|
指定完整导出或增量导出。 选项
|
|
访问 Foreman 服务器的用户名。 如果未在任务中指定该值,则将改用环境变量 |
|
是否验证 Foreman 服务器的 TLS 证书。 如果未在任务中指定该值,则将改用环境变量 选项
|
属性
属性 |
支持 |
描述 |
---|---|---|
支持:完整 |
可以在 check_mode 下运行,并返回更改的状态预测,而无需修改实体 |
|
支持:完整 |
在 diff 模式下,将返回有关已更改内容(或可能需要在 check_mode 下更改的内容)的详细信息 |
示例
- name: "List all full exports in the organization"
theforeman.foreman.content_export_info:
organization: "Default Organization"
type: complete
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
- name: "Get a specific export history and register the result for the next task"
vars:
organization_name: "Export Org"
theforeman.foreman.content_export_info:
id: 29
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
register: result
- name: "Write metadata.json to disk using data from the previous task"
vars:
metadata: "{{ result['content_exports'][0]['metadata'] }}"
ansible.builtin.copy:
content: "{{ metadata }}"
dest: ./metadata.json
- name: "List all exports of a specific content view version"
theforeman.foreman.content_export_info:
content_view: RHEL8
content_view_version: '1.0'
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
- name: "List all exports marked for a specific destination server"
theforeman.foreman.content_export_info:
destination_server: "airgapped.example.com"
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
- name: "List incremental exports of a specific content view marked for a specific destination server"
theforeman.foreman.content_export_info:
content_view: RHEL8
destination_server: "airgapped.example.com"
type: incremental
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
- name: "List all exports of a specific content view marked for a specific destination server"
theforeman.foreman.content_export_info:
content_view: RHEL8
destination_server: "airgapped.example.com"
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"