Updates to allow Bigboot to decrement from the default target size, down to a minimum threshold of 1GB

This commit is contained in:
2025-04-30 22:22:11 -04:00
parent 212ace2d6d
commit a3021ac84e
8 changed files with 45 additions and 33 deletions

View File

@ -0,0 +1,26 @@
---
- name: Fail if /boot can't expand to at least 1GB
ansible.builtin.assert:
that: bigboot_size_target | human_to_bytes > 1073741824
fail_msg: "{{ bigboot_size_target | int | human_readable(unit='M') }} is less than the minimum of 1GB for /boot"
- name: Verify available space and re-check if needed
block:
- name: Assert that there is space on the logical volume for shrinkage
ansible.builtin.assert:
that: bigboot_lv_info['size_available'] > bigboot_expansion_diff | int
fail_msg: There is not enough space available for LV shrinking.
rescue:
- name: Decrement size target by .25G
ansible.builtin.set_fact:
bigboot_size_target: "{{ bigboot_size_target | human_to_bytes - 262144000 }}"
- name: Update required expansion space
ansible.builtin.set_fact:
bigboot_expansion_diff:
"{{ bigboot_size_target | human_to_bytes - bigboot_boot_partsize | human_to_bytes }}"
- name: Re-check disk space - RESCUE
ansible.builtin.include_tasks: check_space_fallback.yml