Sync with Develop #7
@ -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.
|
@ -2,10 +2,10 @@
|
||||
- name: Make sure the required facts are available
|
||||
ansible.builtin.setup:
|
||||
gather_subset:
|
||||
- "!all"
|
||||
- "!min"
|
||||
- kernel
|
||||
- mounts
|
||||
- "!all"
|
||||
- "!min"
|
||||
- kernel
|
||||
- mounts
|
||||
|
||||
- name: Run preflight checks
|
||||
ansible.builtin.include_tasks: preflight.yaml
|
||||
@ -16,8 +16,8 @@
|
||||
dest: /usr/lib/dracut/modules.d/99shrink_lv/
|
||||
mode: "0554"
|
||||
loop:
|
||||
- module-setup.sh
|
||||
- shrink.sh
|
||||
- module-setup.sh
|
||||
- shrink.sh
|
||||
|
||||
- name: Resolve and copy the shrink-start script
|
||||
ansible.builtin.template:
|
||||
@ -39,16 +39,10 @@
|
||||
- name: Retrieve mount points
|
||||
ansible.builtin.setup:
|
||||
gather_subset:
|
||||
- "!all"
|
||||
- "!min"
|
||||
- mounts
|
||||
- "!all"
|
||||
- "!min"
|
||||
- mounts
|
||||
|
||||
- name: Assert that the filesystem has shrunk
|
||||
ansible.builtin.assert:
|
||||
# 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.
|
||||
- name: Check if device has shrunken successfully
|
||||
ansible.builtin.include_tasks: check_if_shrunk.yml
|
||||
loop: "{{ shrink_lv_devices }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user