This commit is contained in:
Chris Hammer 2025-06-03 10:15:28 -04:00
parent 68140fc346
commit 8b1e65188c
2 changed files with 8 additions and 5 deletions

View File

@ -59,6 +59,13 @@
bigboot_lv_shrink_size: "{{ bigboot_lv_info['size_total'] - bigboot_expansion_diff | int }}" 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') }}" 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 - name: Capture logical volume name
ansible.builtin.shell: ansible.builtin.shell:
cmd: | cmd: |

View File

@ -16,14 +16,10 @@
that: bigboot_lv_info['size_available'] > bigboot_expansion_diff | int that: bigboot_lv_info['size_available'] > bigboot_expansion_diff | int
fail_msg: There is not enough free space available to shrink the filesystem 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 - name: Assert that there will be enough space left over on the target LV
ansible.builtin.assert: ansible.builtin.assert:
that: (bigboot_lv_info['size_available'] - bigboot_expansion_diff | int) >= bigboot_lv_size_min | human_to_bytes 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." 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: rescue: