Made grub_timeout and grub_recordfail_timeout optional

This commit is contained in:
nicobo 2022-03-14 20:22:01 +01:00
parent 04777093a3
commit 52cadaa0ec
3 changed files with 6 additions and 4 deletions

View file

@ -1,9 +1,9 @@
---
# defaults file for grub
grub_timeout: 5
#grub_timeout: 5
grub_recordfail_timeout: "{{ grub_timeout }}"
#grub_recordfail_timeout: "{{ grub_timeout }}"
# Add options here, for example:
# grub_options:

View file

@ -3,18 +3,18 @@
- name: test if grub_timeout is set correctly
ansible.builtin.assert:
that:
- grub_timeout is defined
- 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 defined
- 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:

View file

@ -17,6 +17,7 @@
line: GRUB_TIMEOUT={{ grub_timeout }}
create: yes
mode: "0664"
when: grub_timeout is defined
notify:
- update grub
@ -26,6 +27,7 @@
line: GRUB_RECORDFAIL_TIMEOUT={{ grub_recordfail_timeout }}
create: yes
mode: "0664"
when: grub_recordfail_timeout is defined
notify:
- update grub