dellemc.openmanage.redfish_event_subscription 模块 – 管理 Redfish 订阅
注意
此模块是 dellemc.openmanage 集合 (版本 9.9.0) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install dellemc.openmanage。您需要满足其他要求才能使用此模块,有关详细信息,请参阅 要求。
要在 playbook 中使用它,请指定:dellemc.openmanage.redfish_event_subscription。
dellemc.openmanage 4.1.0 中的新增功能
概要
- 此模块允许添加或删除 Redfish 事件订阅。 
要求
执行此模块的主机需要以下要求。
- python >= 3.9.6 
参数
| 参数 | 注释 | 
|---|---|
| 目标带外控制器的 IP 地址。例如 - <ipaddress>:<port>。 | |
| 包含用于验证的 CA 证书的隐私增强邮件 (PEM) 文件。 | |
| 用于发送事件的目标的 HTTPS URI。 需要 HTTPS。 | |
| 指定要订阅的事件的格式类型。 
 
 选项 
 | |
| 指定要订阅的事件类型。 
 
 选项 
 | |
| 目标带外控制器的密码。 如果未提供密码,则使用环境变量  示例:export IDRAC_PASSWORD=password | |
| 
 
 选项 
 | |
| 以秒为单位的套接字级别超时。 默认值:  | |
| 目标带外控制器的用户名。 如果未提供用户名,则使用环境变量  示例:export IDRAC_USERNAME=username | |
| 如果为  仅在使用自签名证书的个人控制站点上配置  在集合版本  选项 
 | |
| 身份验证令牌。 如果未提供 x_auth_token,则使用环境变量  示例:export IDRAC_X_AUTH_TOKEN=x_auth_token | 
备注
注意
- 对于指标订阅,event_type 需要为 - MetricReport,而 event_format_type 需要为- MetricReport。
- 对于事件订阅,event_type 需要为 - Alert,而 event_format_type 需要为- Event。
- 不支持修改订阅。 
- 上下文始终设置为 RedfishEvent。 
- 此模块支持 - check_mode。
示例
---
- name: Add Redfish metric subscription
  redfish_event_subscription:
    baseuri: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    destination: "https://192.168.1.100:8188"
    event_type: MetricReport
    event_format_type: MetricReport
    state: present
- name: Add Redfish alert subscription
  redfish_event_subscription:
    baseuri: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    destination: "https://server01.example.com:8188"
    event_type: Alert
    event_format_type: Event
    state: present
- name: Delete Redfish subscription with a specified destination
  redfish_event_subscription:
    baseuri: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    destination: "https://server01.example.com:8188"
    state: absent
返回值
常见的返回值已在 此处 记录,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| HTTP 错误的详细信息。 返回:HTTP 错误时 示例: | |
| 任务的总体状态。 返回值:始终返回 示例: | |
| 返回已创建的订阅对象 返回值:成功添加订阅时返回 示例: | 
