huawei.enterprise.hw_enterprise_snmp module – SNMP operations for Huawei Enterprise Storage
Note
This module is part of the huawei.enterprise collection (version 2.0.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install huawei.enterprise.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: huawei.enterprise.hw_enterprise_snmp.
Synopsis
Supports the provisioning operations on a SNMP such as modify and get the details of a SNMP.
Requirements
The below requirements are needed on the host that executes this module.
Huawei Dorado v5/v6/v7 and OceanStor v5/v6/v7 Storage
Parameters
Parameter |
Comments |
|---|---|
Read-only community string that is used for reading device information. |
|
Read-write community string that is used for reading or writing device information. |
|
Parameters used to extend those not currently supported by the module. Configuration needs to be based on the REST API documentation for storage. If necessary, you can contact the plugin technical support for assistance. |
|
Parameter required for all query operations. The response will include the storage parameters that match the indicate filter criteria. Choices:
|
|
IP or FQDN of the huawei enterprise management system. MultiIP config as ip1,ip2 |
|
SNMP unique id. |
|
The password of the PowerStore host. |
|
Port, Optional parameters for modify operation. The value is 161 or from 20000 to 20100. |
|
Sets the protocol switch status, Optional parameters for modify operation.
Choices:
|
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the SNMP should exist or not. Choices:
|
|
Port number for the Huawei Enterprise array. If not passed, it will take 8088 as default. Default: |
|
Whether to write plugin log to local filesystem. Choices:
|
|
The username of the PowerStore host. |
|
The path of the SSL certificate variable to specify whether to validate SSL certificate or not. If don’t set means no need to verify ssl cert. |
Notes
Note
The check_mode is not supported.
The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.
Examples
---
tasks:
- name: Set SNMP Community Information
register: modify_snmp
huawei.enterprise.hw_enterprise_snmp:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
operation: "set"
cmo_snmp_rd_community: "{{ cmo_snmp_rd_community }}"
cmo_snmp_wr_community: "{{ cmo_snmp_wr_community }}"
state: "present"
- name: Modify SNMP
register: modify_snmp
huawei.enterprise.hw_enterprise_snmp:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
snmp_snmpv1v2c_status: "< on | off >"
snmp_port: "< snmp_port >"
state: "present"
- name: Query SNMP
register: query_snmp
huawei.enterprise.hw_enterprise_snmp:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
filter:
- snmp_port
- snmp_snmpv1v2c_status
- snmp_address_ipv4
- sys_root_oid
- sys_desc
- syss_objid
state: "present"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
playbook action lists Returned: always Sample: |
|
Whether or not the resource has changed. Returned: always Sample: |
|
task execute remark Returned: always Sample: |
|
Details of the SNMP. Returned: When SNMP exists Sample: |
|
IPv4 address. Returned: always |
|
Port. Returned: always |
|
V1V2 switch status. Returned: always |
|
Default system description. Returned: always |
|
OID of the system root node. Returned: always |
|
System ID. Returned: always |