mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
1.9 KiB
YAML
91 lines
1.9 KiB
YAML
7 years ago
|
---
|
||
|
- name: Set up console logging
|
||
|
nxos_logging:
|
||
|
dest: console
|
||
|
dest_level: 0
|
||
|
state: present
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
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
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- 'result.changed == false'
|
||
|
|
||
|
- name: Delete/disable console logging
|
||
|
nxos_logging:
|
||
|
dest: console
|
||
|
dest_level: 0
|
||
|
state: absent
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
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
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- 'result.changed == false'
|
||
|
|
||
|
- name: Logfile logging with level
|
||
|
nxos_logging:
|
||
|
dest: logfile
|
||
|
name: test
|
||
|
dest_level: 0
|
||
|
state: present
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
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
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
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 }
|
||
7 years ago
|
provider: "{{ connection }}"
|
||
7 years ago
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- 'result.changed == true'
|
||
|
- '"no logging logfile" in result.commands'
|
||
|
- '"no logging level daemon" in result.commands'
|