Deprecated

Removed in 2.13

i

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

ansible.builtin._net_logging (v2.9.17) — module

Manage logging on network devices

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

Authors: Ganesh Nalawade (@ganeshrn)

deprecated | supported by network

Install Ansible via pip

Install with pip install ansible==2.9.17

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
  net_logging:
    dest: console
    facility: any
    level: critical
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove console logging configuration
  net_logging:
    dest: console
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure host logging
  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
  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
  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