community.general.cnos_logging (0.1.1) — module

Manage logging on network devices

Authors: Anil Kumar Muraleedharan (@amuraleedhar)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

This module provides declarative management of logging on Cisco Cnos devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure server logging
  cnos_logging:
    dest: server
    name: 10.241.107.224
    facility: local7
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove server logging configuration
  cnos_logging:
    dest: server
    name: 10.241.107.224
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure console logging level and facility
  cnos_logging:
    dest: console
    level: 7
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure buffer size
  cnos_logging:
    dest: logfile
    level: 5
    name: testfile
    size: 5000
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure logging using aggregate
  cnos_logging:
    aggregate:
      - { dest: console, level: 6 }
      - { dest: logfile, size: 9000 }
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove logging using aggregate
  cnos_logging:
    aggregate:
      - { dest: console, level: 6 }
      - { dest: logfile, name: anil, size: 9000 }
    state: absent

Inputs

    
dest:
    choices:
    - server
    - console
    - monitor
    - logfile
    description:
    - Destination of the logs. Lenovo uses the term server instead of host in its CLI.

name:
    description:
    - If value of C(dest) is I(file) it indicates file-name and for I(server) indicates
      the server name to be notified.

size:
    default: 10485760
    description:
    - Size of buffer. The acceptable value is in range from 4096 to 4294967295 bytes.

level:
    default: 5
    description:
    - Set logging severity levels. 0-emerg;1-alert;2-crit;3-err;4-warn; 5-notif;6-inform;7-debug

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

facility:
    description:
    - Set logging facility. This is applicable only for server logging

aggregate:
    description: List of logging definitions.

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  sample:
  - logging console 7
  - logging server 10.241.107.224
  type: list