1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/vyos_logging/tests/cli/basic.yaml
David Newswanger 8643e9cb34 changed collection arg to argregate on 2.4 network modules (#26649)
* changed collection arg to argregate on 2.4 network modules

* replace users with aggregate in eos_user, junos_user, nxos_user

* added version_added to places where we replaced users with aggregate in the docs

* fix ios_static_route test

* update tests to reference aggregate instead of collection/users
2017-07-26 10:09:17 -04:00

133 lines
3.2 KiB
YAML

---
- name: set-up logging
vyos_logging:
dest: console
facility: all
level: info
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"set system syslog console facility all level info" in result.commands'
- name: set-up logging again (idempotent)
vyos_logging:
dest: console
facility: all
level: info
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == false'
- name: file logging
vyos_logging:
dest: file
name: test
facility: all
level: notice
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"set system syslog file test facility all level notice" in result.commands'
- name: file logging again (idempotent)
vyos_logging:
dest: file
name: test
facility: all
level: notice
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == false'
- name: delete logging
vyos_logging:
dest: file
name: test
facility: all
level: notice
state: absent
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"delete system syslog file test facility all level notice" in result.commands'
- name: delete logging again (idempotent)
vyos_logging:
dest: file
name: test
facility: all
level: notice
state: absent
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == false'
- name: Add logging collections
vyos_logging:
aggregate:
- { dest: file, name: test1, facility: all, level: info }
- { dest: file, name: test2, facility: news, level: debug }
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"set system syslog file test1 facility all level info" in result.commands'
- '"set system syslog file test2 facility news level debug" in result.commands'
- name: Add and remove logging collections with overrides
vyos_logging:
aggregate:
- { dest: console, facility: all, level: info }
- { dest: file, name: test1, facility: all, level: info, state: absent }
- { dest: console, facility: daemon, level: warning }
state: present
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"delete system syslog file test1 facility all level info" in result.commands'
- '"set system syslog console facility daemon level warning" in result.commands'
- name: Remove logging collections
vyos_logging:
aggregate:
- { dest: console, facility: all, level: info }
- { dest: console, facility: daemon, level: warning }
- { dest: file, name: test2, facility: news, level: debug }
state: absent
provider: "{{ cli }}"
register: result
- assert:
that:
- 'result.changed == true'
- '"delete system syslog console facility all level info" in result.commands'
- '"delete system syslog console facility daemon level warning" in result.commands'
- '"delete system syslog file test2 facility news level debug" in result.commands'