ansible-role-grub/tasks/assert.yml

39 lines
930 B
YAML

---
- name: test if grub_timeout is set correctly
ansible.builtin.assert:
that:
- grub_timeout is number
- grub_timeout >= 0
quiet: yes
when: grub_timeout is defined
- name: test if grub_recordfail_timeout is set correctly
ansible.builtin.assert:
that:
- grub_recordfail_timeout is number
- grub_recordfail_timeout >= 0
quiet: yes
when: grub_timeout is defined and grub_recordfail_timeout is defined
- name: test if grub_options is set correctly
ansible.builtin.assert:
that:
- grub_options is iterable
quiet: yes
when:
- grub_options is defined
- name: test if item in grub_options is set correctly
ansible.builtin.assert:
that:
- item.option is defined
- item.option is string
- item.value is defined
quiet: yes
loop: "{{ grub_options }}"
loop_control:
label: "{{ item.option }}"
when:
- grub_options is defined