theforeman.foreman.os_default_template 模块 – 管理与操作系统的默认模板关联
注意
此模块是 theforeman.foreman 集合 (版本 4.2.0) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install theforeman.foreman。您需要其他要求才能使用此模块,有关详细信息,请参阅 要求。
要在剧本中使用它,请指定:theforeman.foreman.os_default_template。
theforeman.foreman 1.0.0 中的新增功能
概要
- 管理 OSDefaultTemplate 实体 
别名:foreman_os_default_template
要求
执行此模块的主机需要以下要求。
- requests 
参数
| 参数 | 注释 | 
|---|---|
| 操作系统通过其标题查找,标题构成方式为“<name> <major>.<minor>”。 如果您只有一个同名的操作系统,则可以省略版本部分。 | |
| 访问 Foreman 服务器的用户的密码。 如果任务中未指定该值,则将改用环境变量  | |
| 配置模板名称 | |
| Foreman 服务器的 URL。 如果任务中未指定该值,则将改用环境变量  | |
| 实体的状态 
 选项 
 | |
| 模板类型的名称 选项 
 | |
| 访问 Foreman 服务器的用户名。 如果任务中未指定该值,则将改用环境变量  | |
| 是否验证 Foreman 服务器的 TLS 证书。 如果任务中未指定该值,则将改用环境变量  选项 
 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:完全支持 | 可以在 check_mode 下运行并返回更改状态预测,而无需修改实体 | |
| 支持:完全支持 | 在 diff 模式下,将返回有关已更改内容(或在 check_mode 下可能需要更改的内容)的详细信息 | 
示例
- name: "Create an Association"
  theforeman.foreman.os_default_template:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    operatingsystem: "CoolOS"
    template_kind: "finish"
    provisioning_template: "CoolOS finish"
    state: present
- name: "Delete an Association"
  theforeman.foreman.os_default_template:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    operatingsystem: "CoolOS"
    template_kind: "finish"
    state: absent
返回值
常见返回值已记录在 此处,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 按其类型分组的受影响实体的最终状态。 返回:成功 | |
| 操作系统的默认模板列表。 返回:成功 | 
