diff --git a/tasks/capture_boot_device_details.yml b/tasks/capture_boot_device_details.yml index 72a67ba..0df887f 100644 --- a/tasks/capture_boot_device_details.yml +++ b/tasks/capture_boot_device_details.yml @@ -34,19 +34,28 @@ success_msg: The /boot partition is already at the desired size rescue: - - name: "End host if /boot is already at or above {{ bigboot_size_min }}" - ansible.builtin.fail: - msg: "/boot partition size is already at least {{ bigboot_size_min }} or greater. Nothing to do." - when: - - bigboot_boot_partsize | human_to_bytes > bigboot_size_min | int + - name: "Check if boot is already at or above {{ bigboot_size_min }}" + block: + - name: "Assert that /boot is already at or above {{ bigboot_size_min }}" + ansible.builtin.assert: + 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 - ansible.builtin.set_fact: - bigboot_execute_bigboot: true + - name: End play for host + ansible.builtin.meta: end_host - - name: Expansion of /boot required - ansible.builtin.debug: - msg: > - Expansion of /boot is required. - Will attempt to increase to {{ bigboot_size_target }}, or - {{ bigboot_size_min }} at the minimum." + rescue: + - name: Set flag for Bigboot execution + ansible.builtin.set_fact: + bigboot_execute_bigboot: true + + - name: Expansion of /boot required + ansible.builtin.debug: + msg: > + Will attempt to increase to {{ bigboot_size_target }}, or + {{ bigboot_size_min }} at the minimum."