cisco.iosxr.iosxr_logging_global – Manages logging attributes of Cisco IOSXR network devices

Note

This plugin is part of the cisco.iosxr collection (version 2.4.0).

To install it use: ansible-galaxy collection install cisco.iosxr.

To use it in a playbook, specify: cisco.iosxr.iosxr_logging_global.

New in version 2.4.0: of cisco.iosxr

Synopsis

  • This module manages the logging attributes of Cisco IOSXR network devices

Note

This module has a corresponding action plugin.

Parameters

Parameter Choices/Defaults Comments
config
dictionary
A dictionary of logging options.
archive
dictionary
logging to a persistent device(disk/harddisk)
archive_length
integer
The maximum no of weeks of log to maintain.
archive_size
integer
The total size of the archive.
device
string
Configure the archive device
file_size
integer
The maximum file size for a single log file..
frequency
string
    Choices:
  • daily
  • weekly
The collection interval for logs.
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • errors
  • informational
  • notifications
  • warnings
Logging severity level
threshold
integer
Threshold percent <1-99>.
buffered
dictionary
Set buffered logging parameters
discriminator
list / elements=dictionary
Establish MD-Buffer association
match_params
string
    Choices:
  • match1
  • match2
  • match3
  • nomatch1
  • nomatch2
  • nomatch3
Set match/no-match discriminator.
name
string
discriminator name.
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • errors
  • informational
  • notifications
  • warnings
Logging severity level
size
integer
Logging buffer size
console
dictionary
Set console logging parameters
discriminator
list / elements=dictionary
Establish MD-Buffer association
match_params
string
    Choices:
  • match1
  • match2
  • match3
  • nomatch1
  • nomatch2
  • nomatch3
Set match/no-match discriminator.
name
string
discriminator name.
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • errors
  • informational
  • notifications
  • warning
Logging severity level
state
string
    Choices:
  • enabled
  • disabled
Enable or disable logging.
correlator
dictionary
Configure properties of the event correlator
buffer_size
integer
Configure size of the correlator buffer.
rule_sets
list / elements=dictionary
Configure a specified correlation ruleset.
name
string
Name of the ruleset
rulename
list / elements=string
Name of the rule
rules
list / elements=dictionary
Configure a specified correlation rule.
context_correlation
boolean
    Choices:
  • no
  • yes
Specify enable correlation on context.
reissue_nonbistate
boolean
    Choices:
  • no
  • yes
Specify reissue of non-bistate alarms on parent clear.This option is allowed for the rules whose type is stateful.
reparent
boolean
    Choices:
  • no
  • yes
Specify reparent of alarm on parent clear.This option is allowed for the rules whose type is stateful.
rule_name
string
name of rule.
rule_type
string
    Choices:
  • stateful
  • nonstateful
type of rule - stateful or nonstateful.
timeout
integer
Specify timeout.
timeout_rootcause
integer
Specify timeout for root-cause.
events
dictionary
Configure event monitoring parameters.
buffer_size
integer
Set size of the local event buffer.
display_location
boolean
    Choices:
  • no
  • yes
Include alarm source location in message text.
filter_match
list / elements=string
Configure filter.
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • errors
  • informational
  • notifications
  • warnings
Logging severity level
threshold
integer
Capacity alarm threshold.
facility
string
    Choices:
  • auth
  • cron
  • daemon
  • kern
  • local0
  • local1
  • local2
  • local3
  • local4
  • local5
  • local6
  • local7
  • lpr
  • mail
  • news
  • sys10
  • sys11
  • sys12
  • sys13
  • sys14
  • sys9
  • syslog
  • user
  • uucp
Facility parameter for syslog messages
files
list / elements=dictionary
Set file logging.
maxfilesize
integer
Set max file size.
name
string
name of file.
path
string
Set file path.
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • errors
  • info
  • notifications
  • warning
Logging severity level
format
boolean
    Choices:
  • no
  • yes
Enable to send the syslog message rfc5424 format .
history
dictionary
Configure syslog history table
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • errors
  • informational
  • notifications
  • warnings
