inspur.ispim.edit_smtp_dest 模块 – 设置 SMTP 信息

注意

此模块是 inspur.ispim 集合 (版本 2.2.3) 的一部分。

如果您正在使用 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install inspur.ispim。您需要其他要求才能使用此模块,请参阅 要求 获取详细信息。

要在剧本中使用它,请指定: inspur.ispim.edit_smtp_dest

inspur.ispim 1.0.0 中的新增功能

概要

  • 在 Inspur 服务器上设置 SMTP 目标信息。

  • 只有 M6 型号支持此功能。

要求

执行此模块的主机需要以下要求。

  • Python 3.7+

  • inspursmsdk

参数

参数

注释

address

字符串

电子邮件地址。

description

字符串

描述信息。

host

字符串

指定通过指定的传输连接到远程设备的 DNS 主机名或地址。host 的值用作传输的目标地址。

id

整数 / 必需

电子邮件目标 ID。

选项

  • 1

  • 2

  • 3

  • 4

password

字符串

指定用于验证与远程设备连接的密码。如果任务中未指定该值,则将使用环境变量 ANSIBLE_NET_PASSWORD 的值。

provider

字典

包含连接详细信息的字典对象。

host

字符串

指定通过指定的传输连接到远程设备的 DNS 主机名或地址。host 的值用作传输的目标地址。

password

字符串

指定用于验证与远程设备连接的密码。如果任务中未指定该值,则将使用环境变量 ANSIBLE_NET_PASSWORD 的值。

username

字符串

配置用于验证与远程设备连接的用户名。如果任务中未指定该值,则将使用环境变量 ANSIBLE_NET_USERNAME 的值。

status

字符串

电子邮件启用。

选项

  • "启用"

  • "禁用"

username

字符串

配置用于验证与远程设备连接的用户名。如果任务中未指定该值,则将使用环境变量 ANSIBLE_NET_USERNAME 的值。

备注

注意

  • 不支持 check_mode

示例

- name: Smtp  dest test
  hosts: ism
  connection: local
  gather_facts: no
  vars:
    ism:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Set smtp dest information"
    inspur.ispim.edit_smtp_dest:
      id: 1
      status: "disable"
      provider: "{{ ism }}"

  - name: "Set smtp dest information"
    inspur.ispim.edit_smtp_dest:
      id: 1
      status: "enable"
      address: "100.2.2.2"
      description": "test"
      provider: "{{ ism }}"

返回值

常见的返回值已在 此处 记录,以下是此模块特有的字段

描述

changed

布尔值

检查设备上是否进行了更改。

返回:始终

message

字符串

模块执行后返回的消息。

返回:始终

state

字符串

模块执行后的状态。

返回:始终

作者

  • 王保山 (@ispim)