Deprecated

Removed in None

i

Reason:Updated modules released with more functionality | Alternative:Use platform-specific "[netos]_logging" module

ansible.netcommon.net_logging (3.1.3) — module

(deprecated, removed after 2022-06-01) Manage logging on network devices

| "added in version" 1.0.0 of ansible.netcommon"

Authors: Ganesh Nalawade (@ganeshrn)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install ansible.netcommon:==3.1.3


Add to requirements.yml

  collections:
    - name: ansible.netcommon
      version: 3.1.3

Description

This module provides declarative management of logging on network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure console logging
  ansible.netcommon.net_logging:
    dest: console
    facility: any
    level: critical
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove console logging configuration
  ansible.netcommon.net_logging:
    dest: console
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure host logging
  ansible.netcommon.net_logging:
    dest: host
    name: 192.0.2.1
    facility: kernel
    level: critical
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure file logging using aggregate
  ansible.netcommon.net_logging:
    dest: file
    aggregate:
    - name: test-1
      facility: pfe
      level: critical
    - name: test-2
      facility: kernel
      level: emergency
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete file logging using aggregate
  ansible.netcommon.net_logging:
    dest: file
    aggregate:
    - name: test-1
      facility: pfe
      level: critical
    - name: test-2
      facility: kernel
      level: emergency
    state: absent

Inputs

    
dest:
    choices:
    - console
    - host
    description:
    - Destination of the logs.

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

level:
    description:
    - Set logging severity levels.

purge:
    default: false
    description:
    - Purge logging not defined in the I(aggregate) parameter.

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

facility:
    description:
    - Set logging facility.

aggregate:
    description: List of logging definitions.

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always, except for the platforms that use Netconf transport to manage
    the device.
  sample:
  - logging console critical
  type: list