community.general.ce_snmp_target_host (0.1.1) — module

Manages SNMP target host configuration on HUAWEI CloudEngine switches.

Authors: wangdezhuang (@QijunPan)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Manages SNMP target host configurations on HUAWEI CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: CloudEngine snmp target host test
  hosts: cloudengine
  connection: local
  gather_facts: no
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:

  - name: "Config SNMP version"
    ce_snmp_target_host:
      state: present
      version: v2cv3
      provider: "{{ cli }}"

  - name: "Config SNMP target host"
    ce_snmp_target_host:
      state: present
      host_name: test1
      address: 1.1.1.1
      notify_type: trap
      vpn_name: js
      security_model: v2c
      security_name: wdz
      provider: "{{ cli }}"

Inputs

    
address:
    description:
    - Network Address.

version:
    choices:
    - none
    - v1
    - v2c
    - v3
    - v1v2c
    - v1v3
    - v2cv3
    - all
    description:
    - Version(s) Supported by SNMP Engine.

vpn_name:
    description:
    - VPN instance Name.

host_name:
    description:
    - Unique name to identify target host entry.

recv_port:
    description:
    - UDP Port number used by network management to receive alarm messages.

notify_type:
    choices:
    - trap
    - inform
    description:
    - To configure notify type as trap or inform.

connect_port:
    description:
    - Udp port used by SNMP agent to connect the Network management.

is_public_net:
    choices:
    - no_use
    - 'true'
    - 'false'
    default: no_use
    description:
    - To enable or disable Public Net-manager for target Host.

security_name:
    description:
    - Security Name.

interface_name:
    description:
    - Name of the interface to send the trap message.

security_level:
    choices:
    - noAuthNoPriv
    - authentication
    - privacy
    description:
    - Security level indicating whether to use authentication and encryption.

security_model:
    choices:
    - v1
    - v2c
    - v3
    description:
    - Security Model.

security_name_v3:
    description:
    - Security Name V3.

Outputs

changed:
  description: check to see if a change was made on the device
  returned: always
  sample: true
  type: bool
end_state:
  description: k/v pairs of aaa params after module execution
  returned: always
  sample:
    target host info:
    - address: 10.135.182.158
      domain: snmpUDPDomain
      nmsName: test2
      notifyType: trap
      securityLevel: authentication
      securityModel: v3
      securityNameV3: wdz
      vpnInstanceName: js
  type: dict
existing:
  description: k/v pairs of existing aaa server
  returned: always
  sample: {}
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: always
  sample:
    address: 10.135.182.158
    host_name: test2
    notify_type: trap
    security_level: authentication
    security_model: v3
    security_name_v3: wdz
    state: present
    vpn_name: js
  type: dict
updates:
  description: command sent to the device
  returned: always
  sample:
  - snmp-agent target-host host-name test2 trap address udp-domain 10.135.182.158
    vpn-instance js params securityname wdz v3 authentication
  type: list