From 8b1e65188c0753feab340a37432b853f1cd93168 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Tue, 3 Jun 2025 10:15:28 -0400 Subject: [PATCH] Tweaks --- tasks/capture_lv_device_details.yml | 7 +++++++ tasks/check_space_fallback.yml | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tasks/capture_lv_device_details.yml b/tasks/capture_lv_device_details.yml index 3510466..bc6034d 100644 --- a/tasks/capture_lv_device_details.yml +++ b/tasks/capture_lv_device_details.yml @@ -59,6 +59,13 @@ bigboot_lv_shrink_size: "{{ bigboot_lv_info['size_total'] - bigboot_expansion_diff | int }}" bigboot_size_target_fallback: "{{ bigboot_size_target_fallback | int | human_readable(unit='G') | regex_replace('\\sGB', 'G') }}" +- name: Debug bigboot_lv_shrink_size and bigboot_size_target_fallback + ansible.builtin.debug: + msg: "{{ bigboot_lv_shrink_size | int | human_readable(unit='G') }} <-> {{ bigboot_size_target_fallback }}" + +- name: Kill the play + ansible.builtin.meta: end_host + - name: Capture logical volume name ansible.builtin.shell: cmd: | diff --git a/tasks/check_space_fallback.yml b/tasks/check_space_fallback.yml index 53a2f1a..bfab898 100644 --- a/tasks/check_space_fallback.yml +++ b/tasks/check_space_fallback.yml @@ -16,14 +16,10 @@ 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_info['size_available'] - bigboot_expansion_diff | int) }} -> {{ 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') }}. ({{ (bigboot_lv_info['size_available'] - bigboot_expansion_diff | int) | human_readable(unit='M') }})" + success_msg: "There will be enough space left over with a boot size of {{ bigboot_size_target_fallback | int | human_readable(unit='G') }}. ({{ (bigboot_lv_info['size_available'] - bigboot_expansion_diff | int) | human_readable(unit='B') }})" 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: