fixes for boot partition sizes
All checks were successful
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-centos9) (push) Successful in 15s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-debian11) (push) Successful in 13s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-debian12) (push) Successful in 14s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora39) (push) Successful in 15s
All checks were successful
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-centos9) (push) Successful in 15s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-debian11) (push) Successful in 13s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-debian12) (push) Successful in 14s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora39) (push) Successful in 15s
This commit is contained in:
parent
8b45733501
commit
4b49a24665
@ -14,3 +14,5 @@
|
||||
- name: Expand the /boot partition as requested
|
||||
ansible.builtin.import_role:
|
||||
name: infra.lvm_snapshots.bigboot
|
||||
vars:
|
||||
bigboot_size: "{{ bigboot_size_target }}"
|
||||
|
@ -56,7 +56,7 @@
|
||||
ansible.builtin.set_fact:
|
||||
bigboot_lv_size_in_mb:
|
||||
"{{ bigboot_lv_vg_free_pe | regex_replace('i|\\s+|<', '') | human_to_bytes | human_readable(unit='M') }}"
|
||||
bigboot_size_in_mb: "{{ bigboot_size[:-1] }}"
|
||||
bigboot_size_in_mb: "{{ bigboot_size_target[:-1] }}"
|
||||
|
||||
- name: Check if we can shrink the logical volume
|
||||
block:
|
||||
@ -70,7 +70,7 @@
|
||||
rescue:
|
||||
- name: Assert there is free space available for shrinking
|
||||
ansible.builtin.assert:
|
||||
that: (bigboot_lv_info.size_available - bigboot_size | human_to_bytes) >= 0
|
||||
that: (bigboot_lv_info.size_available - bigboot_size_target | human_to_bytes) >= 0
|
||||
fail_msg: "Not enough space available on {{ bigboot_adjacent_lvm_device | trim }} for shrinking."
|
||||
|
||||
- name: Execute Shrink_LV role to resize target logical volume
|
||||
|
@ -1,13 +1,21 @@
|
||||
---
|
||||
- name: Get /boot mount information
|
||||
ansible.builtin.set_fact:
|
||||
bigboot_boot_info: "{{ ansible_facts.mounts \
|
||||
bigboot_boot_mount: "{{ ansible_facts.mounts \
|
||||
| selectattr('mount', 'equalto', '/boot') | first }}"
|
||||
|
||||
- name: Capture device for /boot
|
||||
ansible.builtin.set_fact:
|
||||
bigboot_boot_device: "{{ bigboot_boot_mount.device | regex_replace('^.*/(\\w+$)', '\\1') }}"
|
||||
|
||||
- name: Capture partition side for /boot parition
|
||||
ansible.builtin.set_fact:
|
||||
bigboot_boot_partsize: "{{ ansible_devices[bigboot_boot_device[:-1]].partitions[bigboot_boot_device].size }}"
|
||||
|
||||
- name: Capture required expansion space
|
||||
ansible.builtin.set_fact:
|
||||
bigboot_expansion_diff:
|
||||
"{{ bigboot_size | human_to_bytes - bigboot_boot_info.size_total | int }}"
|
||||
"{{ bigboot_size | human_to_bytes - bigboot_boot_partsize | human_to_bytes }}"
|
||||
|
||||
- name: Convert size difference to MB
|
||||
ansible.builtin.set_fact:
|
||||
@ -15,7 +23,7 @@
|
||||
|
||||
- name: Set bigboot size 4k aligned
|
||||
ansible.builtin.set_fact:
|
||||
bigboot_size: "{{ bigboot_size_expansion_mb[:-2] \
|
||||
bigboot_size_target: "{{ bigboot_size_expansion_mb[:-2] \
|
||||
| regex_replace('\\.\\d+ ', '') \
|
||||
| int | get_block_size_up }}"
|
||||
|
||||
@ -33,4 +41,4 @@
|
||||
rescue:
|
||||
- name: Expansion of /boot required
|
||||
ansible.builtin.debug:
|
||||
msg: "Expanding /boot by an additional {{ bigboot_size }}."
|
||||
msg: "Expanding /boot by an additional {{ bigboot_size_target }}."
|
||||
|
Loading…
x
Reference in New Issue
Block a user