mirror of
https://github.com/nicolabs/ansible-role-grub.git
synced 2025-09-07 18:11:07 +02:00
Added grub_default_options to define GRUB_CMDLINE_LINUX_DEFAULT
This commit is contained in:
parent
4ace85d0c9
commit
83d5263110
|
@ -47,5 +47,22 @@
|
|||
- grub_options is defined
|
||||
- grub_options | length > 0
|
||||
|
||||
|
||||
- name: add options to GRUB_CMDLINE_LINUX_DEFAULT
|
||||
ansible.builtin.replace:
|
||||
path: /etc/default/grub
|
||||
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT="((:?(?!{{ item.option }}=?[^s]*).)*?)"$'
|
||||
replace: 'GRUB_CMDLINE_LINUX_DEFAULT="\1 {{ item.option }}{{ "={}".format(item.value) if item.value is defined else "" }}"'
|
||||
validate: /bin/sh %s
|
||||
mode: "0664"
|
||||
loop: "{{ grub_default_options }}"
|
||||
loop_control:
|
||||
label: "{{ item.option }}"
|
||||
notify:
|
||||
- update grub
|
||||
when:
|
||||
- grub_default_options is defined
|
||||
- grub_default_options | length > 0
|
||||
|
||||
- name: flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
|
Loading…
Reference in a new issue