theforeman.foreman.scap_tailoring_file 模块 – 管理 SCAP 定制文件
注意
此模块是 theforeman.foreman 集合 (版本 4.2.0) 的一部分。
如果您正在使用 ansible 软件包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install theforeman.foreman。您需要其他要求才能使用此模块,有关详细信息,请参阅 需求。
要在剧本中使用它,请指定:theforeman.foreman.scap_tailoring_file。
theforeman.foreman 1.0.0 中的新增功能
概要
- 创建、更新和删除 SCAP 定制文件 
别名:foreman_scap_tailoring_file
需求
在执行此模块的主机上需要以下需求。
- requests 
参数
| 参数 | 注释 | 
|---|---|
| 应将实体分配到的位置列表 | |
| 定制文件的名称。 | |
| 应将实体分配到的组织列表 | |
| XML 文件的原始文件名。 如果未设置,则将使用 *scap_file* 的文件名。 | |
| 访问 Foreman 服务器的用户的密码。 如果任务中未指定该值,则将改用环境变量  | |
| 包含 XML 数据流内容的文件。 创建新的数据流时必需。 | |
| Foreman 服务器的 URL。 如果任务中未指定该值,则将改用环境变量  | |
| 实体的状态 选项 
 | |
| 定制文件的新名称。 设置此参数时,模块将不会是幂等的。 | |
| 访问 Foreman 服务器的用户名。 如果任务中未指定该值,则将改用环境变量  | |
| 是否验证 Foreman 服务器的 TLS 证书。 如果任务中未指定该值,则将改用环境变量  选项 
 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:完全支持 | 可以在 check_mode 下运行并返回已更改状态预测,而无需修改实体 | |
| 支持:完全支持 | 在差异模式下,将返回有关已更改内容(或可能需要在 check_mode 下更改的内容)的详细信息 | 
示例
- name: Create SCAP tailoring file
  theforeman.foreman.scap_tailoring_file:
    name: "Red Hat firefox default content"
    scap_file: "/home/user/Downloads/ssg-firefox-ds-tailoring.xml"
    original_filename: "ssg-firefox-ds-tailoring.xml"
    organizations:
      - "Default Organization"
    locations:
      - "Default Location"
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    state: present
- name: Update SCAP tailoring file
  theforeman.foreman.scap_tailoring_file:
    name: "Red Hat firefox default content"
    updated_name: "Updated tailoring file name"
    scap_file: "/home/user/Downloads/updated-ssg-firefox-ds-tailoring.xml"
    original_filename: "updated-ssg-firefox-ds-tailoring.xml"
    organizations:
      - "Org One"
      - "Org Two"
    locations:
      - "Loc One"
      - "Loc Two"
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    state: present
- name: Delete SCAP tailoring file
  theforeman.foreman.scap_tailoring_file:
    name: "Red Hat firefox default content"
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    state: absent
返回值
常见返回值已记录在 此处,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 按类型分组的受影响实体的最终状态。 返回:成功 | |
| SCAP 定制文件的列表。 返回:成功 | 
