fix: ensure grub config rgeneration after grubby changes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6d855b224d
commit
2181685e50
@ -11,3 +11,5 @@ kernel_blacklist_modules:
|
|||||||
kernel_namespace_support_enabled: False
|
kernel_namespace_support_enabled: False
|
||||||
kernel_coredump_enabled: True
|
kernel_coredump_enabled: True
|
||||||
kernel_cgroup_v2_enabled: False
|
kernel_cgroup_v2_enabled: False
|
||||||
|
|
||||||
|
kernel_grub_rebuild_force: False
|
||||||
|
@ -5,6 +5,15 @@
|
|||||||
become: True
|
become: True
|
||||||
become_user: root
|
become_user: root
|
||||||
|
|
||||||
|
- name: Rebuild grub config
|
||||||
|
command: "{{ item }}"
|
||||||
|
listen: __kernel_grub_rebuild
|
||||||
|
loop:
|
||||||
|
- grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||||
|
- grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg
|
||||||
|
become: True
|
||||||
|
become_user: root
|
||||||
|
|
||||||
- name: Reboot server
|
- name: Reboot server
|
||||||
reboot:
|
reboot:
|
||||||
reboot_timeout: 600
|
reboot_timeout: 600
|
||||||
|
@ -35,7 +35,7 @@ def test_coredump_config(host):
|
|||||||
|
|
||||||
def test_cgroup_config(host):
|
def test_cgroup_config(host):
|
||||||
grub = host.file("/boot/grub2/grubenv")
|
grub = host.file("/boot/grub2/grubenv")
|
||||||
proc = host.run("grep cgroup /proc/filesystems")
|
proc = host.run("mount -l | grep cgroup")
|
||||||
|
|
||||||
assert grub.contains("systemd.unified_cgroup_hierarchy=1")
|
assert grub.contains("systemd.unified_cgroup_hierarchy=1")
|
||||||
assert "cgroup2" in proc.stdout
|
assert "cgroup2 on /sys/fs/cgroup type cgroup2" in proc.stdout
|
||||||
|
@ -17,12 +17,21 @@
|
|||||||
- __kernel_cgroup_exception.rc != 0
|
- __kernel_cgroup_exception.rc != 0
|
||||||
- kernel_cgroup_v2_enabled | bool
|
- kernel_cgroup_v2_enabled | bool
|
||||||
notify:
|
notify:
|
||||||
|
- __kernel_grub_rebuild
|
||||||
- __kernel_server_restart
|
- __kernel_server_restart
|
||||||
|
|
||||||
- name: Disable cgroup v2 configuration
|
- name: Disable cgroup v2 configuration
|
||||||
command: grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
|
command: grubby --update-kernel=ALL --remove-args="systemd.unified_cgroup_hierarchy"
|
||||||
when:
|
when:
|
||||||
- __kernel_cgroup_exception.rc == 0
|
- __kernel_cgroup_exception.rc == 0
|
||||||
- not kernel_cgroup_v2_enabled | bool
|
- not kernel_cgroup_v2_enabled | bool
|
||||||
notify:
|
notify:
|
||||||
|
- __kernel_grub_rebuild
|
||||||
- __kernel_server_restart
|
- __kernel_server_restart
|
||||||
|
|
||||||
|
- name: Force rebuild grub config and reboot
|
||||||
|
command: /bin/true
|
||||||
|
notify:
|
||||||
|
- __kernel_grub_rebuild
|
||||||
|
- __kernel_server_restart
|
||||||
|
when: kernel_grub_rebuild_force | bool
|
||||||
|
Loading…
Reference in New Issue
Block a user