diff --git a/tasks/capture_lv_device_details.yml b/tasks/capture_lv_device_details.yml index 580de93..3510466 100644 --- a/tasks/capture_lv_device_details.yml +++ b/tasks/capture_lv_device_details.yml @@ -109,7 +109,7 @@ - name: Assert if we need to shrink the logical volume to gain PE ansible.builtin.assert: that: (bigboot_lv_pe_size_in_mb[:-3] | int) >= (bigboot_expansion_diff_mb[:-3] | int) - fail_msg: Not enough PE to expand /boot. + fail_msg: Not enough PE to expand /boot. Will need to shrink target LV. rescue: - name: Set flag for Shrink_LV execution diff --git a/tasks/check_space_fallback.yml b/tasks/check_space_fallback.yml index 13a07f9..109a7ea 100644 --- a/tasks/check_space_fallback.yml +++ b/tasks/check_space_fallback.yml @@ -7,7 +7,7 @@ ansible.builtin.assert: that: bigboot_size_target_fallback | int >= bigboot_size_min | human_to_bytes fail_msg: - "{{ bigboot_size_target_fallback | int | human_readable(unit='M') }} is less than the minimum of {{ bigboot_size_min }}" + "{{ bigboot_size_target_fallback | int | human_readable(unit='M') }} is less than the minimum required size of {{ bigboot_size_min }}." - name: Verify available space and re-check if needed block: @@ -16,6 +16,16 @@ that: bigboot_lv_info['size_available'] > bigboot_expansion_diff | int fail_msg: There is not enough free space available to shrink the filesystem + - name: Debug bigboot_lv_info + ansible.builtin.debug: + msg: "{{ bigboot_lv_info['size_available'] }} -> {{ bigboot_expansion_diff }} -> {{ bigboot_lv_size_min | human_to_bytes }}" + + - name: Assert that there will be enough space left over on the target LV + ansible.builtin.assert: + that: (bigboot_lv_info['size_available'] - bigboot_expansion_diff | int) >= bigboot_lv_size_min | human_to_bytes + success_msg: "There will be enough space left over with a boot size of {{ bigboot_size_target_fallback | int | human_readable(unit='G') }}." + fail_msg: "There will NOT be enough space left over with a boot size of {{ bigboot_size_target_fallback | int | human_readable(unit='G') }}. Aborting Bigboot execution." + rescue: - name: "Decrement size target by {{ bigboot_size_decrement }}" ansible.builtin.set_fact: diff --git a/vars/bigboot_vars.yml b/vars/bigboot_vars.yml index 048b6fe..14f0f44 100644 --- a/vars/bigboot_vars.yml +++ b/vars/bigboot_vars.yml @@ -5,6 +5,8 @@ bigboot_size_target: 2G bigboot_size_min: 1G bigboot_size_decrement: 250M +bigboot_lv_size_min: 1G + # Filename of disabled services log: bigboot_disabled_services_log: /var/IPE/IPU/el7to8/bigboot_disabled_services.log