---
- name: Set device for mount
  ansible.builtin.set_fact:
    shrink_lv_set_device: "{{ ansible_facts['mounts'] | selectattr('device', 'equalto', item['device']) | first }}"

- name: Assert that the filesystem has shrunk
  ansible.builtin.assert:
    that: (shrink_lv_set_device['size_total'] | int) <= (item['size'] | ansible.builtin.human_to_bytes)
    fail_msg: >
      Logical Volume {{ item['device'] }} was NOT shrunk as requested.
    success_msg: >
      Logical Volume {{ item['device'] }} has been shrunk as requested.
