diff --git a/changelogs/fragments/fix_80.yml b/changelogs/fragments/fix_80.yml new file mode 100644 index 0000000..d9cf2c2 --- /dev/null +++ b/changelogs/fragments/fix_80.yml @@ -0,0 +1,2 @@ +bugfixes: + - Fix bigboot repeatedly increasing the partition size diff --git a/roles/bigboot/tasks/do_bigboot_reboot.yml b/roles/bigboot/tasks/do_bigboot_reboot.yml index 1d887e9..6cd6395 100644 --- a/roles/bigboot/tasks/do_bigboot_reboot.yml +++ b/roles/bigboot/tasks/do_bigboot_reboot.yml @@ -14,17 +14,20 @@ dest: /usr/lib/dracut/modules.d/99extend_boot/increase-boot-partition.sh mode: '0554' +- name: Configure hook removal reboot cron + ansible.builtin.cron: + name: bigboot hook removal + cron_file: bigboot_hook_removal + user: root + special_time: reboot + job: '(rm -rf /usr/lib/dracut/modules.d/99extend_boot; rm -f /etc/cron.d/bigboot_hook_removal) > /dev/null 2>&1' + - name: Create the initramfs and reboot to run the module vars: initramfs_add_modules: "extend_boot" ansible.builtin.include_role: name: initramfs -- name: Remove dracut extend boot module - ansible.builtin.file: - path: /usr/lib/dracut/modules.d/99extend_boot - state: absent - - name: Retrieve mount points ansible.builtin.setup: gather_subset: diff --git a/roles/initramfs/tasks/main.yml b/roles/initramfs/tasks/main.yml index 53c3786..5057abe 100644 --- a/roles/initramfs/tasks/main.yml +++ b/roles/initramfs/tasks/main.yml @@ -14,7 +14,7 @@ ansible.builtin.copy: remote_src: true src: /boot/initramfs-{{ initramfs_kernel_version }}.img - dest: /boot/initramfs-{{ initramfs_kernel_version }}.img.{{ initramfs_backup_extension }} + dest: /root/initramfs-{{ initramfs_kernel_version }}.img.{{ initramfs_backup_extension }} mode: "0600" - name: Create a new initramfs with the optional additional modules @@ -22,12 +22,16 @@ ansible.builtin.command: '/usr/bin/dracut {{ ((initramfs_add_modules | length) > 0) | ternary("-a", "") }} "{{ initramfs_add_modules }}" --kver {{ initramfs_kernel_version }} --force' changed_when: true +- name: Configure initramfs restore reboot cron + ansible.builtin.cron: + name: initramfs restore + cron_file: initramfs_restore + user: root + special_time: reboot + # yamllint disable-line rule:line-length + job: '(mv -f /root/initramfs-{{ initramfs_kernel_version }}.img.{{ initramfs_backup_extension }} /boot/initramfs-{{ initramfs_kernel_version }}.img; rm -f /etc/cron.d/initramfs_restore) > /dev/null 2>&1' + - name: Reboot the server ansible.builtin.reboot: post_reboot_delay: "{{ initramfs_post_reboot_delay }}" reboot_timeout: "{{ initramfs_reboot_timeout }}" - -- name: Restore previous initramfs - # yamllint disable-line rule:line-length - ansible.builtin.command: '/usr/bin/mv -f /boot/initramfs-{{ initramfs_kernel_version }}.img.{{ initramfs_backup_extension }} /boot/initramfs-{{ initramfs_kernel_version }}.img' - changed_when: true diff --git a/roles/shrink_lv/defaults/main.yaml b/roles/shrink_lv/defaults/main.yaml deleted file mode 100644 index 8d530b7..0000000 --- a/roles/shrink_lv/defaults/main.yaml +++ /dev/null @@ -1 +0,0 @@ -shrink_lv_backup_extension: old