This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
---
|
||||
- name: GRUB mkconfig
|
||||
ansible.builtin.command: |
|
||||
grub-mkconfig -o /boot/grub/grub.cfg
|
||||
register: ret
|
||||
changed_when: ret.rc != 0
|
||||
- name: Reboot
|
||||
ansible.builtin.reboot:
|
||||
|
||||
12
roles/setup_cgroupsv1/tasks/grub.yml
Normal file
12
roles/setup_cgroupsv1/tasks/grub.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Append cgroupsv1 boot option
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/default/grub
|
||||
regexp: '^(GRUB_CMDLINE_LINUX_DEFAULT)="(.*)"$'
|
||||
line: '\1="\2 SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1 systemd.unified_cgroup_hierarchy=0"'
|
||||
backrefs: true
|
||||
notify:
|
||||
- GRUB mkconfig
|
||||
- Reboot
|
||||
- name: Flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
@@ -1,13 +1,20 @@
|
||||
---
|
||||
- name: Setup boot entry facts
|
||||
ansible.builtin.set_fact:
|
||||
bootconf: "{{ setup_cgroupsv1_bootconf | default('/boot/loader/entries/arch.conf') }}"
|
||||
- name: Append cgroupsv1 boot option
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ bootconf }}"
|
||||
regexp: '^(options.*rw)'
|
||||
line: '\1 SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1 systemd.unified_cgroup_hierarchy=0'
|
||||
backrefs: true
|
||||
notify: Reboot
|
||||
- name: Flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
- name: Check systemd-boot
|
||||
ansible.builtin.file:
|
||||
path: /boot/loader
|
||||
check_mode: true
|
||||
ignore_errors: true
|
||||
register: ret
|
||||
- name: Import systemd-boot
|
||||
ansible.builtin.import_tasks: systemd-boot.yml
|
||||
when: not ret.failed
|
||||
|
||||
- name: Check grub
|
||||
ansible.builtin.file:
|
||||
path: /boot/grub
|
||||
check_mode: true
|
||||
ignore_errors: true
|
||||
register: ret
|
||||
- name: Import grub
|
||||
ansible.builtin.import_tasks: grub.yml
|
||||
when: not ret.failed
|
||||
|
||||
13
roles/setup_cgroupsv1/tasks/systemd-boot.yml
Normal file
13
roles/setup_cgroupsv1/tasks/systemd-boot.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Setup boot entry facts
|
||||
ansible.builtin.set_fact:
|
||||
bootconf: "{{ setup_cgroupsv1_bootconf | default('/boot/loader/entries/arch.conf') }}"
|
||||
- name: Append cgroupsv1 boot option
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ bootconf }}"
|
||||
regexp: '^(options.*rw)'
|
||||
line: '\1 SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1 systemd.unified_cgroup_hierarchy=0'
|
||||
backrefs: true
|
||||
notify: Reboot
|
||||
- name: Flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
Reference in New Issue
Block a user