From 16eed5fec5d25884e9cc17b08a512394320bfd50 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Thu, 15 May 2025 17:21:50 -0400 Subject: [PATCH] Refinements --- tasks/capture_boot_device_details.yml | 2 +- tasks/capture_lv_device_details.yml | 5 ----- tasks/check_space_fallback.yml | 11 ++++++----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/tasks/capture_boot_device_details.yml b/tasks/capture_boot_device_details.yml index 3cdc006..c7f8f10 100644 --- a/tasks/capture_boot_device_details.yml +++ b/tasks/capture_boot_device_details.yml @@ -43,4 +43,4 @@ msg: > Expansion of /boot is required. Will attempt to increase to {{ bigboot_size_target }}, or - {{ bigboot_size_min }} at the least." + {{ bigboot_size_min }} at the minimum." diff --git a/tasks/capture_lv_device_details.yml b/tasks/capture_lv_device_details.yml index 9ceafa5..580de93 100644 --- a/tasks/capture_lv_device_details.yml +++ b/tasks/capture_lv_device_details.yml @@ -106,11 +106,6 @@ bigboot_execute_shrink_lv: false bigboot_expansion_diff_mb: "{{ bigboot_expansion_diff | int | human_readable(unit='M') }}" - - name: Debug even more sizes - ansible.builtin.debug: - msg: "{{ bigboot_lv_pe_size_in_mb[:-3] | int }} <-> {{ bigboot_expansion_diff_mb[:-3] | int }}" - - - 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) diff --git a/tasks/check_space_fallback.yml b/tasks/check_space_fallback.yml index 8e58962..822aa47 100644 --- a/tasks/check_space_fallback.yml +++ b/tasks/check_space_fallback.yml @@ -1,12 +1,13 @@ --- - name: Debug bigboot_expansion_diff ansible.builtin.debug: - msg: "{{ bigboot_expansion_diff }} + {{ bigboot_size_target_fallback }}" + msg: "{{ bigboot_expansion_diff }} + {{ bigboot_size_target_fallback }} <-> {{ bigboot_boot_partsize }}" - name: Fail if /boot can't expand to at least 1GB ansible.builtin.assert: - that: bigboot_size_target_fallback | human_to_bytes >= bigboot_size_min | human_to_bytes - fail_msg: "{{ bigboot_size_target_fallback | int | human_readable(unit='M') }} is less than the minimum of 1GB for /boot" + 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 }}" - name: Verify available space and re-check if needed block: @@ -18,12 +19,12 @@ rescue: - name: Decrement size target by .25G ansible.builtin.set_fact: - bigboot_size_target_fallback: "{{ bigboot_size_target_fallback | human_to_bytes - bigboot_size_decrement | human_to_bytes }}" + bigboot_size_target_fallback: "{{ bigboot_size_target_fallback | int - bigboot_size_decrement | human_to_bytes }}" - name: Update required expansion space ansible.builtin.set_fact: bigboot_expansion_diff: - "{{ (bigboot_size_target_fallback | human_to_bytes - bigboot_boot_partsize | human_to_bytes) }}" + "{{ (bigboot_size_target_fallback | int - bigboot_boot_partsize | human_to_bytes) }}" - name: Re-check disk space - RESCUE ansible.builtin.include_tasks: check_space_fallback.yml