New stuff
This commit is contained in:
21
tasks/check_if_shrunk.yml
Normal file
21
tasks/check_if_shrunk.yml
Normal 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.
|
Reference in New Issue
Block a user