106 lines
2.6 KiB
Python
106 lines
2.6 KiB
Python
|
#!/usr/bin/python
|
||
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
# (c) 2017, Ansible by Red Hat, inc
|
||
|
#
|
||
|
# This file is part of Ansible by Red Hat
|
||
|
#
|
||
|
# Ansible is free software: you can redistribute it and/or modify
|
||
|
# it under the terms of the GNU General Public License as published by
|
||
|
# the Free Software Foundation, either version 3 of the License, or
|
||
|
# (at your option) any later version.
|
||
|
#
|
||
|
# Ansible is distributed in the hope that it will be useful,
|
||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
# GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||
|
#
|
||
|
|
||
|
ANSIBLE_METADATA = {'metadata_version': '1.0',
|
||
|
'status': ['preview'],
|
||
|
'supported_by': 'core'}
|
||
|
|
||
|
|
||
|
DOCUMENTATION = """
|
||
|
---
|
||
|
module: net_logging
|
||
|
version_added: "2.4"
|
||
|
author: "Ganesh Nalawade (@ganeshrn)"
|
||
|
short_description: Manage logging on network devices
|
||
|
description:
|
||
|
- This module provides declarative management of logging
|
||
|
on network devices.
|
||
|
options:
|
||
|
dest:
|
||
|
description:
|
||
|
- Destination of the logs.
|
||
|
choices: ['console', 'host']
|
||
|
name:
|
||
|
description:
|
||
|
- If value of C(dest) is I(host) it indicates file-name
|
||
|
the host name to be notified.
|
||
|
facility:
|
||
|
description:
|
||
|
- Set logging facility.
|
||
|
level:
|
||
|
description:
|
||
|
- Set logging severity levels.
|
||
|
collection:
|
||
|
description: List of logging definitions.
|
||
|
purge:
|
||
|
description:
|
||
|
- Purge logging not defined in the collections parameter.
|
||
|
default: no
|
||
|
state:
|
||
|
description:
|
||
|
- State of the logging configuration.
|
||
|
default: present
|
||
|
choices: ['present', 'absent']
|
||
|
"""
|
||
|
|
||
|
EXAMPLES = """
|
||
|
- 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: 1.1.1.1
|
||
|
facility: kernel
|
||
|
level: critical
|
||
|
"""
|
||
|
|
||
|
RETURN = """
|
||
|
commands:
|
||
|
description: The list of configuration mode commands to send to the device
|
||
|
returned: always
|
||
|
type: list
|
||
|
sample:
|
||
|
- logging console critical
|
||
|
|
||
|
rpc:
|
||
|
description: load-configuration RPC send to the device
|
||
|
returned: C(rpc) is returned only for junos device
|
||
|
when configuration is changed on device
|
||
|
type: string
|
||
|
sample: >
|
||
|
<system>
|
||
|
<syslog>
|
||
|
<console replace=\"replace\" active=\"active\">
|
||
|
<name>pfe</name><error/>
|
||
|
</console>
|
||
|
</syslog>
|
||
|
</system>
|
||
|
"""
|