junipernetworks.junos.junos_snmp_server module – Manage SNMP server configuration on Junos devices.
Note
This module is part of the junipernetworks.junos collection (version 9.1.0).
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 junipernetworks.junos
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: junipernetworks.junos.junos_snmp_server
.
New in junipernetworks.junos 2.9.0
Synopsis
This module manages SNMP server configuration on devices running Junos.
Requirements
The below requirements are needed on the host that executes this module.
ncclient (>=v0.6.4)
xmltodict (>=0.12.0)
Parameters
Parameter |
Comments |
---|---|
A dictionary of SNMP server configuration. |
|
Specify JVision arp setting. |
|
Enable host name resolution. Choices:
|
|
Set JVision arp. Choices:
|
|
Specify client list. |
|
Specify list of addresses/prefixes. |
|
Specify address or prefix. |
|
Deny access. Choices:
|
|
Specify client list name. |
|
Specify list of community string. |
|
Specify Authorization type. Choices:
|
|
Specify the name of client list or prefix list. |
|
Specify List of source address prefix ranges to accept. |
|
Specify address or prefix. |
|
Deny access. Choices:
|
|
Use logical-system name for v1/v2c clients. |
|
Specify name of the community. |
|
Use routing-instance name for v1/v2c clients. |
|
Specify the name of client list or prefix list. |
|
Specify List of source address prefix ranges to accept. |
|
Specify address or prefix. |
|
Deny access. Choices:
|
|
Specify routing-instances. |
|
Specify view name. |
|
Specify contact information for administrator. |
|
Customize SNMP behaviour based on knob. |
|
To stop exposing IFLs as part of etherStatsTable. Choices:
|
|
System description. |
|
Specify SNMPv3 engine ID |
|
Local engine ID. |
|
Use default IP address for the engine ID. Choices:
|
|
Uses management interface MAC Address for the engine ID. Choices:
|
|
Filter requests with duplicate source address/port and request ID. Choices:
|
|
List of interfaces that needs to be filtered. |
|
Filter all internal interfaces. Choices:
|
|
Specify filter specified interfaces. |
|
Set filter-interfaces. Choices:
|
|
Specify health monitoring configuration. |
|
Falling threshold applied to all monitored objects. |
|
IDP health monitor configuration. Choices:
|
|
Interval between samples. |
|
Rising threshold applied to all monitored objects. |
|
Set health-monitor configuration. Choices:
|
|
Filter interfaces config for ifNumber and ipv6Interfaces. Choices:
|
|
Restrict SNMP requests to interfaces. |
|
Specify physical location of system. |
|
Allow only logical-system specific traps. Choices:
|
|
System name override. |
|
Configure the handling of nonvolatile SNMP Set requests. |
|
Delay between affirmative SNMP Set reply and start of commit (seconds). |
|
SNMP proxy configuration. |
|
Satellite/Proxied Device name or IP address. |
|
Use logical-system name for v1/v2c clients. |
|
Specify proxy name. |
|
Use routing-instance name for v1/v2c clients. |
|
Specify the name of client list or prefix list. |
|
Specify List of source address prefix ranges to accept. |
|
Specify address or prefix. |
|
Deny access. Choices:
|
|
Specify routing-instances. |
|
Specify For v1 proxy configuration define snmp-community. |
|
Specify No default snmp-community and v3 configuration. Choices:
|
|
Specify community name. |
|
For v2c proxy configuration define snmp-community. |
|
Specify No default snmp-community and v3 configuration. Choices:
|
|
Specify community name. |
|
For v3 proxy configuration define security-name. |
|
pecify context name associated to this security-name. Choices:
|
|
Specify v3 security-name. |
|
Specify Remote Monitoring configuration. |
|
RMON alarm entries. |
|
General description of alarm (stored in alarmOwner). |
|
Event triggered after falling threshold is crossed. |
|
Specify falling-threshold. |
|
Interval between samples during falling-threshold test. |
|
Specify alarm ID. |
|
Interval between samples. |
|
Type of SNMP request to issue for alarm. Choices:
|
|
Event triggered after rising threshold is crossed. |
|
The rising threshold. |
|
Method of sampling the selected variable. Choices:
|
|
The alarm that may be sent upon entry startup. Choices:
|
|
Tag to be added to syslog messages. |
|
OID of MIB variable to be monitored. |
|
RMON event entries. |
|
The community (trap group) for outgoing traps. |
|
General description of event. |
|
Specify event ID. |
|
The type of notification for this event. Choices:
|
|
Set Remote monitoring configuration. Choices:
|
|
SNMP routing-instance options. |
|
Allow/Deny SNMP access to routing-instances. |
|
Set routing_instance_access. Choices:
|
|
SNMPv3 configuration information. |
|
Used to select management targets for notifications as well as the type of notifications. |
|
Specify notify name. |
|
Notifications will be sent to all targets configured with this tag. |
|
Notification type. |
|
Filters to apply to SNMP notifications. |
|
Specify notify filter name. |
|
OID to include/exclude from notify filter. |
|
Exclude this OID from the notify filtered. Choices:
|
|
Include this OID in the notify filter. Choices:
|
|
Specify OID. |
|
SNMP community and view-based access control model configuration. |
|
Unique index value in this community table entry. |
|
SNMPv1/v2c community name (default is same as community-index). |
|
Context used when performing access control. |
|
Security name used when performing access control. |
|
Tag identifier for set of targets allowed to use this community string. |
|
Identifies notification targets as well as allowed management stations. |
|
SNMP target address. |
|
Mask range of addresses for community string access control. |
|
Logical-system name for trap destination. |
|
SNMP target address name. |
|
SNMP target port number. |
|
Maximum retry count for confirmed SNMP notifications. |
|
Routing instance for trap destination. |
|
SNMP tag list used to select target addresses. |
|
SNMPv3 target parameter name in the target parameters table. |
|
Acknowledgment timeout for confirmed SNMP notifications (seconds). |
|
SNMPv3 target parameter name in the target parameters table. |
|
SNMPv3 target parameters name. |
|
Notify filter with filter name to apply to notifications. |
|
Parameters used when sending notifications. |
|
The message processing model to be used when generating SNMP notifications. Choices:
|
|
Security-level used when generating SNMP notifications. Choices:
|
|
Security-model used when generating SNMP notifications. Choices:
|
|
Security name used when generating SNMP notifications. |
|
User-based security model (USM) information. |
|
Local engine user configuration. |
|
SNMPv3 USM user information. |
|
Configure MD5 authentication. |
|
Encrypted key used for user authentication. |
|
User’s authentication password |
|
Set no authentication for the user. Choices:
|
|
Configure SHA authentication. |
|
Encrypted key used for user authentication. |
|
User’s authentication password |
|
User name. |
|
Configure Triple DES privacy. |
|
Encrypted key used for user privacy. |
|
User’s privacy password |
|
Configure AES128 privacy. |
|
Encrypted key used for user privacy. |
|
User’s privacy password |
|
Configure DES privacy. |
|
Encrypted key used for user privacy. |
|
User’s privacy password |
|
Set no privacy for the user. Choices:
|
|
Remote engine user configuration. |
|
Remote engine id. |
|
SNMPv3 USM user information. |
|
Configure MD5 authentication. |
|
Encrypted key used for user authentication. |
|
User’s authentication password |
|
Set no authentication for the user. Choices:
|
|
Configure SHA authentication. |
|
Encrypted key used for user authentication. |
|
User’s authentication password |
|
User name. |
|
Configure Triple DES privacy. |
|
Encrypted key used for user privacy. |
|
User’s privacy password |
|
Configure AES128 privacy. |
|
Encrypted key used for user privacy. |
|
User’s privacy password |
|
Configure DES privacy. |
|
Encrypted key used for user privacy. |
|
User’s privacy password |
|
Set no privacy for the user. Choices:
|
|
SNMP subagent configuration. |
|
Allow SNMP subagent tcp connection. |
|
Specify routing-instance name for tcp connection. Choices:
|
|
Set SNMP subagent TCP. Choices:
|
|
Configure trace options for SNMP. |
|
Specify trace file options. |
|
Specify maximum number of trace files. |
|
Regular expression for lines to be logged. |
|
Don’t allow any user to read the log file. Choices:
|
|
Specify maximum trace file size. |
|
Allow any user to read the log file. Choices:
|
|
Specify flag traceoptions. |
|
Trace everything. Choices:
|
|
Trace general events. Choices:
|
|
Trace interface statistics (logical and physical). Choices:
|
|
Nonvolatile SNMP set request handling. Choices:
|
|
Dump SNMP request/response packets. Choices:
|
|
Trace SNMP request timeouts. Choices:
|
|
Trace routing socket calls. Choices:
|
|
Trace master-agent interations with sub-agents. Choices:
|
|
Trace internal timer events. Choices:
|
|
Trace varbind errors. Choices:
|
|
Memory tracing information. |
|
set memory traceoptions. Choices:
|
|
Specify Memory size reserved for tracing. |
|
Disable remote tracing. Choices:
|
|
Specify SNMP trap options. |
|
Specify Trap categories. |
|
Specify Authentication failures. Choices:
|
|
Specify Chassis or environment notifications. Choices:
|
|
Specify Clustering notifications. Choices:
|
|
Configuration notifications. Choices:
|
|
Specify 802.3ah notifications. Choices:
|
|
Link up-down transitions. Choices:
|
|
OTN alarm trap subcategories. |
|
Loss of frame alarm notifications. Choices:
|
|
Loss of multiframe alarm notification. Choices:
|
|
Loss of signal alarm notification. Choices:
|
|
ODU Alarm indication signal alarm notification. Choices:
|
|
ODU Background block error threshold alarm notification. Choices:
|
|
ODU Backward defect indication alarm notification. Choices:
|
|
ODU Errored Second threshold alarm notification. Choices:
|
|
ODU Locked alarm notification. Choices:
|
|
ODU Open connection indicator alarm notifications. Choices:
|
|
ODU Receive APS change notifications. Choices:
|
|
ODU Signal degrade alarm notifications. Choices:
|
|
ODU Severely Errored Second threshold alarm notification. Choices:
|
|
ODU Signal fail alarm notification. Choices:
|
|
ODU Trace identification mismatch alarm notification. Choices:
|
|
ODU Unavailable Second threshold alarm notification. Choices:
|
|
ODU Payload Type Mismatch alarm notification. Choices:
|
|
OTU Alarm indication signal alarm notification. Choices:
|
|
OTU Background block error threshold alarm notification. Choices:
|
|
OTU Backward defect indication alarm notification. Choices:
|
|
OTU Errored Second threshold alarm notification. Choices:
|
|
OTU Fec degraded errors alarm notification. Choices:
|
|
OTU Fec excessive errors alarm notification. Choices:
|
|
OTU Incoming alignment error alarm notification. Choices:
|
|
OTU Signal degrade alarm notification. Choices:
|
|
OTU Severely Errored Second threshold alarm notification. Choices:
|
|
OTU Signal fail alarm notification. Choices:
|
|
OTU Trace identification mismatch alarm notification. Choices:
|
|
OTU Unavailable Second threshold alarm notification. Choices:
|
|
Set otn_alarms. Choices:
|
|
Wavelength lock alarm notification. Choices:
|
|
Remote operations. Choices:
|
|
RMON rising and falling alarms. Choices:
|
|
Routing protocol notifications. Choices:
|
|
Services notifications. Choices:
|
|
System warm and cold starts. Choices:
|
|
VRRP notifications. Choices:
|
|
SNMP trap receiver port number |
|
Use logical-system name for v1/v2c clients. |
|
Specify trap group name. |
|
Routing instance for trap destination. |
|
Targets for trap messages |
|
SNMP version. Choices:
|
|
SNMP trap options. |
|
Agent address for v1 trap PDUs. |
|
Use address on outgoing interfaces. Choices:
|
|
Add context oid in varbind of all traps at the end. Choices:
|
|
Add snmpTrapEnterprise oid in varbind of all traps. Choices:
|
|
Use logical-system name for v1/v2c clients. |
|
Specify routing-instance. |
|
Set trap options. Choices:
|
|
IPv4/IPv6 source address for trap PDUs. |
|
Use specified address. |
|
Use lowest address on loopback interfaces. Choices:
|
|
Define MIB views. |
|
MIB view name. |
|
OID include/exclude list |
|
Exclude this OID from the view. Choices:
|
|
Include this OID from the view. Choices:
|
|
OID to include or exclude from view. |
|
This option is used only with state parsed. The value of this option should be the output received from the Junos device by executing the command show system snmp. The state parsed reads the configuration from |
|
The state the configuration should be left in. Refer to examples for more details. Choices:
|
Notes
Note
This module requires the netconf system service be enabled on the device being managed.
This module works with connection
netconf
.Tested against JunOS v18.4R1
Examples
# Using merged
#
# Before state
# ------------
#
# vagrant@vsrx# show routing-instances
# clv1 {
# description clv1;
# }
# clv2 {
# description clv2;
# }
- name: Merge provided SNMP configuration into running configuration.
junipernetworks.junos.junos_snmp_server:
config:
arp:
set: true
host_name_resolution: true
client_lists: # ATTR-----2
- name: cl1
addresses:
- address: "192.16.1.0/24"
- address: "192.16.2.0/24"
- address: "11.11.11.11"
restrict: true
- name: cl2
addresses:
- address: "192.16.4.0/24"
routing_instance_access: # ATTR-----3
set: true
access_lists:
- "clv1"
- "clv2"
state: merged
#
# -------------------------
# Module Execution Result
# -------------------------
# "after": {
# "arp": {
# "host_name_resolution": true
# },
# "client_lists": [
# {
# "addresses": [
# {
# "address": "192.16.1.0/24"
# },
# {
# "address": "192.16.2.0/24"
# },
# {
# "address": "11.11.11.11/32",
# "restrict": true
# }
# ],
# "name": "cl1"
# },
# {
# "addresses": [
# {
# "address": "192.16.4.0/24"
# }
# ],
# "name": "cl2"
# }
# ],
# "routing_instance_access": {
# "access_lists": [
# "clv1",
# "clv2"
# ]
# }
# },
# "before": {},
# "changed": true,
# "commands": [
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">"
# "<nc:arp><nc:host-name-resolution/></nc:arp><nc:client-list><nc:name>cl1</nc:name>"
# "<nc:client-address-list><nc:name>192.16.1.0/24</nc:name></nc:client-address-list>"
# "<nc:client-address-list><nc:name>192.16.2.0/24</nc:name></nc:client-address-list><nc:client-address-list>"
# "<nc:name>11.11.11.11</nc:name><nc:restrict/></nc:client-address-list></nc:client-list><nc:client-list>"
# "<nc:name>cl2</nc:name><nc:client-address-list><nc:name>192.16.4.0/24</nc:name></nc:client-address-list>"
# "</nc:client-list><nc:routing-instance-access><nc:access-list><nc:name>clv1</nc:name></nc:access-list>"
# "<nc:access-list><nc:name>clv2</nc:name></nc:access-list></nc:routing-instance-access></nc:snmp>"
# ]
# After state
# -----------
#
# vagrant@vsrx# show snmp
# client-list cl1 {
# 192.16.1.0/24;
# 192.16.2.0/24;
# 11.11.11.11/32 {
# restrict;
# }
# }
# client-list cl2 {
# 192.16.4.0/24;
# }
# routing-instance-access {
# access-list {
# clv1;
# clv2;
# }
# }
# arp {
# host-name-resolution;
# }
# vagrant@vsrx# show routing-instances
# clv1 {
# description clv1;
# }
# clv2 {
# description clv2;
# }
#
# Using Replaced
# Before state
# ------------
#
# vagrant@vsrx# show snmp
# client-list cl1 {
# 192.16.1.0/24;
# 192.16.2.0/24;
# 11.11.11.11/32 {
# restrict;
# }
# }
# client-list cl2 {
# 192.16.4.0/24;
# }
# routing-instance-access {
# access-list {
# clv1;
# clv2;
# }
# }
# arp {
# host-name-resolution;
# }
# vagrant@vsrx# show routing-instances
# clv1 {
# description clv1;
# }
# clv2 {
# description clv2;
# }
- name: Replaced running SNMP server configuration with provided configuration
junipernetworks.junos.junos_snmp_server:
config:
contact: "[email protected]"
customization:
ether_stats_ifd_only: true
description: "Local SNMP Server"
engine_id:
local: "local1"
use_default_ip_address: true
use_mac_address: true
filter_duplicates: true
filter_interfaces:
set: true
all_internal_interfaces: true
interfaces:
- "eth1"
- "eth2"
state: replaced
#
# -------------------------
# Module Execution Result
# -------------------------
# "after": {
# "contact": "[email protected]",
# "customization": {
# "ether_stats_ifd_only": true
# },
# "description": "Local SNMP Server",
# "engine_id": {
# "use_mac_address": true
# },
# "filter_duplicates": true,
# "filter_interfaces": {
# "all_internal_interfaces": true,
# "interfaces": [
# "eth1",
# "eth2"
# ]
# }
# },
# "before":
# {
# "arp": {
# "host_name_resolution": true
# },
# "client_lists": [
# {
# "addresses": [
# {
# "address": "192.16.1.0/24"
# },
# {
# "address": "192.16.2.0/24"
# },
# {
# "address": "11.11.11.11/32",
# "restrict": true
# }
# ],
# "name": "cl1"
# },
# {
# "addresses": [
# {
# "address": "192.16.4.0/24"
# }
# ],
# "name": "cl2"
# }
# ],
# "routing_instance_access": {
# "access_lists": [
# "clv1",
# "clv2"
# ]
# }
# },
# "changed": true,
# "commands": [
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"/>",
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" delete="delete"/>",
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">"
# "<nc:contact>[email protected]</nc:contact><nc:customization>"
# "<nc:ether-stats-ifd-only/></nc:customization><nc:description>Local SNMP Server</nc:description>"
# "<nc:engine-id><nc:local>local1</nc:local><nc:use-default-ip-address/><nc:use-mac-address/>"
# "</nc:engine-id><nc:filter-duplicates/><nc:filter-interfaces><nc:all-internal-interfaces/><nc:interfaces>"
# "<nc:name>eth1</nc:name></nc:interfaces><nc:interfaces><nc:name>eth2</nc:name></nc:interfaces>"
# "</nc:filter-interfaces></nc:snmp>"
# ]
# After state
# -----------
#
# vagrant@vsrx# show routing-instances
# clv1 {
# description clv1;
# }
# clv2 {
# description clv2;
# }
# vagrant@vsrx# show snmp
# description "Local SNMP Server";
# contact "[email protected]";
# filter-interfaces {
# interfaces {
# eth1;
# eth2;
# }
# all-internal-interfaces;
# }
# filter-duplicates;
# engine-id {
# use-mac-address;
# }
# customization {
# ether-stats-ifd-only;
# }
# Using overridden
#
# Before state
# ------------
#
# vagrant@vsrx# show snmp
# client-list cl1 {
# 192.16.1.0/24;
# 192.16.2.0/24;
# 11.11.11.11/32 {
# restrict;
# }
# }
# client-list cl2 {
# 192.16.4.0/24;
# }
# routing-instance-access {
# access-list {
# clv1;
# clv2;
# }
# }
# arp {
# host-name-resolution;
# }
# vagrant@vsrx# show routing-instances
# clv1 {
# description clv1;
# }
# clv2 {
# description clv2;
# }
- name: Override running SNMP server configuration with provided configuration
junipernetworks.junos.junos_snmp_server:
config:
contact: "[email protected]"
customization:
ether_stats_ifd_only: true
description: "Local SNMP Server"
engine_id:
local: "local1"
use_default_ip_address: true
use_mac_address: true
filter_duplicates: true
filter_interfaces:
set: true
all_internal_interfaces: true
interfaces:
- "eth1"
- "eth2"
state: overridden
#
# -------------------------
# Module Execution Result
# -------------------------
# "after": {
# "contact": "[email protected]",
# "customization": {
# "ether_stats_ifd_only": true
# },
# "description": "Local SNMP Server",
# "engine_id": {
# "use_mac_address": true
# },
# "filter_duplicates": true,
# "filter_interfaces": {
# "all_internal_interfaces": true,
# "interfaces": [
# "eth1",
# "eth2"
# ]
# }
# },
# "before":
# {
# "arp": {
# "host_name_resolution": true
# },
# "client_lists": [
# {
# "addresses": [
# {
# "address": "192.16.1.0/24"
# },
# {
# "address": "192.16.2.0/24"
# },
# {
# "address": "11.11.11.11/32",
# "restrict": true
# }
# ],
# "name": "cl1"
# },
# {
# "addresses": [
# {
# "address": "192.16.4.0/24"
# }
# ],
# "name": "cl2"
# }
# ],
# "routing_instance_access": {
# "access_lists": [
# "clv1",
# "clv2"
# ]
# }
# },
# "changed": true,
# "commands": [
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"/>",
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" delete="delete"/>",
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">"
# "<nc:contact>[email protected]</nc:contact><nc:customization>"
# "<nc:ether-stats-ifd-only/></nc:customization><nc:description>Local SNMP Server</nc:description>"
# "<nc:engine-id><nc:local>local1</nc:local><nc:use-default-ip-address/><nc:use-mac-address/>"
# "</nc:engine-id><nc:filter-duplicates/><nc:filter-interfaces><nc:all-internal-interfaces/><nc:interfaces>"
# "<nc:name>eth1</nc:name></nc:interfaces><nc:interfaces><nc:name>eth2</nc:name></nc:interfaces>"
# "</nc:filter-interfaces></nc:snmp>"
# ]
# After state
# -----------
#
# vagrant@vsrx# show routing-instances
# clv1 {
# description clv1;
# }
# clv2 {
# description clv2;
# }
# vagrant@vsrx# show snmp
# description "Local SNMP Server";
# contact "[email protected]";
# filter-interfaces {
# interfaces {
# eth1;
# eth2;
# }
# all-internal-interfaces;
# }
# filter-duplicates;
# engine-id {
# use-mac-address;
# }
# customization {
# ether-stats-ifd-only;
# }
#
# Using deleted
#
# Before state
# ------------
#
# vagrant@vsrx# show routing-instances
# clv1 {
# description clv1;
# }
# clv2 {
# description clv2;
# }
# vagrant@vsrx# show snmp
# description "Local SNMP Server";
# contact "[email protected]";
# filter-interfaces {
# interfaces {
# eth1;
# eth2;
# }
# all-internal-interfaces;
# }
# filter-duplicates;
# engine-id {
# use-mac-address;
# }
# customization {
# ether-stats-ifd-only;
# }
#
- name: Delete running SNMP server configuration
junipernetworks.junos.junos_snmp_server:
config:
state: deleted
#
# -------------------------
# Module Execution Result
# -------------------------
# "after": {},
# "before": {
# "contact": "[email protected]",
# "customization": {
# "ether_stats_ifd_only": true
# },
# "description": "Local SNMP Server",
# "engine_id": {
# "use_mac_address": true
# },
# "filter_duplicates": true,
# "filter_interfaces": {
# "all_internal_interfaces": true,
# "interfaces": [
# "eth1",
# "eth2"
# ]
# }
# },
# "changed": true,
# "commands": [
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"/>",
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" delete="delete"/>"
# ]
# After state
# -----------
#
# vagrant@vsrx# show routing-instances
# clv1 {
# description clv1;
# }
# clv2 {
# description clv2;
# }
# vagrant@vsrx# show snmp
# description "Local SNMP Server";
# contact "[email protected]";
# filter-interfaces {
# interfaces {
# eth1;
# eth2;
# }
# all-internal-interfaces;
# }
# filter-duplicates;
# engine-id {
# use-mac-address;
# }
# customization {
# ether-stats-ifd-only;
# }
#
- name: Gather running SNMP server configuration
junipernetworks.junos.junos_snmp_server:
state: gathered
#
# -------------------------
# Module Execution Result
# -------------------------
# "gathered": {
# "contact": "[email protected]",
# "customization": {
# "ether_stats_ifd_only": true
# },
# "description": "Local SNMP Server",
# "engine_id": {
# "use_mac_address": true
# },
# "filter_duplicates": true,
# "filter_interfaces": {
# "all_internal_interfaces": true,
# "interfaces": [
# "eth1",
# "eth2"
# ]
# }
# },
# "changed": false,
# Using rendered
#
# Before state
# ------------
#
- name: Render xml for provided facts.
junipernetworks.junos.junos_snmp_server:
config:
arp:
set: true
host_name_resolution: true
routing_instance_access: # ATTR-----3
set: true
access_lists:
- "clv1"
- "clv2"
state: rendered
#
# -------------------------
# Module Execution Result
# -------------------------
# "rendered": [
# "<nc:snmp xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">"
# "<nc:arp><nc:host-name-resolution/></nc:arp><nc:routing-instance-access>"
# "<nc:access-list><nc:name>clv1</nc:name></nc:access-list><nc:access-list><nc:name>clv2</nc:name>"
# "</nc:access-list></nc:routing-instance-access></nc:snmp>"
# ]
#
# Using parsed
# parsed.cfg
# ------------
# <?xml version="1.0" encoding="UTF-8"?>
# <rpc-reply message-id="urn:uuid:0cadb4e8-5bba-47f4-986e-72906227007f">
# <configuration changed-seconds="1590139550" changed-localtime="2020-05-22 09:25:50 UTC">
# <version>18.4R1-S2.4</version>
# <system xmlns="http://yang.juniper.net/junos-es/conf/system">
# <snmp>
# <client-list>
# <name>cl1</name>
# <client-address-list>
# <name>192.16.1.0/24</name>
# </client-address-list>
# <client-address-list>
# <name>192.16.2.0/24</name>
# </client-address-list>
# <client-address-list>
# <name>11.11.11.11/32</name>
# <restrict/>
# </client-address-list>
# </client-list>
# <client-list>
# <name>cl2</name>
# <client-address-list>
# <name>192.16.4.0/24</name>
# </client-address-list>
# </client-list>
# <routing-instance-access>
# <access-list>
# <name>clv1</name>
# </access-list>
# <access-list>
# <name>clv2</name>
# </access-list>
# </routing-instance-access>
# <arp>
# <host-name-resolution/>
# </arp>
# </snmp>
# </system>
# </configuration>
# </rpc-reply>
#
- name: Parse SNMP server running config
junipernetworks.junos.junos_snmp_server:
running_config: "{{ lookup('file', './parsed.cfg') }}"
state: parsed
#
#
# -------------------------
# Module Execution Result
# -------------------------
#
#
# "parsed": {
# "arp": {
# "host_name_resolution": true
# },
# "client_lists": [
# {
# "addresses": [
# {
# "address": "192.16.1.0/24"
# },
# {
# "address": "192.16.2.0/24"
# },
# {
# "address": "11.11.11.11/32",
# "restrict": true
# }
# ],
# "name": "cl1"
# },
# {
# "addresses": [
# {
# "address": "192.16.4.0/24"
# }
# ],
# "name": "cl2"
# }
# ],
# "routing_instance_access": {
# "access_lists": [
# "clv1",
# "clv2"
# ]
# }
# }
#
#
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration model invocation. Returned: when changed Sample: |
|
The configuration prior to the model invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |