dellemc.openmanage.ome_application_alerts_smtp 模块 – 此模块允许配置 SMTP 或电子邮件配置
注意
此模块是 dellemc.openmanage 集合(版本 9.9.0)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install dellemc.openmanage。您需要进一步的要求才能使用此模块,请参阅 要求 了解详细信息。
要在剧本中使用它,请指定:dellemc.openmanage.ome_application_alerts_smtp。
dellemc.openmanage 4.3.0 中的新增功能
概要
- 此模块允许在 OpenManage Enterprise 和 OpenManage Enterprise Modular 上配置 SMTP 或电子邮件配置。 
要求
执行此模块的主机需要以下要求。
- python >= 3.9.6 
参数
| 参数 | 注释 | 
|---|---|
| 包含要用于验证的 CA 证书的隐私增强邮件 (PEM) 文件。 | |
| SMTP 服务器的凭据 | |
| 访问 SMTP 服务器的密码。 | |
| 访问 SMTP 服务器的用户名。 | |
| SMTP 目标服务器的 IP 地址或 FQDN。 | |
| 启用或禁用访问 SMTP 服务器的身份验证。 如果 enable_authentication 为  当此值为  选项 
 | |
| OpenManage Enterprise 或 OpenManage Enterprise Modular IP 地址或主机名。 | |
| OpenManage Enterprise 或 OpenManage Enterprise Modular 密码。 如果未提供密码,则使用环境变量  示例:export OME_PASSWORD=password | |
| OpenManage Enterprise 或 OpenManage Enterprise Modular HTTPS 端口。 默认值:  | |
| SMTP 目标服务器的端口号。 | |
| 以秒为单位的套接字级别超时。 默认值:  | |
| 使用 SSL 连接到 SMTP 服务器。 选项 
 | |
| OpenManage Enterprise 或 OpenManage Enterprise Modular 用户名。 如果未提供用户名,则使用环境变量  示例:export OME_USERNAME=username | |
| 如果  仅在个人控制的站点上使用自签名证书时,才配置为  在集合版本  选项 
 | |
| 身份验证令牌。 如果未提供 x_auth_token,则使用环境变量  示例:export OME_X_AUTH_TOKEN=x_auth_token | 
注释
注意
- 当 enable_authentication 为 - true时,该模块将始终报告更改。
- 从可以直接访问 Dell OpenManage Enterprise 或 OpenManage Enterprise Modular 的系统运行此模块。 
- 此模块支持 - check_mode。
示例
---
- name: Update SMTP destination server configuration with authentication
  dellemc.openmanage.ome_application_alerts_smtp:
    hostname: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    destination_address: "localhost"
    port_number: 25
    use_ssl: true
    enable_authentication: true
    credentials:
      username: "username"
      password: "password"
- name: Update SMTP destination server configuration without authentication
  dellemc.openmanage.ome_application_alerts_smtp:
    hostname: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    destination_address: "localhost"
    port_number: 25
    use_ssl: false
    enable_authentication: false
返回值
常见返回值在此处记录 此处,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| HTTP 错误的详细信息。 返回: 在 HTTP 错误时 示例:  | |
| SMTP设置更新的总体状态。 返回: 总是 示例:  | |
| 当 SMTP 设置成功更新时返回。 返回: 成功 示例:  | 
