Deprecated

Removed in None

i

Reason:Newer and updated modules released with more functionality. | Alternative:ios_logging_global

cisco.ios.ios_logging (4.6.1) — module

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

| "added in version" 1.0.0 of cisco.ios"

Authors: Trishna Guha (@trishnaguha)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install cisco.ios:==4.6.1


Add to requirements.yml

  collections:
    - name: cisco.ios
      version: 4.6.1

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure host logging
  cisco.ios.ios_logging:
    dest: host
    name: 172.16.0.1
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove host logging configuration
  cisco.ios.ios_logging:
    dest: host
    name: 172.16.0.1
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure console logging level and facility
  cisco.ios.ios_logging:
    dest: console
    facility: local7
    level: debugging
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Enable logging to all
  cisco.ios.ios_logging:
    dest: on
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure buffer size
  cisco.ios.ios_logging:
    dest: buffered
    size: 5000
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure logging using aggregate
  cisco.ios.ios_logging:
    aggregate:
      - { dest: console, level: notifications }
      - { dest: buffered, size: 9000 }
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove logging using aggregate
  cisco.ios.ios_logging:
    aggregate:
      - { dest: console, level: notifications }
      - { dest: buffered, size: 9000 }
    state: absent

Inputs

    
dest:
    choices:
    - 'on'
    - host
    - console
    - monitor
    - buffered
    - trap
    description:
    - Destination of the logs.
    - On dest has to be quoted as 'on' or else pyyaml will convert to True before it gets
      to Ansible.
    type: str

name:
    description:
    - The hostname or IP address of the destination.
    - Required when I(dest=host).
    type: str

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

level:
    choices:
    - emergencies
    - alerts
    - critical
    - errors
    - warnings
    - notifications
    - informational
    - debugging
    default: debugging
    description:
    - Set logging severity levels.
    type: str

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

facility:
    description:
    - Set logging facility.
    type: str

aggregate:
    description: List of logging definitions.
    elements: dict
    suboptions:
      dest:
        choices:
        - 'on'
        - host
        - console
        - monitor
        - buffered
        - trap
        description:
        - Destination of the logs.
        - On dest has to be quoted as 'on' or else pyyaml will convert to True before
          it gets to Ansible.
        type: str
      facility:
        description:
        - Set logging facility.
        type: str
      level:
        choices:
        - emergencies
        - alerts
        - critical
        - errors
        - warnings
        - notifications
        - informational
        - debugging
        description:
        - Set logging severity levels.
        type: str
      name:
        description:
        - The hostname or IP address of the destination.
        - Required when I(dest=host).
        type: str
      size:
        description:
        - Size of buffer. The acceptable value is in range from 4096 to 4294967295 bytes.
        type: int
      state:
        choices:
        - present
        - absent
        description:
        - State of the logging configuration.
        type: str
    type: list

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  sample:
  - logging facility local7
  - logging host 172.16.0.1
  type: list