Guardrails to ensure we dont run target LV out of space; minor tweaks
This commit is contained in:
parent
37d44db328
commit
d0caf12112
@ -109,7 +109,7 @@
|
|||||||
- name: Assert if we need to shrink the logical volume to gain PE
|
- name: Assert if we need to shrink the logical volume to gain PE
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: (bigboot_lv_pe_size_in_mb[:-3] | int) >= (bigboot_expansion_diff_mb[:-3] | int)
|
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:
|
rescue:
|
||||||
- name: Set flag for Shrink_LV execution
|
- name: Set flag for Shrink_LV execution
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: bigboot_size_target_fallback | int >= bigboot_size_min | human_to_bytes
|
that: bigboot_size_target_fallback | int >= bigboot_size_min | human_to_bytes
|
||||||
fail_msg:
|
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
|
- name: Verify available space and re-check if needed
|
||||||
block:
|
block:
|
||||||
@ -16,6 +16,16 @@
|
|||||||
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_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:
|
rescue:
|
||||||
- name: "Decrement size target by {{ bigboot_size_decrement }}"
|
- name: "Decrement size target by {{ bigboot_size_decrement }}"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
@ -5,6 +5,8 @@ bigboot_size_target: 2G
|
|||||||
bigboot_size_min: 1G
|
bigboot_size_min: 1G
|
||||||
bigboot_size_decrement: 250M
|
bigboot_size_decrement: 250M
|
||||||
|
|
||||||
|
bigboot_lv_size_min: 1G
|
||||||
|
|
||||||
# Filename of disabled services log:
|
# Filename of disabled services log:
|
||||||
bigboot_disabled_services_log: /var/IPE/IPU/el7to8/bigboot_disabled_services.log
|
bigboot_disabled_services_log: /var/IPE/IPU/el7to8/bigboot_disabled_services.log
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user