Refactored for idempotency

This commit is contained in:
Chris Hammer 2025-05-22 15:52:27 -04:00
parent e75578352f
commit 716698202d

View File

@ -34,19 +34,28 @@
success_msg: The /boot partition is already at the desired size success_msg: The /boot partition is already at the desired size
rescue: rescue:
- name: "End host if /boot is already at or above {{ bigboot_size_min }}" - name: "Check if boot is already at or above {{ bigboot_size_min }}"
ansible.builtin.fail: block:
msg: "/boot partition size is already at least {{ bigboot_size_min }} or greater. Nothing to do." - name: "Assert that /boot is already at or above {{ bigboot_size_min }}"
when: ansible.builtin.assert:
- bigboot_boot_partsize | human_to_bytes > bigboot_size_min | int that: bigboot_boot_partsize | human_to_bytes < bigboot_size_min | int
success_msg: >
/boot partition size is already at least {{ bigboot_size_min }}
or greater. Nothing to do."
fail_msg: >
/boot partition size is less than {{ bigboot_size_min }}.
Expansion of /boot is required.
- name: Set flag for Bigboot execution - name: End play for host
ansible.builtin.set_fact: ansible.builtin.meta: end_host
bigboot_execute_bigboot: true
- name: Expansion of /boot required rescue:
ansible.builtin.debug: - name: Set flag for Bigboot execution
msg: > ansible.builtin.set_fact:
Expansion of /boot is required. bigboot_execute_bigboot: true
Will attempt to increase to {{ bigboot_size_target }}, or
{{ bigboot_size_min }} at the minimum." - name: Expansion of /boot required
ansible.builtin.debug:
msg: >
Will attempt to increase to {{ bigboot_size_target }}, or
{{ bigboot_size_min }} at the minimum."