ansible / ansible.builtin / v2.7.10 / module / net_logging Manage logging on network devices | "added in version" 2.4 of ansible.builtin" Authors: Ganesh Nalawade (@ganeshrn) preview | supported by networkansible.builtin.net_logging (v2.7.10) — module
pip
Install with pip install ansible==2.7.10
This module provides declarative management of logging on network devices.
- name: configure console logging net_logging: dest: console facility: any level: critical
- name: remove console logging configuration net_logging: dest: console state: absent
- name: configure host logging net_logging: dest: host name: 192.0.2.1 facility: kernel level: critical
- 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
- 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
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.
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