Calculate PE size, and subtract from the shrink size; Attempts to fix allocation/pretending size issue
This commit is contained in:
parent
23c7547f32
commit
f39fea0f89
@ -73,9 +73,6 @@
|
|||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ bigboot_lv_shrink_size | int | human_readable(unit='G') }} ({{ bigboot_lv_shrink_size | int | human_readable(unit='M') | regex_replace('\\.\\d+\\s+MB') | int | get_block_size_down }}) <-> {{ bigboot_size_target_fallback }} | {{ bigboot_expansion_diff }}"
|
msg: "{{ bigboot_lv_shrink_size | int | human_readable(unit='G') }} ({{ bigboot_lv_shrink_size | int | human_readable(unit='M') | regex_replace('\\.\\d+\\s+MB') | int | get_block_size_down }}) <-> {{ bigboot_size_target_fallback }} | {{ bigboot_expansion_diff }}"
|
||||||
|
|
||||||
# - name: Kill the play
|
|
||||||
# ansible.builtin.meta: end_host
|
|
||||||
|
|
||||||
- name: Capture logical volume name
|
- name: Capture logical volume name
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: |
|
cmd: |
|
||||||
@ -98,6 +95,26 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
register: bigboot_lv_vg_free_pe
|
register: bigboot_lv_vg_free_pe
|
||||||
|
|
||||||
|
- name: Capture volume group PE size
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: |
|
||||||
|
set -o pipefail
|
||||||
|
vgdisplay {{ bigboot_lv_vg_name | trim }} | grep -i 'pe size'
|
||||||
|
executable: /bin/bash
|
||||||
|
changed_when: false
|
||||||
|
register: bigboot_lv_vg_pe_capture
|
||||||
|
|
||||||
|
- name: Set PE size
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
bigboot_lv_vg_pe_size: "{{ bigboot_lv_vg_pe_capture | regex_replace('^.*\\s+(\\d+.\\d+).*$', '\\1M') | human_to_bytes }}"
|
||||||
|
|
||||||
|
- name: Subtract one additional PE for shrinking
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
bigboot_lv_shrink_size: "{{ bigboot_lv_shrink_size | int - bigboot_lv_vg_pe_size | int }}"
|
||||||
|
|
||||||
|
# - name: Kill the play
|
||||||
|
# ansible.builtin.meta: end_host
|
||||||
|
|
||||||
- name: Capture the PV device
|
- name: Capture the PV device
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
bigboot_pv: "{{ bigboot_boot_mount['device'][:-1] }}{{ bigboot_boot_mount['device'][-1:] | int + 1 }}"
|
bigboot_pv: "{{ bigboot_boot_mount['device'][:-1] }}{{ bigboot_boot_mount['device'][-1:] | int + 1 }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user