Logging severity level
size
integer
Logging buffer size
state
string
    Choices:
  • enabled
  • disabled
Enable or disable logging.
hostnameprefix
string
Hostname prefix to add on msgs to servers.
hosts
list / elements=dictionary
Set syslog server IP address and parameters
host
string
IPv4/Ipv6 address or hostname of the syslog server
port
string
Default:
"default"
Set <0-65535> non-default Port.
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • error
  • info
  • notifications
  • warning
Logging severity level
vrf
string
Default:
"default"
Set VRF option
ipv4
dictionary
Mark the dscp/precedence bit for ipv4 packets.
dscp
string
Set IP DSCP (DiffServ CodePoint).Please refer vendor document for valid entries.
precedence
string
Set precedence Please refer vendor document for valid entries.
ipv6
dictionary
Mark the dscp/precedence bit for ipv4 packets.
dscp
string
Set IP DSCP (DiffServ CodePoint).Please refer vendor document for valid entries.
precedence
string
Set precedence Please refer vendor document for valid entries.
localfilesize
integer
Set size of the local log file
monitor
dictionary
Set terminal line (monitor) logging parameters
discriminator
list / elements=dictionary
Establish MD-Buffer association
match_params
string
    Choices:
  • match1
  • match2
  • match3
  • nomatch1
  • nomatch2
  • nomatch3
Set match/no-match discriminator.
name
string
discriminator name.
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • errors
  • informational
  • notifications
  • warning
Logging severity level
state
string
    Choices:
  • enabled
  • disabled
Enable or disable logging.
source_interfaces
list / elements=dictionary
Specify interface for source address in logging transactions
interface
string
Interface name with number
vrf
string
VPN Routing/Forwarding instance name
suppress
dictionary
Suppress logging behaviour.
apply_rule
string
Apply suppression rule.
duplicates
boolean
    Choices:
  • no
  • yes
Suppress consecutive duplicate messages.
tls_servers
list / elements=dictionary
Secure server over tls.
name
string
Name for the tls peer configuration.
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • errors
  • informational
  • notifications
  • warnings
Logging severity level
tls_hostname
string
Name of the logging host.
trustpoint
string
Name of the trustpoint configured.
vrf
string
name of vrf.
trap
dictionary
Set syslog server logging level
severity
string
    Choices:
  • alerts
  • critical
  • debugging
  • emergencies
  • errors
  • informational
  • notifications
  • warning
Logging severity level
state
string
    Choices:
  • enabled
  • disabled
Enable or disable logging.
running_config
string
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 logging.
The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the parsed key within the result.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
  • parsed
  • rendered
The state the configuration should be left in

Notes

Note

  • Tested against IOSXR 7.0.2.

  • This module works with connection network_cli.

Examples

