Finalize development of shrink_lv fix; Testing
This commit is contained in:
parent
078da59120
commit
0606ff81b2
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
- 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:
|
||||||
|
# yamllint disable-line rule:line-length
|
||||||
|
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.
|
@ -43,12 +43,6 @@
|
|||||||
- "!min"
|
- "!min"
|
||||||
- mounts
|
- mounts
|
||||||
|
|
||||||
- name: Assert that the filesystem has shrunk
|
- name: Check if device has shrunken successfully
|
||||||
ansible.builtin.assert:
|
ansible.builtin.include_tasks: check_if_shrunk.yml
|
||||||
# yamllint disable-line rule:line-length
|
|
||||||
that: (ansible_facts.mounts | selectattr('device', 'equalto', item.device) | map(attribute='size_total') | join | int) <= (item.size | ansible.builtin.human_to_bytes)
|
|
||||||
fail_msg: >
|
|
||||||
Logical Volume {{ item.device }} was not shrunk to {{ item.size }} as requested
|
|
||||||
success_msg: >
|
|
||||||
Logical Volume {{ item.device }} has been shrunk to {{ item.size }} as requested.
|
|
||||||
loop: "{{ shrink_lv_devices }}"
|
loop: "{{ shrink_lv_devices }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user