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
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."