mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
e37e736ddb
* nxos_logging implementation module Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * pep8 fixes * nxos_logging integration test Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * test typo fix Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * idempotent fix * rename feature to facility * make dest_group global var * remove str from arg_spec
90 lines
1.9 KiB
YAML
90 lines
1.9 KiB
YAML
---
|
|
- name: Set up console logging
|
|
nxos_logging:
|
|
dest: console
|
|
dest_level: 0
|
|
state: present
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"logging console 0" in result.commands'
|
|
|
|
- name: Set up console logging again (idempotent)
|
|
nxos_logging:
|
|
dest: console
|
|
dest_level: 0
|
|
state: present
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|
|
|
|
- name: Delete/disable console logging
|
|
nxos_logging:
|
|
dest: console
|
|
dest_level: 0
|
|
state: absent
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"no logging console" in result.commands'
|
|
|
|
- name: Delete/disable console logging (idempotent)
|
|
nxos_logging:
|
|
dest: console
|
|
dest_level: 0
|
|
state: absent
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|
|
|
|
- name: Logfile logging with level
|
|
nxos_logging:
|
|
dest: logfile
|
|
name: test
|
|
dest_level: 0
|
|
state: present
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"logging logfile test 0" in result.commands'
|
|
|
|
- name: Configure facility with level
|
|
nxos_logging:
|
|
facility: daemon
|
|
facility_level: 0
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"logging level daemon 0" in result.commands'
|
|
|
|
- name: remove logging as collection tearDown
|
|
nxos_logging:
|
|
aggregate:
|
|
- { dest: logfile, name: test, dest_level: 0, state: absent }
|
|
- { facility: daemon, facility_level: 0, state: absent }
|
|
provider: "{{ cli }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- '"no logging logfile" in result.commands'
|
|
- '"no logging level daemon" in result.commands'
|