cisco.ios.ios_snmp_server module – Resource module to configure snmp server.
Note
This module is part of the cisco.ios collection (version 9.0.3).
You might already have this collection installed if you are using the ansible
package.
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 cisco.ios
.
To use it in a playbook, specify: cisco.ios.ios_snmp_server
.
New in cisco.ios 2.6.0
Synopsis
This module provides declarative management of SNMP server on Cisco IOS devices.
Parameters
Parameter |
Comments |
---|---|
A dictionary of SNMP server configuration |
|
SNMP Accounting parameters |
|
For SNMP set commands |
|
Enable SNMP cache and MIB expiry interval |
|
String to uniquely identify this chassis (Hexadecimal) |
|
Community name configuration. |
|
standard access-list name |
|
IPv6 access list name |
|
Community name (default RO) |
|
Only reads are permitted Choices:
|
|
Read-write access Choices:
|
|
MIB view name |
|
Text for mib object sysContact |
|
Create/Delete a context apart from default |
|
Silently drop SNMP packets |
|
Silently drop unknown v3 user packets Choices:
|
|
Silently drop SNMP packets that come on VRF interfaces Choices:
|
|
Configure a local or remote SNMPv3 engineID |
|
engine ID octet string |
|
Local SNMP agent Choices:
|
|
Remote SNMP agent |
|
Hostname or IP address of remote SNMP notification host |
|
The remote SNMP notification host’s UDP port number. |
|
The remote notification host’s VPN routing instance |
|
File transfer related commands |
|
Access control for file transfers |
|
Access control protocol for file transfers |
|
Define a User Security Model group |
|
specify an access-list associated with this group |
|
specify an access-list associated with this group |
|
Specify a context to associate with the group |
|
SNMP group for the user |
|
Specify a context name match criteria Choices:
|
|
View to restrict notifications |
|
View to restrict read access |
|
snmp security group version Choices:
|
|
community name to the host. Choices:
|
|
View to restrict write access |
|
Specify hosts to receive SNMP notifications |
|
SNMPv1/v2c community string or SNMPv3 user name |
|
Hostname or IP address of SNMP notification host. |
|
Use SNMP inform messages. Choices:
|
|
Use SNMP trap messages |
|
Notification message SNMP version. Choices:
|
|
community name to the host. Choices:
|
|
Specify the VRF in which the host is configured |
|
Enable ifindex persistence Choices:
|
|
Configure SNMP Informs options |
|
Set number of unacked informs to hold |
|
Set retry count for informs |
|
Set timeout for informs |
|
IP ToS configuration for SNMP traffic |
|
IP DSCP value for SNMP traffic |
|
IP Precedence value for SNMP traffic |
|
Text for mib object sysLocation |
|
Modify SNMP manager parameters |
|
Largest SNMP packet size |
|
SNMP v3 users password policy |
|
Number of Character changes b/w old and new password |
|
Number of digits |
|
Number of lower-case characters |
|
Maximum password length |
|
Minimum password length |
|
Name of the policy |
|
Number of special case character |
|
Number of upper-case characters |
|
Name of the user |
|
Message queue length for each TRAP host |
|
Source interface to be used for sending out SNMP notifications. |
|
Enable use of the SNMP reload command Choices:
|
|
Assign an interface for the source address of all traps |
|
Set timeout for TRAP message retransmissions |
|
Enable SNMP Traps |
|
Enable SNMP AAA Server traps Choices:
|
|
Enable SNMP CISCO-AUTH-FRAMEWORK-MIB traps |
|
Enable/disable auth framework Choices:
|
|
Mode sec_violation Choices:
|
|
Allow SNMP BFD traps |
|
Enable/disable bfd Choices:
|
|
Enable BFD session down traps Choices:
|
|
Enable BFD session up traps Choices:
|
|
Allow bgp traps |
|
Enable BGP MIBv2 traps Choices:
|
|
Enable/disable bgp traps Choices:
|
|
Traps for FSM state changes |
|
CISCO specific trap for all fsm state changes Choices:
|
|
CISCO specific trap for backward transition Choices:
|
|
Enable/disable bgp state_changes traps Choices:
|
|
Trap for standard backward transition and established Choices:
|
|
Mode threshold |
|
Enable/disable bgp threshold traps Choices:
|
|
Allow bridge related traps |
|
Enable/disable bridge traps Choices:
|
|
Enable SNMP STP Bridge MIB newroot traps Choices:
|
|
Enable SNMP STP Bridge MIB topologychange traps Choices:
|
|
Allow Data-Collection-MIB Collection notifications |
|
Enable Data-Collection-MIB Collection notifications Choices:
|
|
Enable Data-Collection-MIB Collection and Transfert notifications Choices:
|
|
Enable Data-Collection-MIB Transfer notifications Choices:
|
|
SNMP CISCO-CALLHOME-MIB traps |
|
Enable SNMP CISCO-CALLHOME-MIB traps Choices:
|
|
Enable SNMP ccmSmtpMsgSendFailNotif notification Choices:
|
|
Enable SNMP ccmSmtpServerFailNotif notification Choices:
|
|
Enable SNMP config casa traps Choices:
|
|
Allow cef related traps |
|
Enable/disable cef traps Choices:
|
|
Enable SNMP CEF Inconsistency traps Choices:
|
|
Enable SNMP CEF Peer FIB State change traps Choices:
|
|
Enable SNMP CEF Peer state change traps Choices:
|
|
Enable SNMP CEF Resource Failure traps Choices:
|
|
Enable SNMP cnpd traps Choices:
|
|
Enable SNMP config traps Choices:
|
|
Enable SNMP config copy traps Choices:
|
|
Enable SNMP config ctid traps Choices:
|
|
Allow CPU related traps |
|
Enable/disable cpu traps Choices:
|
|
Mode threshold Choices:
|
|
Enable SNMP dhcp traps Choices:
|
|
Allow dlsw related traps |
|
Enable SNMP dlsw circuit traps Choices:
|
|
Enable/disable cef traps Choices:
|
|
Enable SNMP dlsw peer transport connection traps Choices:
|
|
Enable SNMP eigrp traps Choices:
|
|
Enable SNMP energywise traps Choices:
|
|
Enable SNMP entity traps Choices:
|
|
Allow SNMP CISCO-ENTITY-DIAG-MIB traps |
|
Enable SNMP ceDiagBootUpFailedNotif traps Choices:
|
|
Enable SNMP CISCO-ENTITY-DIAG-MIB traps Choices:
|
|
Enable SNMP ceDiagHMTestRecoverNotif traps Choices:
|
|
Enable SNMP ceDiagHMThresholdReachedNotif traps Choices:
|
|
Enable SNMP ceDiagScheduledTestFailedNotif traps Choices:
|
|
Allow SNMP CISCO-ENTITY-PERFORMANCE-MIB traps |
|
Enable SNMP CISCO-ENTITY-PERFORMANCE-MIB traps Choices:
|
|
Enable ENTITY PERFORMANCE MIB throughput traps Choices:
|
|
Enable SNMP ENTITY-STATE-MIB traps Choices:
|
|
Enable SNMP environmental monitor traps |
|
Enable/disable envmon traps Choices:
|
|
Enable SNMP envmon fan traps This option is DEPRECATED and is replaced with fan_enable which accepts bool as input This attribute will be removed after 2024-09-01 |
|
Enable/disable fan traps Choices:
|
|
Enable SNMP environmental monitor shutdown traps Choices:
|
|
Enable SNMP environmental status change traps Choices:
|
|
Enable SNMP environmental monitor supply traps Choices:
|
|
Enable SNMP environmental monitor temperature traps Choices:
|
|
Enable SNMP envmon fan traps Choices:
|
|
Enable SNMP environmental monitor shutdown traps Choices:
|
|
Enable SNMP environmental status change traps Choices:
|
|
Enable SNMP environmental monitor supply traps Choices:
|
|
Enable SNMP environmental monitor temperature traps Choices:
|
|
Enable SNMP errdisable notifications Choices:
|
|
Enable SNMP ethernet oam traps Choices:
|
|
Allow ethernet traps |
|
Enable SNMP Ethernet CFM traps |
|
Enable SNMP Ethernet CFM fault alarm trap Choices:
|
|
Enable SNMP Ethernet CC trap |
|
Enable SNMP Ethernet CFM configuration error traps Choices:
|
|
Enable SNMP Ethernet CFM cross-connect traps Choices:
|
|
Enable SNMP Ethernet CFM loop traps Choices:
|
|
Enable SNMP Ethernet CFM CC Down traps Choices:
|
|
Enable SNMP Ethernet CFM CC Up traps Choices:
|
|
Enable SNMP Ethernet CC crosscheck trap |
|
Enable SNMP Ethernet CC crosscheck missing trap Choices:
|
|
Enable SNMP Ethernet CC crosscheck unknown traps Choices:
|
|
Enable SNMP Ethernet CC crosscheck service traps Choices:
|
|
Enable SNMP Ethernet EVC traps |
|
Enable SNMP Ethernet EVC create traps Choices:
|
|
Enable SNMP Ethernet EVC delete traps Choices:
|
|
Enable SNMP Ethernet EVC status traps Choices:
|
|
Enable SNMP event-manager traps Choices:
|
|
Enable SNMP firewall traps |
|
Enable/disable firewall traps Choices:
|
|
Enable firewall server status change trap Choices:
|
|
SNMP FLASH notifications |
|
Enable SNMP FLASH notifications Choices:
|
|
Enable SNMP Flash Insertion notifications Choices:
|
|
Enable SNMP Flash Low Space notifications Choices:
|
|
Enable SNMP Flash Removal notifications Choices:
|
|
SNMP FLEX Links traps |
|
Enable SNMP FLEX Links traps Choices:
|
|
Enable SNMP FLEX Links status change traps Choices:
|
|
Enable SNMP flowmon traps Choices:
|
|
Allow frame-relay traps |
|
Enable/disable frame-relay traps Choices:
|
|
Enable SNMP frame-relay subinterface traps |
|
Maximum number of traps sent per interval |
|
Enable/disable subif traps Choices:
|
|
Interval duration in which to limit the number of traps sent |
|
Enable SNMP fru-ctrl traps Choices:
|
|
Enable SNMP hsrp traps Choices:
|
|
Allow ike traps |
|
Enable IKE Policy traps |
|
Enable IKE Policy add trap Choices:
|
|
Enable IKE Policy delete trap Choices:
|
|
Enable IKE Tunnel traps |
|
Enable IKE Tunnel start trap Choices:
|
|
Enable IKE Tunnel stop trap Choices:
|
|
Enable SNMP ip multi cast traps Choices:
|
|
Allow ike traps |
|
Enable IPsec Cryptomap traps |
|
Enable IPsec Cryptomap add trap Choices:
|
|
Enable IPsec Cryptomap Attach trap Choices:
|
|
Enable IPsec Cryptomap delete trap Choices:
|
|
Enable IPsec Cryptomap Detach trap Choices:
|
|
Enable IPsec Tunnel Start trap Choices:
|
|
Enable IPsec Tunnel traps |
|
Enable IPsec Tunnel start trap Choices:
|
|
Enable IPsec Tunnel stop trap Choices:
|
|
Enable SNMP ipsla traps Choices:
|
|
Enable SNMP isis traps Choices:
|
|
Allow SNMP L2 Tunnel Config traps |
|
Enable SNMP L2 Tunnel Config traps Choices:
|
|
Enable SNMP L2TC System threshold traps Choices:
|
|
Enable SNMP L2 Tunnel Config threshold traps Choices:
|
|
Allow SNMP l2tun traps |
|
Enable BFD pseudo wire status traps Choices:
|
|
Enable BFD session traps Choices:
|
|
Enable license traps Choices:
|
|
Enable SNMP LISP MIB traps Choices:
|
|
Enable SNMP local auth traps Choices:
|
|
Allow SNMP MAC Notification traps |
|
Enable SNMP MAC Change traps Choices:
|
|
Enable SNMP MAC Notification traps Choices:
|
|
Enable SNMP MAC Move traps Choices:
|
|
Enable SNMP MAC Threshold traps Choices:
|
|
Allow MEMORY traps |
|
Enable SNMP Memory Bufferpeak traps Choices:
|
|
Enable MEMORY traps Choices:
|
|
Enable SNMP mpls traps |
|
Allow SNMP MPLS fast reroute traps |
|
Enable SNMP MPLS fast reroute traps Choices:
|
|
Enable MPLS fast reroute protection traps Choices:
|
|
Allow SNMP MPLS label distribution protocol traps |
|
Enable SNMP MPLS label distribution protocol traps Choices:
|
|
Enable MPLS LDP path vector limit mismatch traps Choices:
|
|
Enable MPLS LDP session down traps Choices:
|
|
Enable MPLS LDP session up traps Choices:
|
|
Enable MPLS LDP threshold exceeded traps Choices:
|
|
Enable SNMP MPLS RFC traps |
|
Allow SNMP MPLS label distribution protocol RFC traps |
|
Enable SNMP MPLS label distribution protocol RFC traps Choices:
|
|
Enable MPLS LDP path vector limit mismatch RFC traps Choices:
|
|
Enable MPLS LDP session down RFC traps Choices:
|
|
Enable MPLS LDP session up RFC traps Choices:
|
|
Enable MPLS LDP threshold exceeded RFC traps Choices:
|
|
Allow SNMP MPLS traffic engineering RFC traps |
|
Enable MPLS TE tunnel down RFC traps Choices:
|
|
Enable SNMP MPLS traffic engineering RFC traps Choices:
|
|
Enable MPLS TE tunnel reoptimized RFC traps Choices:
|
|
Enable MPLS TE tunnel reroute RFC traps Choices:
|
|
Enable MPLS TE tunnel up RFC traps Choices:
|
|
Allow SNMP MPLS Virtual Private Network RFC traps |
|
Enable SNMP MPLS Virtual Private Network RFC traps Choices:
|
|
Enable MPLS VPN illegal label threshold exceeded RFC traps Choices:
|
|
Enable MPLS VPN maximum threshold cleared RFC traps Choices:
|
|
Enable MPLS VPN maximum threshold exceeded RFC traps Choices:
|
|
Enable MPLS VPN middle threshold exceeded RFC traps Choices:
|
|
Enable MPLS VPN vrf down RFC traps Choices:
|
|
Enable MPLS VPN vrf up RFC traps Choices:
|
|
Allow SNMP MPLS traffic engineering traps |
|
Enable MPLS TE tunnel down traps Choices:
|
|
Enable SNMP MPLS traffic engineering traps Choices:
|
|
Enable MPLS TE tunnel reroute traps Choices:
|
|
Enable MPLS TE tunnel up traps Choices:
|
|
Allow SNMP MPLS Virtual Private Network traps |
|
Enable SNMP MPLS Virtual Private Network traps Choices:
|
|
Enable MPLS VPN illegal label threshold exceeded traps Choices:
|
|
Enable MPLS VPN maximum threshold cleared traps Choices:
|
|
Enable MPLS VPN maximum threshold exceeded traps Choices:
|
|
Enable MPLS VPN middle threshold exceeded traps Choices:
|
|
Enable MPLS VPN vrf down traps Choices:
|
|
Enable MPLS VPN vrf up traps Choices:
|
|
Enable SNMP mpls traps This option is DEPRECATED and is replaced with mpls which accepts dict as input This attribute will be removed after 2024-09-01 Choices:
|
|
Enable SNMP msdp traps Choices:
|
|
Enable SNMP mvpn traps Choices:
|
|
Allow SNMP NHRP traps |
|
Enable SNMP NHRP traps Choices:
|
|
Allow Next Hop Client traps |
|
Enable Next Hop Client down trap Choices:
|
|
Enable Next Hop Client traps Choices:
|
|
Enable Next Hop Client up trap Choices:
|
|
Allow Next Hop Peer traps |
|
Enable Next Hop Peer down trap Choices:
|
|
Enable Next Hop Peer traps Choices:
|
|
Enable Next Hop Peer up trap Choices:
|
|
Allow Next Hop Server traps |
|
Enable Next Hop Server down trap Choices:
|
|
Enable Next Hop Server traps Choices:
|
|
Enable Next Hop Server up trap Choices:
|
|
Enable quota-exceeded trap Choices:
|
|
Allow ospf related traps |
|
Cisco specific traps |
|
error traps Choices:
|
|
Lsa related traps Choices:
|
|
Packet retransmit traps Choices:
|
|
state change traps |
|
Nssa translator state changes Choices:
|
|
Config mismatch errors on virtual interfaces |
|
Sham link interface state changes Choices:
|
|
Sham link neighbor state changes Choices:
|
|
Enable error traps Choices:
|
|
Enable/disable ospf lsa traps Choices:
|
|
Enable/disable ospf retransmit traps Choices:
|
|
Enable/disable state change traps Choices:
|
|
Allow OSPFv3 related traps |
|
Error traps |
|
Packet parse failure on non-virtual interfaces Choices:
|
|
Config mismatch errors on non-virtual interfaces Choices:
|
|
Enable Error traps Choices:
|
|
Packet parse failure on virtual interfaces Choices:
|
|
Config mismatch errors on virtual interfaces Choices:
|
|
Trap rate limit values Rate limit window size in seconds (between 2 and 60) |
|
State change traps |
|
Enable State change traps Choices:
|
|
Non_virtual interface state changes Choices:
|
|
Neighbor graceful restart helper status changes Choices:
|
|
Non_virtual neighbor state changes Choices:
|
|
NSSA translator status changes Choices:
|
|
Graceful restart status changes Choices:
|
|
Virtual interface state changes Choices:
|
|
Virtual neighbor graceful restart helper status changes Choices:
|
|
Virtual neighbor state changes Choices:
|
|
Allow PIM traps |
|
Enable/disable PIM traps Choices:
|
|
Enable invalid pim message trap Choices:
|
|
Enable neighbor change trap Choices:
|
|
Enable rp mapping change trap Choices:
|
|
Enable SNMP pki traps Choices:
|
|
Enable SNMP port security traps Choices:
|
|
Allow SNMP power ethernet traps |
|
Enable SNMP power ethernet traps Choices:
|
|
Enable SNMP inline power group based traps. |
|
An integer between 1 and 20 (physical slot number) |
|
Threshold level for this slot |
|
Enable Policing Trap Choices:
|
|
Enable SNMP pw vc traps Choices:
|
|
Enable SNMP Resilient Ethernet Protocol Traps Choices:
|
|
Enable all SNMP traps defined in CISCO-RF-MIB Choices:
|
|
Enable SNMP RSVP traps Choices:
|
|
Allow smart license traps |
|
Enable smart license traps Choices:
|
|
Enable Entitlement Notification trap Choices:
|
|
Enable Global Notification traps Choices:
|
|
Enable SNMP traps |
|
Enable authentication trap Choices:
|
|
Enable coldStart trap Choices:
|
|
Enable linkDown trap Choices:
|
|
Enable linkUp trap Choices:
|
|
Enable warmStart trap Choices:
|
|
Enable SNMP stackwise traps Choices:
|
|
Allow SNMP STPX MIB traps |
|
Enable SNMP STPX MIB traps Choices:
|
|
Enable SNMP STPX MIB InconsistencyUpdate traps Choices:
|
|
Enable SNMP STPX MIB LoopInconsistencyUpdate traps Choices:
|
|
Enable SNMP STPX MIB RootInconsistencyUpdate traps Choices:
|
|
Enable SNMP syslog traps Choices:
|
|
Enable SNMP transceiver traps Choices:
|
|
Allow SNMP CISCO-TRUSTSEC-MIB traps |
|
Enable ctsAuthzCacheFileErrNotif notifications Choices:
|
|
Enable ctsCacheFileAccessErrNotif notifications Choices:
|
|
Enable SNMP CISCO-TRUSTSEC-MIB traps Choices:
|
|
Enable ctsSwKeystoreFileErrNotif notifications Choices:
|
|
Enable ctsSwKeystoreSyncFailNotif notifications Choices:
|
|
Enable ctsSapRandonNumberFailNotif notifications Choices:
|
|
Enable ctsSrcEntropyFailNotif notifications Choices:
|
|
Allow SNMP CISCO-TRUSTSEC-INTERFACE-MIB traps |
|
Enable ctsiIfAuthenticationFailNotif trap Choices:
|
|
Enable ctsiAuthorizationFailNotif trap Choices:
|
|
Enable SNMP CISCO-TRUSTSEC-INTERFACE-MIB traps Choices:
|
|
Enable ctsiIfSapNegotiationFailNotif trap Choices:
|
|
Enable ctsiIfAddSupplicantFailNotif trap Choices:
|
|
Enable ctsiIfUnauthorizedNotifEnable trap Choices:
|
|
Allow SNMP CISCO-TRUSTSEC-POLICY-MIB traps |
|
Enable ctspAuthorizationSgaclFailNotif notifications Choices:
|
|
Enable SNMP CISCO-TRUSTSEC-POLICY-MIB traps Choices:
|
|
Enable ctspPeerPolicyUpdatedNotif notifications Choices:
|
|
Allow SNMP CISCO-TRUSTSEC-SERVER-MIB traps |
|
Enable SNMP CISCO-TRUSTSEC-SERVER-MIB traps Choices:
|
|
Enable ctsvNoProvisionSecretNotif notification Choices:
|
|
Enable ctsvNoRadiusServerNotif notification Choices:
|
|
Allow SNMP CISCO-TRUSTSEC-SXP-MIB traps |
|
Enable ctsxSxpBindingConflictNotif notifications Choices:
|
|
Enable ctsxSxpBindingErrNotif notifications Choices:
|
|
Enable ctsxSxpBindingExpnFailNotif notifications Choices:
|
|
Enable ctsxSxpConnConfigErrNotif notifications Choices:
|
|
Enable ctsxSxpConnDownNotif notifications Choices:
|
|
Enable ctsxSxpConnSourceAddrErrNotif notifications Choices:
|
|
Enable ctsxSxpConnUpNotif notifications Choices:
|
|
Enable SNMP CISCO-TRUSTSEC-SXP-MIB traps Choices:
|
|
Enable ctsxSxpMsgParseErrNotif notifications Choices:
|
|
Enable ctsxSxpOperNodeIdChangeNotif notifications Choices:
|
|
Enable SNMP tty TCP connection traps Choices:
|
|
Allow SNMP CISCO-UDLDP-MIB traps |
|
Enable SNMP CISCO-UDLDP-MIB traps Choices:
|
|
Enable SNMP cudldpFastHelloLinkFailRptNotification traps Choices:
|
|
Enable SNMP cudldpFastHelloStatusChangeNotification traps Choices:
|
|
Enable SNMP VLAN membership traps Choices:
|
|
Enable SNMP VLAN created traps Choices:
|
|
Enable SNMP VLAN deleted traps Choices:
|
|
Allow vrfmib traps |
|
Enable vnet-trunk-down traps Choices:
|
|
Enable vnet-trunk-up trap Choices:
|
|
Enable vrf-down trap Choices:
|
|
Enable vrf-up trap Choices:
|
|
Enable SNMP vrrp traps Choices:
|
|
Allow SNMP Virtual Switch notifications |
|
Enable SNMP Virtual Switch (Dual Active) notification Choices:
|
|
Enable SNMP Virtual Switch notifications Choices:
|
|
Enable SNMP Virtual Switch Link (VSL) notification Choices:
|
|
Enable SNMP VTP traps Choices:
|
|
Define a user who can access the SNMP engine |
|
Access list ipv4 associated |
|
Access list ipv6 associated |
|
Authentication parameters for the user. Effects idempotency of module as configuration applied is not reflected in running-config. |
|
Select algorithm for authentication. Choices:
|
|
Authentication password for user. |
|
Encryption parameters for the user. Effects idempotency of module as configuration applied is not reflected in running-config. |
|
Authentication password for user. |
|
Select algorithm for encryption. Choices:
|
|
Add extra option for specific priv if any. |
|
SNMP group for the user. |
|
System where an SNMPv3 user is hosted |
|
UDP port used by the remote SNMP system |
|
SNMP user name |
|
SNMP security version Choices:
|
|
Enable encrypted version option. Choices:
|
|
The remote SNMP entity’s VPN Routing instance |
|
Define an SNMPv2 MIB view |
|
MIB family is excluded from the view Choices:
|
|
MIB view family name |
|
MIB family is included in the view Choices:
|
|
Name of the view |
|
This option is used only with state parsed. The value of this option should be the output received from the IOS device by executing the command show running-config | include snmp-server. The state parsed reads the configuration from |
|
The state the configuration should be left in. Refer to examples for more details. The states replaced and overridden have identical behaviour for this module. Choices:
|
Notes
Note
Tested against Cisco IOSXE Version 17.3 on CML.
This module works with connection
network_cli
.
Examples
# Using state: merged
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# --------------------- EMPTY -----------------
# Merged play:
# ------------
- name: Apply the provided configuration
cisco.ios.ios_snmp_server:
config:
communities:
- acl_v4: testACL
name: mergedComm
rw: true
contact: contact updated using merged
engine_id:
- id: AB0C5342FF0F
remote:
host: 172.16.0.12
udp_port: 25
groups:
- group: mergedGroup
version: v3
version_option: auth
file_transfer:
access_group: test
protocol:
- ftp
hosts:
- community_string: mergedComm
host: 172.16.2.9
informs: true
traps:
- msdp
- stun
- pki
version: 2c
- community_string: mergedComm
host: 172.16.2.9
traps:
- slb
- pki
password_policy:
- change: 3
digits: 23
lower_case: 12
max_len: 24
policy_name: MergedPolicy
special_char: 32
upper_case: 12
- change: 43
min_len: 12
policy_name: MergedPolicy2
special_char: 22
upper_case: 12
- change: 11
digits: 23
max_len: 12
min_len: 12
policy_name: policy3
special_char: 22
upper_case: 12
traps:
cef:
enable: true
inconsistency: true
peer_fib_state_change: true
peer_state_change: true
resource_failure: true
msdp: true
ospf:
cisco_specific:
error: true
lsa: true
retransmit: true
state_change:
nssa_trans_change: true
shamlink:
interface: true
neighbor: true
error: true
lsa: true
retransmit: true
state_change: true
syslog: true
tty: true
users:
- acl_v4: "24"
group: dev
username: userPaul
version: v1
state: merged
# Commands Fired:
# ---------------
# "commands": [
# "snmp-server contact contact updated using merged",
# "snmp-server file-transfer access-group test protocol ftp",
# "snmp-server enable traps msdp",
# "snmp-server enable traps syslog",
# "snmp-server enable traps tty",
# "snmp-server enable traps ospf cisco-specific errors",
# "snmp-server enable traps ospf cisco-specific retransmit",
# "snmp-server enable traps ospf cisco-specific lsa",
# "snmp-server enable traps ospf cisco-specific state-change nssa-trans-change",
# "snmp-server enable traps ospf cisco-specific state-change shamlink interface",
# "snmp-server enable traps ospf cisco-specific state-change shamlink neighbor",
# "snmp-server enable traps ospf errors",
# "snmp-server enable traps ospf retransmit",
# "snmp-server enable traps ospf lsa",
# "snmp-server enable traps ospf state-change",
# "snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency",
# "snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki",
# "snmp-server host 172.16.2.9 mergedComm slb pki",
# "snmp-server group mergedGroup v3 auth",
# "snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F",
# "snmp-server community mergedComm rw testACL",
# "snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3",
# "snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43",
# "snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11",
# "snmp-server user userPaul dev v1 access 24"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^snmp-server
# snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F
# snmp-server user userPaul dev v1 access 24
# snmp-server group mergedGroup v3 auth
# snmp-server community mergedComm RW testACL
# snmp-server contact contact updated using merged
# snmp-server enable traps tty
# snmp-server enable traps ospf state-change
# snmp-server enable traps ospf errors
# snmp-server enable traps ospf retransmit
# snmp-server enable traps ospf lsa
# snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
# snmp-server enable traps ospf cisco-specific state-change shamlink interface
# snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
# snmp-server enable traps ospf cisco-specific errors
# snmp-server enable traps ospf cisco-specific retransmit
# snmp-server enable traps ospf cisco-specific lsa
# snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
# snmp-server enable traps msdp
# snmp-server enable traps syslog
# snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki
# snmp-server host 172.16.2.9 mergedComm slb pki
# snmp-server file-transfer access-group test protocol ftp
# snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3
# snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# Using state: deleted
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F
# snmp-server user userPaul dev v1 access 24
# snmp-server group mergedGroup v3 auth
# snmp-server community mergedComm RW testACL
# snmp-server contact contact updated using merged
# snmp-server enable traps tty
# snmp-server enable traps ospf state-change
# snmp-server enable traps ospf errors
# snmp-server enable traps ospf retransmit
# snmp-server enable traps ospf lsa
# snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
# snmp-server enable traps ospf cisco-specific state-change shamlink interface
# snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
# snmp-server enable traps ospf cisco-specific errors
# snmp-server enable traps ospf cisco-specific retransmit
# snmp-server enable traps ospf cisco-specific lsa
# snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
# snmp-server enable traps msdp
# snmp-server enable traps syslog
# snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki
# snmp-server host 172.16.2.9 mergedComm slb pki
# snmp-server file-transfer access-group test protocol ftp
# snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3
# snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# Deleted play:
# -------------
- name: Remove all existing configuration
cisco.ios.ios_snmp_server:
state: deleted
# Commands Fired:
# ---------------
# "commands": [
# "no snmp-server contact contact updated using merged",
# "no snmp-server file-transfer access-group test protocol ftp",
# "no snmp-server enable traps msdp",
# "no snmp-server enable traps syslog",
# "no snmp-server enable traps tty",
# "no snmp-server enable traps ospf cisco-specific errors",
# "no snmp-server enable traps ospf cisco-specific retransmit",
# "no snmp-server enable traps ospf cisco-specific lsa",
# "no snmp-server enable traps ospf cisco-specific state-change nssa-trans-change",
# "no snmp-server enable traps ospf cisco-specific state-change shamlink interface",
# "no snmp-server enable traps ospf cisco-specific state-change shamlink neighbor",
# "no snmp-server enable traps ospf errors",
# "no snmp-server enable traps ospf retransmit",
# "no snmp-server enable traps ospf lsa",
# "no snmp-server enable traps ospf state-change",
# "no snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency",
# "no snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki",
# "no snmp-server host 172.16.2.9 mergedComm slb pki",
# "no snmp-server group mergedGroup v3 auth",
# "no snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F",
# "no snmp-server community mergedComm rw testACL",
# "no snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3",
# "no snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43",
# "no snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11",
# "no snmp-server user userPaul dev v1 access 24"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^snmp-server
# --------------------- EMPTY -----------------
# Using state: overridden
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F
# snmp-server user userPaul dev v1 access 24
# snmp-server group mergedGroup v3 auth
# snmp-server community mergedComm RW testACL
# snmp-server contact contact updated using merged
# snmp-server enable traps tty
# snmp-server enable traps ospf state-change
# snmp-server enable traps ospf errors
# snmp-server enable traps ospf retransmit
# snmp-server enable traps ospf lsa
# snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
# snmp-server enable traps ospf cisco-specific state-change shamlink interface
# snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
# snmp-server enable traps ospf cisco-specific errors
# snmp-server enable traps ospf cisco-specific retransmit
# snmp-server enable traps ospf cisco-specific lsa
# snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
# snmp-server enable traps msdp
# snmp-server enable traps syslog
# snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki
# snmp-server host 172.16.2.9 mergedComm slb pki
# snmp-server file-transfer access-group test protocol ftp
# snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3
# snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# Overridden play:
# ----------------
- name: Override commands with provided configuration
cisco.ios.ios_snmp_server:
config:
location: "location entry for snmp"
packet_size: 500
communities:
- acl_v4: acl_uq
name: communityOverriden
rw: true
state: overridden
# Commands Fired:
# ---------------
# "commands": [
# "no snmp-server contact contact updated using merged",
# "no snmp-server file-transfer access-group test protocol ftp",
# "snmp-server location location entry for snmp",
# "snmp-server packetsize 500",
# "no snmp-server enable traps msdp",
# "no snmp-server enable traps syslog",
# "no snmp-server enable traps tty",
# "no snmp-server enable traps ospf cisco-specific errors",
# "no snmp-server enable traps ospf cisco-specific retransmit",
# "no snmp-server enable traps ospf cisco-specific lsa",
# "no snmp-server enable traps ospf cisco-specific state-change nssa-trans-change",
# "no snmp-server enable traps ospf cisco-specific state-change shamlink interface",
# "no snmp-server enable traps ospf cisco-specific state-change shamlink neighbor",
# "no snmp-server enable traps ospf errors",
# "no snmp-server enable traps ospf retransmit",
# "no snmp-server enable traps ospf lsa",
# "no snmp-server enable traps ospf state-change",
# "no snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency",
# "no snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki",
# "no snmp-server host 172.16.2.9 mergedComm slb pki",
# "no snmp-server group mergedGroup v3 auth",
# "no snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F",
# "snmp-server community communityOvverriden rw acl_uq",
# "no snmp-server community mergedComm rw testACL",
# "no snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3",
# "no snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43",
# "no snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11",
# "no snmp-server user userPaul dev v1 access 24"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^snmp-server
# snmp-server community communityOverriden RW acl_uq
# snmp-server packetsize 500
# snmp-server location location entry for snmp
# Using state: replaced
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# snmp-server community communityOverriden RW acl_uq
# snmp-server packetsize 500
# snmp-server location location entry for snmp
# Replaced play:
# --------------
- name: Replace commands with provided configuration
cisco.ios.ios_snmp_server:
config:
location: "updated location entry"
packet_size: 500
communities:
- acl_v4: acl_uq
name: communityOverriden
rw: true
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "snmp-server location updated location entry"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^snmp-server
# snmp-server community communityOverriden RW acl_uq
# snmp-server packetsize 500
# snmp-server location updated location entry
# Using state: gathered
# Before state:
# -------------
# router-ios#show running-config | section ^snmp-server
# snmp-server engineID remote 172.16.0.12 udp-port 25 AB0C5342FF0F
# snmp-server user userPaul dev v1 access 24
# snmp-server group mergedGroup v3 auth
# snmp-server community communityOvverriden RW acl_uq
# snmp-server community mergedComm RW testACL
# snmp-server packetsize 500
# snmp-server location updated location entry
# snmp-server contact contact updated using merged
# snmp-server enable traps tty
# snmp-server enable traps ospf state-change
# snmp-server enable traps ospf errors
# snmp-server enable traps ospf retransmit
# snmp-server enable traps ospf lsa
# snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
# snmp-server enable traps ospf cisco-specific state-change shamlink interface
# snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
# snmp-server enable traps ospf cisco-specific errors
# snmp-server enable traps ospf cisco-specific retransmit
# snmp-server enable traps ospf cisco-specific lsa
# snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
# snmp-server enable traps msdp
# snmp-server enable traps syslog
# snmp-server host 172.16.2.9 informs version 2c mergedComm msdp stun pki
# snmp-server host 172.16.2.9 mergedComm slb pki
# snmp-server file-transfer access-group test protocol ftp
# snmp-server password-policy MergedPolicy define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3
# snmp-server password-policy MergedPolicy2 define min-len 12 upper-case 12 special-char 22 change 43
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# Gathered play:
# --------------
- name: Gather listed snmp config
cisco.ios.ios_snmp_server:
state: gathered
# Module Execution Result:
# ------------------------
# "gathered": {
# "communities": [
# {
# "acl_v4": "acl_uq",
# "name": "communityOvverriden",
# "rw": true
# },
# {
# "acl_v4": "testACL",
# "name": "mergedComm",
# "rw": true
# }
# ],
# "contact": "contact updated using merged",
# "engine_id": [
# {
# "id": "AB0C5342FF0F",
# "remote": {
# "host": "172.16.0.12",
# "udp_port": 25
# }
# }
# ],
# "file_transfer": {
# "access_group": "test",
# "protocol": [
# "ftp"
# ]
# },
# "groups": [
# {
# "group": "mergedGroup",
# "version": "v3",
# "version_option": "auth"
# }
# ],
# "hosts": [
# {
# "community_string": "mergedComm",
# "host": "172.16.2.9",
# "informs": true,
# "traps": [
# "msdp",
# "stun",
# "pki"
# ],
# "version": "2c"
# },
# {
# "community_string": "mergedComm",
# "host": "172.16.2.9",
# "traps": [
# "slb",
# "pki"
# ]
# }
# ],
# "location": "updated location entry",
# "packet_size": 500,
# "password_policy": [
# {
# "change": 3,
# "digits": 23,
# "lower_case": 12,
# "max_len": 24,
# "policy_name": "MergedPolicy",
# "special_char": 32,
# "upper_case": 12
# },
# {
# "change": 43,
# "min_len": 12,
# "policy_name": "MergedPolicy2",
# "special_char": 22,
# "upper_case": 12
# },
# {
# "change": 11,
# "digits": 23,
# "max_len": 12,
# "min_len": 12,
# "policy_name": "policy3",
# "special_char": 22,
# "upper_case": 12
# }
# ],
# "traps": {
# "cef": {
# "enable": true,
# "inconsistency": true,
# "peer_fib_state_change": true,
# "peer_state_change": true,
# "resource_failure": true
# },
# "msdp": true,
# "ospf": {
# "cisco_specific": {
# "error": true,
# "lsa": true,
# "retransmit": true,
# "state_change": {
# "nssa_trans_change": true,
# "shamlink": {
# "interface": true,
# "neighbor": true
# }
# }
# },
# "error": true,
# "lsa": true,
# "retransmit": true,
# "state_change": true
# },
# "syslog": true,
# "tty": true
# },
# "users": [
# {
# "acl_v4": "24",
# "group": "dev",
# "username": "userPaul",
# "version": "v1"
# }
# ]
# },
# Using state: rendered
# Rendered play:
# --------------
- name: Render the commands for provided configuration
cisco.ios.ios_snmp_server:
config:
accounting:
command: default
cache: 2
chassis_id: entry for chassis id
communities:
- acl_v6: te
name: test
ro: true
view: terst1
- acl_v4: "1322"
name: wete
ro: true
- acl_v4: paul
name: weteww
rw: true
contact: details contact
context:
- contextA
- contextB
engine_id:
- id: AB0C5342FA0A
local: true
- id: AB0C5342FAAB
remote:
host: 172.16.0.2
udp_port: 23
- id: AB0C5342FAAA
remote:
host: 172.16.0.1
udp_port: 22
file_transfer:
access_group: testAcl
protocol:
- ftp
- rcp
groups:
- group: grpFamily
version: v3
version_option: auth
- context: mycontext
group: grpFamily
version: v1
- acl_v4: "2"
group: grp1
notify: me
version: v1
- group: newtera
version: v3
version_option: priv
- group: relaplacing
version: v3
version_option: noauth
hosts:
- community_string: check
host: 172.16.2.99
informs: true
traps:
- msdp
- stun
version: 2c
- community_string: check
host: 172.16.2.99
traps:
- slb
- pki
- community_string: checktrap
host: 172.16.2.99
traps:
- isis
- hsrp
- community_string: newtera
host: 172.16.2.1
traps:
- rsrb
- pim
- rsvp
- slb
- pki
version: "3"
version_option: priv
- community_string: relaplacing
host: 172.16.2.1
traps:
- slb
- pki
version: "3"
version_option: noauth
- community_string: trapsac
host: 172.16.2.1
traps:
- tty
- bgp
version: 2c
- community_string: www
host: 172.16.1.1
traps:
- tty
- bgp
version: "3"
version_option: auth
inform:
pending: 2
ip:
dscp: 2
location: "entry for snmp location"
packet_size: 500
password_policy:
- change: 3
digits: 23
lower_case: 12
max_len: 24
policy_name: policy1
special_char: 32
upper_case: 12
- change: 9
min_len: 12
policy_name: policy2
special_char: 22
upper_case: 12
- change: 11
digits: 23
max_len: 12
min_len: 12
policy_name: policy3
special_char: 22
upper_case: 12
queue_length: 2
source_interface: Loopback999
system_shutdown: true
trap_source: GigabitEthernet0/0
trap_timeout: 2
traps:
auth_framework:
enable: true
bgp:
cbgp2: true
enable: true
bfd:
enable: true
session_down: true
session_up: true
bridge:
enable: true
newroot: true
topologychange: true
casa: true
cef:
enable: true
inconsistency: true
peer_fib_state_change: true
peer_state_change: true
resource_failure: true
dlsw:
enable: true
eigrp: true
ethernet:
cfm:
alarm: true
evc:
status: true
event_manager: true
flowmon: true
frame_relay:
enable: true
subif:
enable: true
hsrp: true
ike:
policy:
add: true
delete: true
tunnel:
start: true
stop: true
ipmulticast: true
ipsec:
cryptomap:
add: true
attach: true
delete: true
detach: true
too_many_sas: true
tunnel:
start: true
stop: true
ipsla: true
l2tun:
pseudowire_status: true
session: true
msdp: true
ospf:
cisco_specific:
error: true
lsa: true
retransmit: true
state_change:
nssa_trans_change: true
shamlink:
interface: true
neighbor: true
error: true
lsa: true
retransmit: true
state_change: true
pim:
enable: true
invalid_pim_message: true
neighbor_change: true
rp_mapping_change: true
pki: true
rsvp: true
snmp:
authentication: true
coldstart: true
linkdown: true
linkup: true
warmstart: true
syslog: true
tty: true
users:
- acl_v4: "24"
group: groupFamily
username: paul
version: v1
- acl_v4: ipv6
group: groupFamily
username: domnic
version: v3
- group: relaplacing
username: relaplacing
version: v3
state: rendered
# Module Execution Result:
# ------------------------
# "rendered": [
# "snmp-server accounting commands default",
# "snmp-server cache interval 2",
# "snmp-server chassis-id entry for chassis id",
# "snmp-server contact details contact",
# "snmp-server file-transfer access-group testAcl protocol ftp rcp",
# "snmp-server inform pending 2",
# "snmp-server ip dscp 2",
# "snmp-server location entry for snmp location",
# "snmp-server packetsize 500",
# "snmp-server queue-length 2",
# "snmp-server trap timeout 2",
# "snmp-server source-interface informs Loopback999",
# "snmp-server trap-source GigabitEthernet0/0",
# "snmp-server system-shutdown",
# "snmp-server enable traps auth-framework",
# "snmp-server enable traps bfd session-down session-up",
# "snmp-server enable traps bgp cbgp2",
# "snmp-server enable traps bridge newroot topologychange",
# "snmp-server enable traps casa",
# "snmp-server enable traps eigrp",
# "snmp-server enable traps event-manager",
# "snmp-server enable traps flowmon",
# "snmp-server enable traps hsrp",
# "snmp-server enable traps ipsla",
# "snmp-server enable traps msdp",
# "snmp-server enable traps pki",
# "snmp-server enable traps rsvp",
# "snmp-server enable traps syslog",
# "snmp-server enable traps tty",
# "snmp-server enable traps ipmulticast",
# "snmp-server enable traps ike policy add",
# "snmp-server enable traps ike policy delete",
# "snmp-server enable traps ike tunnel start",
# "snmp-server enable traps ike tunnel stop",
# "snmp-server enable traps ipsec cryptomap add",
# "snmp-server enable traps ipsec cryptomap delete",
# "snmp-server enable traps ipsec cryptomap attach",
# "snmp-server enable traps ipsec cryptomap detach",
# "snmp-server enable traps ipsec tunnel start",
# "snmp-server enable traps ipsec tunnel stop",
# "snmp-server enable traps ipsec too-many-sas",
# "snmp-server enable traps ospf cisco-specific errors",
# "snmp-server enable traps ospf cisco-specific retransmit",
# "snmp-server enable traps ospf cisco-specific lsa",
# "snmp-server enable traps ospf cisco-specific state-change nssa-trans-change",
# "snmp-server enable traps ospf cisco-specific state-change shamlink interface",
# "snmp-server enable traps ospf cisco-specific state-change shamlink neighbor",
# "snmp-server enable traps ospf errors",
# "snmp-server enable traps ospf retransmit",
# "snmp-server enable traps ospf lsa",
# "snmp-server enable traps ospf state-change",
# "snmp-server enable traps l2tun pseudowire status",
# "snmp-server enable traps l2tun session",
# "snmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message",
# "snmp-server enable traps snmp authentication linkdown linkup warmstart coldstart",
# "snmp-server enable traps frame-relay",
# "snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency",
# "snmp-server enable traps dlsw",
# "snmp-server enable traps ethernet evc status",
# "snmp-server enable traps ethernet cfm alarm",
# "snmp-server host 172.16.2.99 informs version 2c check msdp stun",
# "snmp-server host 172.16.2.99 check slb pki",
# "snmp-server host 172.16.2.99 checktrap isis hsrp",
# "snmp-server host 172.16.2.1 version 3 priv newtera rsrb pim rsvp slb pki",
# "snmp-server host 172.16.2.1 version 3 noauth relaplacing slb pki",
# "snmp-server host 172.16.2.1 version 2c trapsac tty bgp",
# "snmp-server host 172.16.1.1 version 3 auth www tty bgp",
# "snmp-server group grpFamily v1 context mycontext",
# "snmp-server group grp1 v1 notify me access 2",
# "snmp-server group newtera v3 priv",
# "snmp-server group relaplacing v3 noauth",
# "snmp-server engineID local AB0C5342FA0A",
# "snmp-server engineID remote 172.16.0.2 udp-port 23 AB0C5342FAAB",
# "snmp-server engineID remote 172.16.0.1 udp-port 22 AB0C5342FAAA",
# "snmp-server community test view terst1 ro ipv6 te",
# "snmp-server community wete ro 1322",
# "snmp-server community weteww rw paul",
# "snmp-server context contextA",
# "snmp-server context contextB",
# "snmp-server password-policy policy1 define max-len 24 upper-case 12 lower-case 12 special-char 32 digits 23 change 3",
# "snmp-server password-policy policy2 define min-len 12 upper-case 12 special-char 22 change 9",
# "snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11",
# "snmp-server user paul groupFamily v1 access 24",
# "snmp-server user domnic groupFamily v3 access ipv6",
# "snmp-server user relaplacing relaplacing v3"
# ]
# Using state: parsed
# File: parsed.cfg
# ----------------
# snmp-server engineID local AB0C5342FA0A
# snmp-server engineID remote 172.16.0.2 udp-port 23 AB0C5342FAAB
# snmp-server engineID remote 172.16.0.1 udp-port 22 AB0C5342FAAA
# snmp-server user newuser newfamily v1 access 24
# snmp-server user paul familypaul v3 access ipv6 ipv6acl
# snmp-server user replaceUser replaceUser v3
# snmp-server group group0 v3 auth
# snmp-server group group1 v1 notify me access 2
# snmp-server group group2 v3 priv
# snmp-server group replaceUser v3 noauth
# snmp-server community commu1 view view1 RO ipv6 te
# snmp-server community commu2 RO 1322
# snmp-server community commu3 RW paul
# snmp-server trap timeout 2
# snmp-server trap-source GigabitEthernet0/0
# snmp-server source-interface informs Loopback999
# snmp-server packetsize 500
# snmp-server enable traps vrfmib vrf-up vrf-down vnet-trunk-up vnet-trunk-down
# snmp-server host 172.16.2.99 informs version 2c check msdp stun
# snmp-server host 172.16.2.1 version 2c trapsac tty bgp
# snmp-server host 172.16.1.1 version 3 auth group0 tty bgp
# snmp-server context contextWord1
# snmp-server context contextWord2
# snmp-server file-transfer access-group testAcl protocol ftp
# snmp-server file-transfer access-group testAcl protocol rcp
# snmp-server cache interval 2
# snmp-server password-policy policy2 define min-len 12 upper-case 12 special-char 22 change 9
# snmp-server password-policy policy3 define min-len 12 max-len 12 upper-case 12 special-char 22 digits 23 change 11
# snmp-server accounting commands default
# snmp-server inform pending 2
# Parsed play:
# ------------
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_snmp_server:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "accounting": {
# "command": "default"
# },
# "cache": 2,
# "communities": [
# {
# "acl_v6": "te",
# "name": "commu1",
# "ro": true,
# "view": "view1"
# },
# {
# "acl_v4": "1322",
# "name": "commu2",
# "ro": true
# },
# {
# "acl_v4": "paul",
# "name": "commu3",
# "rw": true
# }
# ],
# "context": [
# "contextWord1",
# "contextWord2"
# ],
# "engine_id": [
# {
# "id": "AB0C5342FA0A",
# "local": true
# },
# {
# "id": "AB0C5342FAAA",
# "remote": {
# "host": "172.16.0.1",
# "udp_port": 22
# }
# },
# {
# "id": "AB0C5342FAAB",
# "remote": {
# "host": "172.16.0.2",
# "udp_port": 23
# }
# }
# ],
# "file_transfer": {
# "access_group": "testAcl",
# "protocol": [
# "rcp",
# "ftp"
# ]
# },
# "groups": [
# {
# "group": "group0",
# "version": "v3",
# "version_option": "auth"
# },
# {
# "acl_v4": "2",
# "group": "group1",
# "notify": "me",
# "version": "v1"
# },
# {
# "group": "group2",
# "version": "v3",
# "version_option": "priv"
# },
# {
# "group": "replaceUser",
# "version": "v3",
# "version_option": "noauth"
# }
# ],
# "hosts": [
# {
# "community_string": "group0",
# "host": "172.16.1.1",
# "traps": [
# "tty",
# "bgp"
# ],
# "version": "3",
# "version_option": "auth"
# },
# {
# "community_string": "trapsac",
# "host": "172.16.2.1",
# "traps": [
# "tty",
# "bgp"
# ],
# "version": "2c"
# },
# {
# "community_string": "check",
# "host": "172.16.2.99",
# "informs": true,
# "traps": [
# "msdp",
# "stun"
# ],
# "version": "2c"
# }
# ],
# "inform": {
# "pending": 2
# },
# "packet_size": 500,
# "password_policy": [
# {
# "change": 9,
# "min_len": 12,
# "policy_name": "policy2",
# "special_char": 22,
# "upper_case": 12
# },
# {
# "change": 11,
# "digits": 23,
# "max_len": 12,
# "min_len": 12,
# "policy_name": "policy3",
# "special_char": 22,
# "upper_case": 12
# }
# ],
# "source_interface": "Loopback999",
# "trap_source": "GigabitEthernet0/0",
# "trap_timeout": 2,
# "traps": {
# "vrfmib": {
# "vnet_trunk_down": true,
# "vnet_trunk_up": true,
# "vrf_down": true,
# "vrf_up": true
# }
# },
# "users": [
# {
# "acl_v4": "24",
# "group": "newfamily",
# "username": "newuser",
# "version": "v1"
# },
# {
# "acl_v4": "ipv6",
# "group": "familypaul",
# "username": "paul",
# "version": "v3"
# },
# {
# "group": "replaceUser",
# "username": "replaceUser",
# "version": "v3"
# }
# ]
# }
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration after module execution. Returned: when changed Sample: |
|
The configuration prior to the module execution. Returned: when state is Sample: |
|
The set of commands pushed to the remote device. Returned: when state is Sample: |
|
Facts about the network resource gathered from the remote device as structured data. Returned: when state is Sample: |
|
The device native config provided in running_config option parsed into structured data as per module argspec. Returned: when state is Sample: |
|
The provided configuration in the task rendered in device-native format (offline). Returned: when state is Sample: |