�
�Udac @ s� i d d 6d g d 6d d 6Z d Z d Z d Z d d
l m Z m Z d d l m Z m Z d d l m Z d d
l
m Z d � Z d � Z
d � Z d � Z d � Z d � Z e d k r� e � n d S( s 1.1t metadata_versiont previewt statust networkt supported_bysc
---
module: nxos_snmp_traps
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages SNMP traps.
description:
- Manages SNMP traps configurations.
author:
- Jason Edelman (@jedelman8)
notes:
- Tested against NXOSv 7.3.(0)D1(1) on VIRL
- This module works at the group level for traps. If you need to only
enable/disable 1 specific trap within a group, use the M(nxos_command)
module.
- Be aware that you can set a trap only for an enabled feature.
options:
group:
description:
- Case sensitive group.
required: true
choices: ['aaa', 'bfd', 'bgp', 'bridge', 'callhome', 'cfs', 'config',
'eigrp', 'entity', 'feature-control', 'generic', 'hsrp', 'license',
'link', 'lldp', 'mmode', 'ospf', 'pim', 'rf', 'rmon', 'snmp',
'storm-control', 'stpx', 'switchfabric', 'syslog', 'sysmgr', 'system',
'upgrade', 'vtp', 'all']
state:
description:
- Manage the state of the resource.
required: false
default: enabled
choices: ['enabled','disabled']
s�
# ensure lldp trap configured
- nxos_snmp_traps:
group: lldp
state: enabled
# ensure lldp trap is not configured
- nxos_snmp_traps:
group: lldp
state: disabled
s�
commands:
description: command sent to the device
returned: always
type: list
sample: "snmp-server enable traps lldp ;"
i����( t load_configt run_commands( t nxos_argument_spect
check_args( t get_capabilities( t
AnsibleModulec C s( t | � j d i � } | j d d � S( Nt device_infot network_os_platformt ( R t get( t modulet info( ( sP /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pyt get_platform_idU s c C s! i | d 6d d 6} t | | � S( Nt commandt textt output( R ( R R ( ( sP /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pyt execute_show_commandZ s
c C sG g } x: | D]2 } t | t � r2 | j | � q
| j | � q
W| S( N( t
isinstancet listt extendt append( t
command_listst flat_command_listR ( ( sP /usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pyt flatten_listc s
c C s� t d | � d j d � } i } d d d d d d d
d d d
d d d d d d d d d d d d d d d d d d d g } d! | k r� d"