# Using merged
#-----------------
# Before state
#RP/0/0/CPU0:10#show running-config logging
#Thu Feb  4 09:38:36.245 UTC
#% No such configuration item(s)
#RP/0/0/CPU0:10#
#
#
#  - name: Merge the provided configuration with the existing running configuration
#    cisco.iosxr.iosxr_logging_global:
#         config:
#           buffered:
#             size: 2097152
#             severity: warnings
#           correlator:
#             buffer_size: 1024
#           events:
#             display_location: True
#           files:
#             - maxfilesize: '1024'
#               name: test
#               path: test
#               severity: info
#           hostnameprefix: test
#           hosts:
#             - host: 1.1.1.1
#               port: default
#               severity: critical
#               vrf: default
#           ipv4:
#             dscp: af11
#           localfilesize: 1024
#           monitor:
#             severity: errors
#           source_interfaces:
#             - interface: GigabitEthernet0/0/0/0
#               vrf: test
#           tls_servers:
#             - name: test
#               tls_hostname: test2
#               trustpoint: test2
#               vrf: test
#           trap:
#             severity: informational
#         state: merged
#
#
# After state:
#-------------------------------------------
#RP/0/0/CPU0:10#show running-config logging
# Tue Jul 20 18:09:18.491 UTC
# logging tls-server test
#  vrf test
#  trustpoint test2
#  tls-hostname test2
# !
# logging file test path test maxfilesize 1024 severity info
# logging ipv4 dscp af11
# logging trap informational
# logging events display-location
# logging monitor errors
# logging buffered 2097152
# logging buffered warnings
# logging 1.1.1.1 vrf default severity critical port default
# logging correlator buffer-size 1024
# logging localfilesize 1024
# logging source-interface GigabitEthernet0/0/0/0 vrf test
# logging hostnameprefix test
#------------------------------------------------
#Module execution
#
#     "after": {
#         "buffered": {
#             "severity": "errors"
#         },
#         "correlator": {
#             "buffer_size": 1024
#         },
#         "files": [
#             {
#                 "maxfilesize": "1024",
#                 "name": "test",
#                 "path": "test1",
#                 "severity": "info"
#             }
#         ],
#         "hostnameprefix": "test1",
#         "hosts": [
#             {
#                 "host": "1.1.1.3",
#                 "port": "default",
#                 "severity": "critical",
#                 "vrf": "default"
#             }
#         ],
#         "ipv6": {
#             "dscp": "af11"
#         },
#         "localfilesize": 1024,
#         "source_interfaces": [
#             {
#                 "interface": "GigabitEthernet0/0/0/0",
#                 "vrf": "test1"
#             }
#         ],
#         "tls_servers": [
#             {
#                 "name": "test",
#                 "tls_hostname": "test2",
#                 "trustpoint": "test",
#                 "vrf": "test"
#             }
#         ]
#     },
#     "before": {},
#     "changed": true,
#     "commands": [
#         "logging buffered errors",
#         "logging correlator buffer-size 1024",
#         "logging hostnameprefix test1",
#         "logging ipv6 dscp af11",
#         "logging localfilesize 1024",
#         "logging trap disable",
#         "logging monitor disable",
#         "logging history disable",
#         "logging console disable",
#         "logging 1.1.1.3 vrf default severity critical port default",
#         "logging file test path test1 maxfilesize 1024 severity info",
#         "logging source-interface GigabitEthernet0/0/0/0 vrf test1",
#         "logging tls-server test tls-hostname test2",
#         "logging tls-server test trustpoint test",
#         "logging tls-server test vrf test"
#     ],
#     "invocation": {
#         "module_args": {
#             "config": {
#                 "archive": null,
#                 "buffered": {
#                     "discriminator": null,
#                     "severity": "errors",
#                     "size": null
#                 },
#                 "console": {
#                     "discriminator": null,
#                     "severity": null,
#                     "state": "disabled"
#                 },
#                 "correlator": {
#                     "buffer_size": 1024,
#                     "rule_set": null,
#                     "rules": null
#                 },
#                 "events": null,
#                 "facility": null,
#                 "files": [
#                     {
#                         "maxfilesize": "1024",
#                         "name": "test",
#                         "path": "test1",
#                         "severity": "info"
#                     }
#                 ],
#                 "format": null,
#                 "history": {
#                     "severity": null,
#                     "size": null,
#                     "state": "disabled"
#                 },
#                 "hostnameprefix": "test1",
#                 "hosts": [
#                     {
#                         "host": "1.1.1.3",
#                         "port": "default",
#                         "severity": "critical",
#                         "vrf": "default"
#                     }
#                 ],
#                 "ipv4": null,
#                 "ipv6": {
#                     "dscp": "af11",
#                     "precedence": null
#                 },
#                 "localfilesize": 1024,
#                 "monitor": {
#                     "discriminator": null,
#                     "severity": null,
#                     "state": "disabled"
#                 },
#                 "source_interfaces": [
#                     {
#                         "interface": "GigabitEthernet0/0/0/0",
#                         "vrf": "test1"
#                     }
#                 ],
#                 "suppress": null,
#                 "tls_servers": [
#                     {
#                         "name": "test",
#                         "severity": null,
#                         "tls_hostname": "test2",
#                         "trustpoint": "test",
#                         "vrf": "test"
#                     }
#                 ],
#                 "trap": {
#                     "severity": null,
#                     "state": "disabled"
#                 }
#             },
#             "running_config": null,
#             "state": "merged"
#         }
#     }
# }
#
# Using replaced:
# -----------------------------------------------------------
#
#Before state
#RP/0/0/CPU0:10#show running-config logging
# Tue Jul 20 18:09:18.491 UTC
# logging tls-server test
#  vrf test
#  trustpoint test2
#  tls-hostname test2
# !
# logging file test path test maxfilesize 1024 severity info
# logging ipv4 dscp af11
# logging trap informational
# logging events display-location
# logging monitor errors
# logging buffered 2097152
# logging buffered warnings
# logging 1.1.1.1 vrf default severity critical port default
# logging correlator buffer-size 1024
# logging localfilesize 1024
# logging source-interface GigabitEthernet0/0/0/0 vrf test
# logging hostnameprefix test
#-----------------------------------------------------------
#
# - name: Replace BGP configuration with provided configuration
#   cisco.iosxr.iosxr_logging_global:
#     state: replaced
#     config:
#           buffered:
#             severity: errors
#           correlator:
#             buffer_size: 1024
#           files:
#             - maxfilesize: '1024'
#               name: test
#               path: test1
#               severity: info
#           hostnameprefix: test1
#           hosts:
#             - host: 1.1.1.3
#               port: default
#               severity: critical
#               vrf: default
#           ipv6:
#             dscp: af11
#           localfilesize: 1024
#           monitor:
#             severity: errors
#           tls_servers:
#             - name: test
#               tls_hostname: test2
#               trustpoint: test
#               vrf: test
#           trap:
#             severity: critical
#
# After state:
#RP/0/0/CPU0:10#show running-config logging
# Tue Jul 20 18:31:51.709 UTC
# logging tls-server test
#  vrf test
#  trustpoint test
#  tls-hostname test2
# !
# logging file test path test1 maxfilesize 1024 severity info
# logging ipv6 dscp af11
# logging trap critical
# logging monitor errors
# logging buffered errors
# logging 1.1.1.3 vrf default severity critical port default
# logging correlator buffer-size 1024
# logging localfilesize 1024
# logging hostnameprefix test1
#-----------------------------------------------------------------
#
# Module Execution:
# "after": {
#         "buffered": {
#             "severity": "errors"
#         },
#         "correlator": {
#             "buffer_size": 1024
#         },
#         "files": [
#             {
#                 "maxfilesize": "1024",
#                 "name": "test",
#                 "path": "test1",
#                 "severity": "info"
#             }
#         ],
#         "hostnameprefix": "test1",
#         "hosts": [
#             {
#                 "host": "1.1.1.3",
#                 "port": "default",
#                 "severity": "critical",
#                 "vrf": "default"
#             }
#         ],
#         "ipv6": {
#             "dscp": "af11"
#         },
#         "localfilesize": 1024,
#         "monitor": {
#             "severity": "errors"
#         },
#         "tls_servers": [
#             {
#                 "name": "test",
#                 "tls_hostname": "test2",
#                 "trustpoint": "test",
#                 "vrf": "test"
#             }
#         ],
#         "trap": {
#             "severity": "critical"
#         }
#     },
#     "before": {
#         "buffered": {
#             "severity": "warnings",
#             "size": 2097152
#         },
#         "correlator": {
#             "buffer_size": 1024
#         },
#         "events": {
#             "display_location": true
#         },
#         "files": [
#             {
#                 "maxfilesize": "1024",
#                 "name": "test",
#                 "path": "test",
#                 "severity": "info"
#             }
#         ],
#         "hostnameprefix": "test",
#         "hosts": [
#             {
#                 "host": "1.1.1.1",
#                 "port": "default",
#                 "severity": "critical",
#                 "vrf": "default"
#             }
#         ],
#         "ipv4": {
#             "dscp": "af11"
#         },
#         "localfilesize": 1024,
#         "monitor": {
#             "severity": "errors"
#         },
#         "source_interfaces": [
#             {
#                 "interface": "GigabitEthernet0/0/0/0",
#                 "vrf": "test"
#             }
#         ],
#         "tls_servers": [
#             {
#                 "name": "test",
#                 "tls_hostname": "test2",
#                 "trustpoint": "test2",
#                 "vrf": "test"
#             }
#         ],
#         "trap": {
#             "severity": "informational"
#         }
#     },
#     "changed": true,
#     "commands": [
#         "no logging buffered 2097152",
#         "no logging events display-location",
#         "no logging ipv4 dscp af11",
#         "no logging 1.1.1.1 vrf default severity critical port default",
#         "no logging source-interface GigabitEthernet0/0/0/0 vrf test",
#         "logging buffered errors",
#         "logging hostnameprefix test1",
#         "logging ipv6 dscp af11",
#         "logging trap critical",
#         "logging 1.1.1.3 vrf default severity critical port default",
#         "logging file test path test1 maxfilesize 1024 severity info",
#         "logging tls-server test trustpoint test"
#     ],
#
#
#
# Using deleted:
# -----------------------------------------------------------
# Before state:
#RP/0/0/CPU0:10#show running-config logging
# Tue Jul 20 18:09:18.491 UTC
# logging tls-server test
#  vrf test
#  trustpoint test2
#  tls-hostname test2
# !
# logging file test path test maxfilesize 1024 severity info
# logging ipv4 dscp af11
# logging trap informational
# logging events display-location
# logging monitor errors
# logging buffered 2097152
# logging buffered warnings
# logging 1.1.1.1 vrf default severity critical port default
# logging correlator buffer-size 1024
# logging localfilesize 1024
# logging source-interface GigabitEthernet0/0/0/0 vrf test
# logging hostnameprefix test
#
#-----------------------------------------------------------
# - name: Delete given logging_global configuration
#   cisco.iosxr.iosxr_logging_global:
#     state: deleted
#
# After state:
#RP/0/0/CPU0:10#show running-config
#
#-------------------------------------------------------------
# Module Execution:
#
# "after": {},
#     "before": {
#         "buffered": {
#             "severity": "warnings",
#             "size": 2097152
#         },
#         "correlator": {
#             "buffer_size": 1024
#         },
#         "events": {
#             "display_location": true
#         },
#         "files": [
#             {
#                 "maxfilesize": "1024",
#                 "name": "test",
#                 "path": "test",
#                 "severity": "info"
#             }
#         ],
#         "hostnameprefix": "test",
#         "hosts": [
#             {
#                 "host": "1.1.1.1",
#                 "port": "default",
#                 "severity": "critical",
#                 "vrf": "default"
#             }
#         ],
#         "ipv4": {
#             "dscp": "af11"
#         },
#         "localfilesize": 1024,
#         "monitor": {
#             "severity": "errors"
#         },
#         "source_interfaces": [
#             {
#                 "interface": "GigabitEthernet0/0/0/0",
#                 "vrf": "test"
#             }
#         ],
#         "tls_servers": [
#             {
#                 "name": "test",
#                 "tls_hostname": "test2",
#                 "trustpoint": "test2",
#                 "vrf": "test"
#             }
#         ],
#         "trap": {
#             "severity": "informational"
#         }
#     },
#     "changed": true,
#     "commands": [
#         "no logging buffered 2097152",
#         "no logging buffered warnings",
#         "no logging correlator buffer-size 1024",
#         "no logging events display-location",
#         "no logging hostnameprefix test",
#         "no logging ipv4 dscp af11",
#         "no logging localfilesize 1024",
#         "no logging monitor errors",
#         "no logging trap informational",
#         "no logging 1.1.1.1 vrf default severity critical port default",
#         "no logging file test path test maxfilesize 1024 severity info",
#         "no logging source-interface GigabitEthernet0/0/0/0 vrf test",
#         "no logging tls-server test"
#     ],
#     "invocation": {
#         "module_args": {
#             "config": null,
#             "running_config": null,
#             "state": "deleted"
#         }
#     }
#
#
#
# using gathered:
# ------------------------------------------------------------
# Before state:
#RP/0/0/CPU0:10#show running-config logging
# Tue Jul 20 18:09:18.491 UTC
# logging tls-server test
#  vrf test
#  trustpoint test2
#  tls-hostname test2
# !
# logging file test path test maxfilesize 1024 severity info
# logging ipv4 dscp af11
# logging trap informational
# logging events display-location
# logging monitor errors
# logging buffered 2097152
# logging buffered warnings
# logging 1.1.1.1 vrf default severity critical port default
# logging correlator buffer-size 1024
# logging localfilesize 1024
# logging source-interface GigabitEthernet0/0/0/0 vrf test
# logging hostnameprefix test
#
#
# - name: Gather iosxr_logging_global facts using gathered state
#   cisco.iosxr.iosxr_logging_global:
#     state: gathered
#
#-------------------------------------------------------------
# Module Execution:
#
# "changed": false,
# "gathered": {
#         "buffered": {
#             "severity": "warnings",
#             "size": 2097152
#         },
#         "correlator": {
#             "buffer_size": 1024
#         },
#         "events": {
#             "display_location": true
#         },
#         "files": [
#             {
#                 "maxfilesize": "1024",
#                 "name": "test",
#                 "path": "test",
#                 "severity": "info"
#             }
#         ],
#         "hostnameprefix": "test",
#         "hosts": [
#             {
#                 "host": "1.1.1.1",
#                 "port": "default",
#                 "severity": "critical",
#                 "vrf": "default"
#             }
#         ],
#         "ipv4": {
#             "dscp": "af11"
#         },
#         "localfilesize": 1024,
#         "monitor": {
#             "severity": "errors"
#         },
#         "source_interfaces": [
#             {
#                 "interface": "GigabitEthernet0/0/0/0",
#                 "vrf": "test"
#             }
#         ],
#         "tls_servers": [
#             {
#                 "name": "test",
#                 "tls_hostname": "test2",
#                 "trustpoint": "test2",
#                 "vrf": "test"
#             }
#         ],
#         "trap": {
#             "severity": "informational"
#         }
#     },
#     "invocation": {
#         "module_args": {
#             "config": null,
#             "running_config": null,
#             "state": "gathered"
#         }
# }
#
#
# Using parsed:
#---------------------------------------------------------------
#
# parsed.cfg
#
# logging tls-server test
#  vrf test
#  trustpoint test2
#  tls-hostname test2
# !
# logging file test path test maxfilesize 1024 severity info
# logging ipv4 dscp af11
# logging trap informational
# logging events display-location
# logging monitor errors
# logging buffered 2097152
# logging buffered warnings
# logging 1.1.1.1 vrf default severity critical port default
# logging correlator buffer-size 1024
# logging localfilesize 1024
# logging source-interface GigabitEthernet0/0/0/0 vrf test
# logging hostnameprefix test
#
#
# - name: Parse externally provided Prefix_lists config to agnostic model
#   cisco.iosxr.iosxr_prefix_lists:
#     running_config: "{{ lookup('file', './fixtures/parsed.cfg') }}"
#     state: parsed
#----------------------------------------------------------------
# Module execution:
# "changed": false,
# "parsed": {
#         "buffered": {
#             "severity": "warnings",
#             "size": 2097152
#         },
#         "correlator": {
#             "buffer_size": 1024
#         },
#         "events": {
#             "display_location": true
#         },
#         "files": [
#             {
#                 "maxfilesize": "1024",
#                 "name": "test",
#                 "path": "test",
#                 "severity": "info"
#             }
#         ],
#         "hostnameprefix": "test",
#         "hosts": [
#             {
#                 "host": "1.1.1.1",
#                 "port": "default",
#                 "severity": "critical",
#                 "vrf": "default"
#             }
#         ],
#         "ipv4": {
#             "dscp": "af11"
#         },
#         "localfilesize": 1024,
#         "monitor": {
#             "severity": "errors"
#         },
#         "source_interfaces": [
#             {
#                 "interface": "GigabitEthernet0/0/0/0",
#                 "vrf": "test"
#             }
#         ],
#         "tls_servers": [
#             {
#                 "name": "test",
#                 "tls_hostname": "test2",
#                 "trustpoint": "test2",
#                 "vrf": "test"
#             }
#         ],
#         "trap": {
#             "severity": "informational"
#         }
#     }
#
#
# Using rendered:
# ----------------------------------------------------------------------------
# - name: Render platform specific configuration lines with state rendered (without connecting to the device)
#   cisco.iosxr.iosxr_logging_global:
#     state: rendered
#     config:
#       buffered:
#         size: 2097152
#         severity: warnings
#       correlator:
#         buffer_size: 1024
#       events:
#         display_location: True
#       files:
#         - maxfilesize: '1024'
#           name: test
#           path: test
#           severity: info
#       hostnameprefix: test
#       hosts:
#         - host: 1.1.1.1
#           port: default
#           severity: critical
#           vrf: default
#       ipv4:
#         dscp: af11
#       localfilesize: 1024
#       monitor:
#         severity: errors
#       source_interfaces:
#         - interface: GigabitEthernet0/0/0/0
#           vrf: test
#       tls_servers:
#         - name: test
#           tls_hostname: test2
#           trustpoint: test2
#           vrf: test
#       trap:
#         severity: informational
#----------------------------------------------------------------
# Module Execution:
# "rendered": [
#         "logging buffered errors",
#         "logging correlator buffer-size 1024",
#         "logging hostnameprefix test1",
#         "logging ipv6 dscp af11",
#         "logging localfilesize 1024",
#         "logging trap disable",
#         "logging monitor disable",
#         "logging history disable",
#         "logging console disable",
#         "logging 1.1.1.3 vrf default severity critical port default",
#         "logging file test path test1 maxfilesize 1024 severity info",
#         "logging source-interface GigabitEthernet0/0/0/0 vrf test1",
#         "logging tls-server test tls-hostname test2",
#         "logging tls-server test trustpoint test",
#         "logging tls-server test vrf test"
#     ]
#
# Using overridden:
# ---------------------------------------------------------------------------------
# Before state:
#RP/0/0/CPU0:10#show running-config logging
# Tue Jul 20 18:09:18.491 UTC
# logging tls-server test
#  vrf test
#  trustpoint test2
#  tls-hostname test2
# !
# logging file test path test maxfilesize 1024 severity info
# logging ipv4 dscp af11
# logging trap informational
# logging events display-location
# logging monitor errors
# logging buffered 2097152
# logging buffered warnings
# logging 1.1.1.1 vrf default severity critical port default
# logging correlator buffer-size 1024
# logging localfilesize 1024
# logging source-interface GigabitEthernet0/0/0/0 vrf test
# logging hostnameprefix test
#
#-----------------------------------------------------------
#
# - name: Overridde BGP configuration with provided configuration
#   cisco.iosxr.iosxr_logging_global: &id002
#     state: overridden
#     config:
#           buffered:
#             severity: errors
#           correlator:
#             buffer_size: 1024
#           files:
#             - maxfilesize: '1024'
#               name: test
#               path: test1
#               severity: info
#           hostnameprefix: test1
#           hosts:
#             - host: 1.1.1.3
#               port: default
#               severity: critical
#               vrf: default
#           ipv6:
#             dscp: af11
#           localfilesize: 1024
#           monitor:
#             severity: errors
#           tls_servers:
#             - name: test
#               tls_hostname: test2
#               trustpoint: test
#               vrf: test
#           trap:
#             severity: critical
#
# After state:
#RP/0/0/CPU0:10#show running-config logging
# Tue Jul 20 18:31:51.709 UTC
# logging tls-server test
#  vrf test
#  trustpoint test
#  tls-hostname test2
# !
# logging file test path test1 maxfilesize 1024 severity info
# logging ipv6 dscp af11
# logging trap critical
# logging monitor errors
# logging buffered errors
# logging 1.1.1.3 vrf default severity critical port default
# logging correlator buffer-size 1024
# logging localfilesize 1024
# logging hostnameprefix test1
#-----------------------------------------------------------------
#
# Module Execution:
# "after": {
#         "buffered": {
#             "severity": "errors"
#         },
#         "correlator": {
#             "buffer_size": 1024
#         },
#         "files": [
#             {
#                 "maxfilesize": "1024",
#                 "name": "test",
#                 "path": "test1",
#                 "severity": "info"
#             }
#         ],
#         "hostnameprefix": "test1",
#         "hosts": [
#             {
#                 "host": "1.1.1.3",
#                 "port": "default",
#                 "severity": "critical",
#                 "vrf": "default"
#             }
#         ],
#         "ipv6": {
#             "dscp": "af11"
#         },
#         "localfilesize": 1024,
#         "monitor": {
#             "severity": "errors"
#         },
#         "tls_servers": [
#             {
#                 "name": "test",
#                 "tls_hostname": "test2",
#                 "trustpoint": "test",
#                 "vrf": "test"
#             }
#         ],
#         "trap": {
#             "severity": "critical"
#         }
#     },
#     "before": {
#         "buffered": {
#             "severity": "warnings",
#             "size": 2097152
#         },
#         "correlator": {
#             "buffer_size": 1024
#         },
#         "events": {
#             "display_location": true
#         },
#         "files": [
#             {
#                 "maxfilesize": "1024",
#                 "name": "test",
#                 "path": "test",
#                 "severity": "info"
#             }
#         ],
#         "hostnameprefix": "test",
#         "hosts": [
#             {
#                 "host": "1.1.1.1",
#                 "port": "default",
#                 "severity": "critical",
#                 "vrf": "default"
#             }
#         ],
#         "ipv4": {
#             "dscp": "af11"
#         },
#         "localfilesize": 1024,
#         "monitor": {
#             "severity": "errors"
#         },
#         "source_interfaces": [
#             {
#                 "interface": "GigabitEthernet0/0/0/0",
#                 "vrf": "test"
#             }
#         ],
#         "tls_servers": [
#             {
#                 "name": "test",
#                 "tls_hostname": "test2",
#                 "trustpoint": "test2",
#                 "vrf": "test"
#             }
#         ],
#         "trap": {
#             "severity": "informational"
#         }
#     },
#     "changed": true,
#     "commands": [
#         "no logging buffered 2097152",
#         "no logging events display-location",
#         "no logging ipv4 dscp af11",
#         "no logging 1.1.1.1 vrf default severity critical port default",
#         "no logging source-interface GigabitEthernet0/0/0/0 vrf test",
#         "logging buffered errors",
#         "logging hostnameprefix test1",
#         "logging ipv6 dscp af11",
#         "logging trap critical",
#         "logging 1.1.1.3 vrf default severity critical port default",
#         "logging file test path test1 maxfilesize 1024 severity info",
#         "logging tls-server test trustpoint test"
#     ],
#

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
after
dictionary
when changed
The resulting configuration after module execution.

