diff --git a/README.md b/README.md index ea9bb17..a8ab0df 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,8 @@ These variables are set in `defaults/main.yml`: grub_timeout: 5 +grub_recordfail_timeout: "{{ grub_timeout }}" + # Add options here, for example: # grub_options: # - option: cgroup_enable diff --git a/defaults/main.yml b/defaults/main.yml index 06896f0..6349761 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,6 +3,8 @@ grub_timeout: 5 +grub_recordfail_timeout: "{{ grub_timeout }}" + # Add options here, for example: # grub_options: # - option: cgroup_enable diff --git a/tasks/assert.yml b/tasks/assert.yml index a027890..b25cc7c 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -6,6 +6,13 @@ - grub_timeout | int >= 0 quiet: yes +- name: test if grub_recordfail_timeout is set correctly + assert: + that: + - grub_recordfail_timeout is defined + - grub_recordfail_timeout | int >= 0 + quiet: yes + - name: test if grub_options is set correctly assert: that: diff --git a/tasks/main.yml b/tasks/main.yml index 9650f59..89c77a0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,6 +16,14 @@ notify: - update grub +- name: set GRUB_RECORDFAIL_TIMEOUT + lineinfile: + path: /etc/default/grub + line: GRUB_RECORDFAIL_TIMEOUT={{ grub_recordfail_timeout }} + create: yes + notify: + - update grub + - name: add options to GRUB_CMDLINE_LINUX replace: path: /etc/default/grub