more fix: dont select swap when capturing the adjacent lv
This commit is contained in:
parent
251eab2918
commit
6d19ec0fa6
@ -33,7 +33,7 @@
|
|||||||
- name: Expand the logical volume to support /boot expansion
|
- name: Expand the logical volume to support /boot expansion
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg:
|
msg:
|
||||||
- "device: {{ bigboot_adjacent_lvm_device | trim }}"
|
- "device: {{ bigboot_adjacent_lvm_device }}"
|
||||||
- "size : {{ bigboot_lv_shrink_size | int }}"
|
- "size : {{ bigboot_lv_shrink_size | int }}"
|
||||||
when:
|
when:
|
||||||
- bigboot_execute_shrink_lv | bool
|
- bigboot_execute_shrink_lv | bool
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
name: infra.lvm_snapshots.shrink_lv
|
name: infra.lvm_snapshots.shrink_lv
|
||||||
vars:
|
vars:
|
||||||
shrink_lv_devices:
|
shrink_lv_devices:
|
||||||
- device: "{{ bigboot_adjacent_lvm_device | trim }}"
|
- device: "{{ bigboot_adjacent_lvm_device }}"
|
||||||
size: "{{ bigboot_lv_shrink_size | int }}"
|
size: "{{ bigboot_lv_shrink_size | int }}"
|
||||||
when:
|
when:
|
||||||
- bigboot_execute_shrink_lv | bool
|
- bigboot_execute_shrink_lv | bool
|
||||||
|
@ -3,19 +3,19 @@
|
|||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: |
|
cmd: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
lsblk -p -o name,type | grep -vi swap | grep lvm | head -1
|
lsblk -pl -o name,type,mountpoint | grep -vi swap | grep lvm | head -1 | awk '{ print $1}'
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: bigboot_adjacent_lvm
|
register: bigboot_adjacent_lvm
|
||||||
|
|
||||||
- name: Set adjacent LVM device name
|
- name: Set adjacent LVM device name
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
bigboot_adjacent_lvm_device: "{{ bigboot_adjacent_lvm.stdout | regex_replace('.*(/dev.*)\\s+.*$', '\\1') }}"
|
bigboot_adjacent_lvm_device: "{{ bigboot_adjacent_lvm.stdout }}"
|
||||||
|
|
||||||
- name: Get logical volume mount information
|
- name: Get logical volume mount information
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
bigboot_lv_info: "{{ ansible_facts.mounts \
|
bigboot_lv_info: "{{ ansible_facts.mounts \
|
||||||
| selectattr('device', 'equalto', bigboot_adjacent_lvm_device | trim) | first }}"
|
| selectattr('device', 'equalto', bigboot_adjacent_lvm_device) | first }}"
|
||||||
|
|
||||||
- name: Assert that there is space on the logical volume for shrinkage
|
- name: Assert that there is space on the logical volume for shrinkage
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user