mirror of
https://github.com/nicolabs/ansible-role-grub.git
synced 2026-05-21 11:58:46 +02:00
38 lines
912 B
YAML
38 lines
912 B
YAML
---
|
|
# tasks file for grub
|
|
- name: include assert.yml
|
|
include_tasks: assert.yml
|
|
|
|
- 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
|