New stuff

This commit is contained in:
2025-01-08 17:20:07 -05:00
parent fa1b5cce00
commit 7a93d8d72a
4 changed files with 84 additions and 5 deletions

21
tasks/check_if_shrunk.yml Normal file
View File

@ -0,0 +1,21 @@
---
- 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.