quick_test/tasks/check_if_shrunk.yml
2025-01-08 17:20:07 -05:00

22 lines
701 B
YAML

---
- name: Debug item
ansible.builtin.debug:
var: item
- name: Set device for mount
ansible.builtin.set_fact:
size_three: "{{ ansible_facts['mounts'] | selectattr('device', 'equalto', item['device']) | first }}"
- name: Debug size_three
ansible.builtin.debug:
var: size_three['size_total']
- name: Assert that the filesystem has shrunk
ansible.builtin.assert:
# yamllint disable-line rule:line-length
that: (size_three['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.