mirror of
https://github.com/nicolabs/ansible-role-grub.git
synced 2025-09-21 00:31:42 +02:00
35 lines
856 B
YAML
35 lines
856 B
YAML
|
---
|
||
|
# tasks file for grub
|
||
|
- name: install required packages
|
||
|
package:
|
||
|
name: "{{ grub_packages }}"
|
||
|
state: present
|
||
|
register: grub_install_required_packages
|
||
|
until: grub_install_required_packages is succeeded
|
||
|
retries: 3
|
||
|
|
||
|
- name: set GRUB_TIMEOUT
|
||
|
lineinfile:
|
||
|
path: /etc/default/grub
|
||
|
line: GRUB_TIMEOUT={{ grub_timeout }}
|
||
|
notify:
|
||
|
- update grub
|
||
|
|
||
|
- name: add options to GRUB_CMDLINE_LINUX
|
||
|
replace:
|
||
|
path: /etc/default/grub
|
||
|
regexp: '^GRUB_CMDLINE_LINUX="((:?(?!{{ item.option }}={{ item.value }}).)*?)"$'
|
||
|
replace: 'GRUB_CMDLINE_LINUX="\1 {{ item.option }}={{ item.value }}"'
|
||
|
validate: /bin/sh %s
|
||
|
loop: "{{ grub_options }}"
|
||
|
loop_control:
|
||
|
label: "{{ item.option }}"
|
||
|
notify:
|
||
|
- update grub
|
||
|
when:
|
||
|
- grub_options is defined
|
||
|
- grub_options | length > 0
|
||
|
|
||
|
- name: flush handlers
|
||
|
meta: flush_handlers
|