mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
* eos_logging idempotence fix * fixed eos_logging idempotence issue * Fixed pylint and pep8 errors * Added tests for eos_logging & minor fix * Removed q statements
This commit is contained in:
parent
2272b6155c
commit
b9ea646839
2 changed files with 94 additions and 15 deletions
|
@ -64,6 +64,7 @@
|
|||
- 'result.changed == true'
|
||||
- '"logging console warnings" in result.commands'
|
||||
|
||||
|
||||
- name: Configure buffer size
|
||||
eos_logging:
|
||||
dest: buffered
|
||||
|
@ -76,11 +77,42 @@
|
|||
- 'result.changed == true'
|
||||
- '"logging buffered 480000" in result.commands'
|
||||
|
||||
- name: Set up logging destination and facility at the same time
|
||||
eos_logging:
|
||||
dest: buffered
|
||||
size: 4096
|
||||
facility: local7
|
||||
level: informational
|
||||
state: present
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- '"logging buffered 4096 informational" in result.commands'
|
||||
- '"logging facility local7" in result.commands'
|
||||
|
||||
- name: Set up logging destination and facility at the same time again (idempotent)
|
||||
eos_logging:
|
||||
dest: buffered
|
||||
size: 4096
|
||||
facility: local7
|
||||
level: informational
|
||||
state: present
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == false'
|
||||
|
||||
- name: remove logging as collection tearDown
|
||||
eos_logging:
|
||||
aggregate:
|
||||
- { dest: console, level: warnings, state: absent }
|
||||
- { dest: buffered, size: 480000, state: absent }
|
||||
- { dest: buffered, level: informational, size: 4096, state: absent }
|
||||
- { facility: local7, state: absent }
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
|
@ -89,3 +121,4 @@
|
|||
- 'result.changed == true'
|
||||
- '"no logging console" in result.commands'
|
||||
- '"no logging buffered" in result.commands'
|
||||
- '"no logging facility local7" in result.commands'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue