ansible.builtin.nxos_logging (v2.6.0) — module

Manage logging on network devices

| "added in version" 2.4 of ansible.builtin"

Authors: Trishna Guha (@trishnaguha)

preview | supported by network

Install Ansible via pip

Install with pip install ansible==2.6.0

Description

This module provides declarative management of logging on Cisco NX-OS devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure console logging with level
  nxos_logging:
    dest: console
    level: 2
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove console logging configuration
  nxos_logging:
    dest: console
    level: 2
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure file logging with level
  nxos_logging:
    dest: logfile
    name: testfile
    dest_level: 3
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure facility level logging
  nxos_logging:
    facility: daemon
    facility_level: 0
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove facility level logging
  nxos_logging:
    facility: daemon
    facility_level: 0
    state: absent

Inputs

    
dest:
    choices:
    - console
    - logfile
    - module
    - monitor
    description:
    - Destination of the logs.

name:
    description:
    - If value of C(dest) is I(logfile) it indicates file-name.

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the logging configuration.

facility:
    description:
    - Facility name for logging.

aggregate:
    description: List of logging definitions.

dest_level:
    aliases:
    - level
    description:
    - Set logging severity levels.

facility_level:
    description:
    - Set logging serverity levels for facility based log messages.

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  sample:
  - logging console 2
  - logging logfile testfile 3
  - logging level daemon 0
  type: list