2017-07-17 09:15:53 +02:00
|
|
|
---
|
2017-11-08 17:09:21 +01:00
|
|
|
# ensure logging configs are empty
|
|
|
|
- name: Remove host logging
|
|
|
|
net_logging:
|
|
|
|
dest: host
|
|
|
|
name: 172.16.0.1
|
|
|
|
state: absent
|
|
|
|
authorize: yes
|
|
|
|
|
|
|
|
- name: Remove console
|
|
|
|
net_logging:
|
|
|
|
dest: console
|
|
|
|
level: warnings
|
|
|
|
state: absent
|
|
|
|
authorize: yes
|
|
|
|
|
|
|
|
- name: Remove buffer
|
|
|
|
net_logging:
|
|
|
|
dest: buffered
|
|
|
|
size: 8000
|
|
|
|
authorize: yes
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
# start tests
|
2017-07-17 09:15:53 +02:00
|
|
|
- name: Set up host logging
|
|
|
|
net_logging:
|
|
|
|
dest: host
|
|
|
|
name: 172.16.0.1
|
2017-11-08 17:09:21 +01:00
|
|
|
facility: local7
|
2017-07-17 09:15:53 +02:00
|
|
|
state: present
|
|
|
|
authorize: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2017-11-02 07:06:18 +01:00
|
|
|
- 'result.changed == true'
|
2017-07-17 09:15:53 +02:00
|
|
|
- '"logging host 172.16.0.1" in result.commands'
|
|
|
|
- '"logging facility local7" in result.commands'
|
|
|
|
|
|
|
|
- name: Set up host logging again (idempotent)
|
|
|
|
net_logging:
|
|
|
|
dest: host
|
|
|
|
name: 172.16.0.1
|
|
|
|
state: present
|
|
|
|
authorize: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
- name: Delete/disable host logging
|
|
|
|
net_logging:
|
|
|
|
dest: host
|
|
|
|
name: 172.16.0.1
|
|
|
|
state: absent
|
|
|
|
authorize: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"no logging host 172.16.0.1" in result.commands'
|
|
|
|
|
|
|
|
- name: Delete/disable host logging (idempotent)
|
|
|
|
net_logging:
|
|
|
|
dest: host
|
|
|
|
name: 172.16.0.1
|
|
|
|
state: absent
|
|
|
|
authorize: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
- name: Console logging with level warnings
|
|
|
|
net_logging:
|
|
|
|
dest: console
|
|
|
|
level: warnings
|
|
|
|
state: present
|
|
|
|
authorize: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"logging console warnings" in result.commands'
|
|
|
|
|
2017-11-08 17:09:21 +01:00
|
|
|
- name: Configure Buffer size
|
2017-07-17 09:15:53 +02:00
|
|
|
net_logging:
|
2017-11-08 17:09:21 +01:00
|
|
|
dest: buffered
|
|
|
|
size: 8000
|
2017-07-17 09:15:53 +02:00
|
|
|
authorize: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
2017-11-08 17:09:21 +01:00
|
|
|
- '"logging buffered 8000" in result.commands'
|
|
|
|
|
|
|
|
- name: Change logging parameters using aggregate
|
|
|
|
net_logging:
|
|
|
|
aggregate:
|
|
|
|
- { dest: console, level: notifications }
|
|
|
|
- { dest: buffered, size: 9000 }
|
|
|
|
authorize: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"logging buffered 9000" in result.commands'
|
|
|
|
- '"logging console notifications" in result.commands'
|
2017-07-17 09:15:53 +02:00
|
|
|
|
|
|
|
- name: remove logging as collection tearDown
|
|
|
|
net_logging:
|
|
|
|
aggregate:
|
2017-11-08 17:09:21 +01:00
|
|
|
- { dest: console, level: notifications }
|
|
|
|
- { dest: buffered, size: 9000 }
|
|
|
|
state: absent
|
2017-07-17 09:15:53 +02:00
|
|
|
authorize: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"no logging console" in result.commands'
|
2017-11-08 17:09:21 +01:00
|
|
|
- '"no logging buffered" in result.commands'
|