+grub role
This commit is contained in:
parent
5ffe2b9be1
commit
cfa9a8420a
7 changed files with 43 additions and 0 deletions
6
roles/grub/README.md
Normal file
6
roles/grub/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
grub
|
||||
=========
|
||||
|
||||
Ansible Role for misc. `GRUB` bootloader opinions. Notably:
|
||||
|
||||
- `GRUB_RECORDFAIL_TIMEOUT`: prevents requiring human intervention when the _last_ boot failed.
|
10
roles/grub/defaults/main.yml
Normal file
10
roles/grub/defaults/main.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
# defaults file for grub
|
||||
#
|
||||
grub_cfgs:
|
||||
debian: /etc/default/grub
|
||||
redhat: /etc/sysconfig/grub # likely a symlink, stub just in case
|
||||
|
||||
grub_updatecmd:
|
||||
debian: update-grub
|
||||
redhat: grub2-mkconfig -o /etc/grub2.cfg
|
9
roles/grub/handlers/main.yml
Normal file
9
roles/grub/handlers/main.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
# handlers file for grub
|
||||
#
|
||||
- name: Generate Config
|
||||
ansible.builtin.command:
|
||||
cmd: "{{ grub_updatecmd[ansible_os_family | lower] }}"
|
||||
become: true
|
||||
changed_when: true # handler, assume this cmd is realizing changes/making more
|
||||
listen: update_grubcfg
|
9
roles/grub/tasks/debian.yml
Normal file
9
roles/grub/tasks/debian.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
- name: Ensure 'GRUB_RECORDFAIL_TIMEOUT'
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ grub_cfgs[ansible_os_family | lower] }}"
|
||||
regexp: '^GRUB_RECORDFAIL_TIMEOUT'
|
||||
line: 'GRUB_RECORDFAIL_TIMEOUT=5'
|
||||
become: true
|
||||
notify: update_grubcfg
|
6
roles/grub/tasks/main.yml
Normal file
6
roles/grub/tasks/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
# tasks file for grub
|
||||
#
|
||||
- name: Include tasks by OS family
|
||||
ansible.builtin.include_tasks:
|
||||
file: "{{ ansible_os_family | lower }}.yml"
|
1
roles/grub/tasks/redhat.yml
Normal file
1
roles/grub/tasks/redhat.yml
Normal file
|
@ -0,0 +1 @@
|
|||
---
|
2
roles/grub/vars/main.yml
Normal file
2
roles/grub/vars/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
# vars file for grub
|
Loading…
Add table
Add a link
Reference in a new issue