Sample:
This output will always be in the same format as the module argspec.
before
dictionary
when state is merged, replaced, overridden, deleted or purged
The configuration prior to the module execution.

Sample:
This output will always be in the same format as the module argspec.
commands
list / elements=string
when state is merged, replaced, overridden, deleted or purged
The set of commands pushed to the remote device.

Sample:
['logging file test path test1 maxfilesize 1024 severity info', 'logging ipv6 dscp af11', 'logging trap critical', 'logging monitor errors', 'logging buffered errors', 'logging 1.1.1.3 vrf default severity critical port default']
gathered
list / elements=string
when state is gathered
Facts about the network resource gathered from the remote device as structured data.

Sample:
This output will always be in the same format as the module argspec.
parsed
list / elements=string
when state is parsed
The device native config provided in running_config option parsed into structured data as per module argspec.

Sample:
This output will always be in the same format as the module argspec.
rendered
list / elements=string
when state is rendered
The provided configuration in the task rendered in device-native format (offline).

Sample:
['logging buffered errors', 'logging correlator buffer-size 1024', 'logging hostnameprefix test1', 'logging ipv6 dscp af11', 'logging localfilesize 1024', 'logging trap disable', 'logging monitor disable', 'logging history disable', 'logging console disable']


Authors

  • Ashwini Mhatre (@amhatre)