community.general.ce_snmp_traps (0.1.1) — module

Manages SNMP traps 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 traps configurations on HUAWEI CloudEngine switches.

Usage examples

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

- name: CloudEngine snmp traps 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 trap all enable"
    ce_snmp_traps:
      state: present
      feature_name: all
      provider: "{{ cli }}"

  - name: "Config SNMP trap interface"
    ce_snmp_traps:
      state: present
      interface_type: 40GE
      interface_number: 2/0/1
      provider: "{{ cli }}"

  - name: "Config SNMP trap port"
    ce_snmp_traps:
      state: present
      port_number: 2222
      provider: "{{ cli }}"

Inputs

    
trap_name:
    description:
    - Alarm trap name.

port_number:
    description:
    - Source port number.

feature_name:
    choices:
    - aaa
    - arp
    - bfd
    - bgp
    - cfg
    - configuration
    - dad
    - devm
    - dhcpsnp
    - dldp
    - driver
    - efm
    - erps
    - error-down
    - fcoe
    - fei
    - fei_comm
    - fm
    - ifnet
    - info
    - ipsg
    - ipv6
    - isis
    - l3vpn
    - lacp
    - lcs
    - ldm
    - ldp
    - ldt
    - lldp
    - mpls_lspm
    - msdp
    - mstp
    - nd
    - netconf
    - nqa
    - nvo3
    - openflow
    - ospf
    - ospfv3
    - pim
    - pim-std
    - qos
    - radius
    - rm
    - rmon
    - securitytrap
    - smlktrap
    - snmp
    - ssh
    - stackmng
    - sysclock
    - sysom
    - system
    - tcp
    - telnet
    - trill
    - trunk
    - tty
    - vbst
    - vfs
    - virtual-perception
    - vrrp
    - vstm
    - all
    description:
    - Alarm feature name.

interface_type:
    choices:
    - Ethernet
    - Eth-Trunk
    - Tunnel
    - 'NULL'
    - LoopBack
    - Vlanif
    - 100GE
    - 40GE
    - MTunnel
    - 10GE
    - GE
    - MEth
    - Vbdif
    - Nve
    description:
    - Interface type.

interface_number:
    description:
    - Interface number.

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:
    snmp-agent trap:
    - enable
    undo snmp-agent trap: []
  type: dict
existing:
  description: k/v pairs of existing aaa server
  returned: always
  sample:
    snmp-agent trap: []
    undo snmp-agent trap: []
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: always
  sample:
    feature_name: all
    state: present
  type: dict
updates:
  description: command sent to the device
  returned: always
  sample:
  - snmp-agent trap enable
  type: list