telekom_mms.icinga_director.icinga_timeperiod_template 模块 – 在 Icinga2 中管理时间段模板
注意
此模块是 telekom_mms.icinga_director 集合 (版本 2.2.1) 的一部分。
如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install telekom_mms.icinga_director。
要在 playbook 中使用它,请指定:telekom_mms.icinga_director.icinga_timeperiod_template。
telekom_mms.icinga_director 1.17.0 中的新增功能
概要
- 通过 director API 在 Icinga2 中添加或删除时间段模板。 
参数
| 参数 | 注释 | 
|---|---|
| 不要覆盖整个对象,而是追加定义的属性。 注意 - 无法追加到现有的变量、导入或任何其他列表/字典。您必须覆盖完整的列表/字典。 注意 - 即使未设置,默认设置的变量也会应用。 选项 
 | |
| 用于 SSL 客户端身份验证的 PEM 格式证书链文件。 此文件还可以包含密钥,如果包含密钥,则不需要  | |
| 包含用于 SSL 客户端身份验证的私钥的 PEM 格式文件。 如果  | |
| 已禁用的对象不会被部署。 选项 
 | |
| 此时间段模板的替代名称。 | |
| 从此时间段中排除其他时间段。 默认:  | |
| 如果  选项 
 | |
| 用于标识的标头,通常出现在 Web 服务器日志中。 默认:  | |
| 可导入的模板,您可以添加任意多个。 请注意,从多个模板导入属性时,顺序很重要 - 最后一个获胜。 默认:  | |
| 将其他时间段包含在此时间段中。 默认:  | |
| 时间段的名称。 | |
| 是偏向时间段包含还是排除。默认为 true。 选项 
 | |
| 日期和时间段的字典。 | |
| 应用功能状态。 选项 
 | |
| 定义更新方法。 默认:  | |
| 格式为 (http|https|ftp)://[user[:pass]]@host.domain[:port]/path 的 HTTP、HTTPS 或 FTP URL | |
| 用于 HTTP 基本身份验证的密码。 如果未指定  | |
| 用于 HTTP 基本身份验证的用户名。 此参数可用于允许空密码的站点,无需  | |
| 使用GSSAPI进行身份验证,通常用于Kerberos或通过Negotiate身份验证的Kerberos。 需要安装Python库gssapi。 GSSAPI的凭据可以通过 即使已安装用于NTLM的GSSAPI机制,也不支持NTLM身份验证。 选项 
 | |
| 如果为 选项 
 | |
| 如果为 这仅应在使用自签名证书的个人控制站点上使用。 选项 
 | |
| 设置区域。 | 
备注
注意
- 此模块支持检查模式。 
示例
- name: Create timeperiod template
  telekom_mms.icinga_director.icinga_timeperiod_template:
    state: present
    url: "{{ icinga_url }}"
    url_username: "{{ icinga_user }}"
    url_password: "{{ icinga_pass }}"
    object_name: "timeperiod_template"
    imports: []
    disabled: false
    prefer_includes: false
    ranges:
      monday: "00:00-23:59"
      tuesday: "00:00-23:59"
      wednesday: "00:00-23:59"
      thursday: "00:00-23:59"
      friday: "00:00-23:59"
      saturday: "00:00-23:59"
      sunday: "00:00-23:59"
    update_method: "LegacyTimePeriod"
- name: Update timeperiod template
  telekom_mms.icinga_director.icinga_timeperiod_template:
    state: present
    url: "{{ icinga_url }}"
    url_username: "{{ icinga_user }}"
    url_password: "{{ icinga_pass }}"
    object_name: "timeperiod_template"
    display_name: "timeperiod template"
    append: true
