---
- name: Shrink logical volumes
  hosts: bigboot
  become: false
  gather_facts: true

  vars:
    bigboot_target_size: "{{ bigboot_size }}"

  tasks:
    - name: Capture boot device details
      ansible.builtin.import_tasks: tasks/capture_boot_device_details.yml

    - name: Shrink a logical volume for /boot expansion if needed
      ansible.builtin.import_tasks: tasks/bigboot_manage_lv.yml

    - name: Expand the /boot partition as requested
      ansible.builtin.import_role:
        name: infra.lvm_snapshots.bigboot
      vars:
        bigboot_size: "{{ bigboot_size_target }}"
