mirror of
https://github.com/univention/ansible-modules.git
synced 2025-10-26 11:19:34 +00:00
test(ucr): Fail ucr get tasks directly instead of asserting later
This commit is contained in:
parent
5ef778d285
commit
bc0fa36bb8
@ -9,16 +9,14 @@
|
||||
- name: "Get ansible/foo"
|
||||
ansible.builtin.command: "univention-config-registry get ansible/foo"
|
||||
register: "ansible_foo"
|
||||
changed_when: "ansible_foo.stdout = ''"
|
||||
failed_when: "'bar' not in ansible_foo.stdout"
|
||||
|
||||
- name: "Get stats cron"
|
||||
ansible.builtin.command: "tail -2 /etc/cron.d/univention-system-stats"
|
||||
register: "sys_cron"
|
||||
|
||||
- name: "Check settings"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "'bar' in ansible_foo.stdout"
|
||||
- "'1 2 3 4 5' in sys_cron.stdout"
|
||||
changed_when: "sys_cron.stdout = ''"
|
||||
failed_when: "'1 2 3 4 5' not in sys_cron.stdout"
|
||||
|
||||
- name: "Set /etc/hosts entries"
|
||||
univention_config_registry:
|
||||
@ -37,6 +35,8 @@
|
||||
check_mode: true
|
||||
register: "hosts"
|
||||
failed_when: "(hosts is changed) or (hosts is failed)"
|
||||
tags:
|
||||
- "skip_ansible_lint"
|
||||
|
||||
- name: "Clear test key"
|
||||
univention_config_registry:
|
||||
@ -47,6 +47,8 @@
|
||||
- name: "Get ansible/foo"
|
||||
ansible.builtin.command: "univention-config-registry get ansible/foo"
|
||||
register: "ansible_foo"
|
||||
changed_when: "ansible_foo.stdout != ''"
|
||||
failed_when: "ansible_foo.stdout != ''"
|
||||
|
||||
- name: "Check cleared key"
|
||||
ansible.builtin.assert:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user