|
|
@ -24,6 +24,60 @@
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Set up console logging with level 2 (edge case)
|
|
|
|
|
|
|
|
nxos_logging: &clog2
|
|
|
|
|
|
|
|
dest: console
|
|
|
|
|
|
|
|
dest_level: 2
|
|
|
|
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
state: present
|
|
|
|
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- 'result.changed == true'
|
|
|
|
|
|
|
|
- '"logging console 2" in result.commands'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Set up console logging with level 2 (edge case) (idempotent)
|
|
|
|
|
|
|
|
nxos_logging: *clog2
|
|
|
|
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Set Baud Rate to less than 38400
|
|
|
|
|
|
|
|
nxos_config:
|
|
|
|
|
|
|
|
lines:
|
|
|
|
|
|
|
|
- speed 9600
|
|
|
|
|
|
|
|
parents: line console
|
|
|
|
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Enable console logging with level 3 (will fail)
|
|
|
|
|
|
|
|
nxos_logging: &con3
|
|
|
|
|
|
|
|
dest: console
|
|
|
|
|
|
|
|
dest_level: 3
|
|
|
|
|
|
|
|
register: result
|
|
|
|
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- 'result.failed == true'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Set Baud Rate to 38400
|
|
|
|
|
|
|
|
nxos_config:
|
|
|
|
|
|
|
|
lines:
|
|
|
|
|
|
|
|
- speed 38400
|
|
|
|
|
|
|
|
parents: line console
|
|
|
|
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Enable console logging with level 3 (will pass)
|
|
|
|
|
|
|
|
nxos_logging: *con3
|
|
|
|
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- 'result.changed == true'
|
|
|
|
|
|
|
|
- '"logging console 3" in result.commands'
|
|
|
|
|
|
|
|
|
|
|
|
- name: Logfile logging with level
|
|
|
|
- name: Logfile logging with level
|
|
|
|
nxos_logging: &llog
|
|
|
|
nxos_logging: &llog
|
|
|
|
dest: logfile
|
|
|
|
dest: logfile
|
|
|
@ -80,6 +134,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Configure monitor with level 5 (edge case)
|
|
|
|
|
|
|
|
nxos_logging: &mlog5
|
|
|
|
|
|
|
|
dest: monitor
|
|
|
|
|
|
|
|
dest_level: 5
|
|
|
|
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- 'result.changed == true'
|
|
|
|
|
|
|
|
- '"logging monitor 5" in result.commands'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Configure monitor with level 5 (edge case) (idempotent)
|
|
|
|
|
|
|
|
nxos_logging: *mlog5
|
|
|
|
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
|
|
|
|
- name: Configure facility with level
|
|
|
|
- name: Configure facility with level
|
|
|
|
nxos_logging: &flog
|
|
|
|
nxos_logging: &flog
|
|
|
|
facility: daemon
|
|
|
|
facility: daemon
|
|
|
@ -122,9 +194,9 @@
|
|
|
|
- name: remove logging as collection tearDown
|
|
|
|
- name: remove logging as collection tearDown
|
|
|
|
nxos_logging: &agg
|
|
|
|
nxos_logging: &agg
|
|
|
|
aggregate:
|
|
|
|
aggregate:
|
|
|
|
- { dest: console, dest_level: 0 }
|
|
|
|
- { dest: console, dest_level: 3 }
|
|
|
|
- { dest: module, dest_level: 2 }
|
|
|
|
- { dest: module, dest_level: 2 }
|
|
|
|
- { dest: monitor, dest_level: 3 }
|
|
|
|
- { dest: monitor, dest_level: 5 }
|
|
|
|
- { dest: logfile, dest_level: 1, name: test }
|
|
|
|
- { dest: logfile, dest_level: 1, name: test }
|
|
|
|
- { facility: daemon, facility_level: 4 }
|
|
|
|
- { facility: daemon, facility_level: 4 }
|
|
|
|
- { dest: server, remote_server: test-syslogserver.com, facility: auth, dest_level: 1 }
|
|
|
|
- { dest: server, remote_server: test-syslogserver.com, facility: auth, dest_level: 1 }
|
|
|
|