ieisystem.inmanage.edit_snmp 模块 – 设置 snmp

注意

此模块是 ieisystem.inmanage 集合 (版本 3.0.0) 的一部分。

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

要安装它,请使用:ansible-galaxy collection install ieisystem.inmanage。您需要进一步的要求才能使用此模块,有关详细信息,请参阅 要求

要在 playbook 中使用它,请指定:ieisystem.inmanage.edit_snmp

ieisystem.inmanage 1.0.0 中的新增功能

概要

  • 在 ieisystem 服务器上设置 snmp。

要求

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

  • Python 3.7+

  • inManage

参数

参数

注释

auth_password

字符串

设置 V3 陷阱或 v3get/v3set 的身份验证密码。

密码是 8 到 16 个字母数字字符的字符串。

auth_protocolSHAMD5 时,此项为必需。

auth_protocol

字符串

选择 V3 陷阱或 v3get/v3set 的身份验证协议。

选择

  • "NONE"

  • "SHA"

  • "MD5"

community

字符串

v1/v2c 或 v1get/v1set/v2cget/v2cset 的 Community。

只有 M5 型号支持此功能。

host

字符串

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

password

字符串

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

priv_password

字符串

设置 V3 陷阱或 v3get/v3set 的隐私密码。

密码是 8 到 16 个字母数字字符的字符串。

priv_protocolDESAES 时,此项为必需。

priv_protocol

字符串

选择 V3 陷阱或 v3get/v3set 的隐私协议。

选择

  • "NONE"

  • "DES"

  • "AES"

provider

字典

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

host

字符串

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

password

字符串

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

username

字符串

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

read_community

字符串

只读 Community,Community 应介于 1 到 16 个字符之间。

只有 M6 型号支持此功能。

read_write_community

字符串

读写 Community,Community 应介于 1 到 16 个字符之间。

只有 M6 型号支持此功能。

snmp_status

列表 / 元素=字符串

自定义的 NMP 读取/写入状态。

输入参数为 ‘v1get’、‘v1set’、‘v2cget’、‘v2cset’、‘v3get’、‘v3set’,以逗号分隔,例如 v1get, v1set, v2cget。

只有 M5 型号支持此功能。

username

字符串

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

v1status

字符串

启用 SNMP V1。

选择

  • "enable"

  • "disable"

v2status

字符串

启用 SNMP V2。

选择

  • "enable"

  • "disable"

v3status

字符串

启用 SNMP V3。

选择

  • "enable"

  • "disable"

v3username

字符串

为 V3 陷阱或 v3get/v3set 设置用户名。

version

整数

SNMP 陷阱版本选项,0 - ‘v1’,1 - ‘v2c’,2 - ‘v3’,3 - ‘all’,4 - ‘customize’。

只有 M5 型号支持此功能。

选择

  • 0

  • 1

  • 2

  • 3

  • 4

说明

注意

  • 不支持 check_mode

示例

- name: Snmp test
  hosts: inmanage
  no_log: true
  connection: local
  gather_facts: false
  vars:
    inmanage:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Set snmp get/set"
    ieisystem.inmanage.edit_snmp:
      community: "test"
      v3username: "test"
      provider: "{{ inmanage }}"

返回值

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

描述

changed

布尔值

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

返回:总是

message

字符串

模块执行后返回的消息。

返回:总是

state

字符串

模块执行后的状态。

返回:总是

作者

  • WangBaoshan (@ieisystem)