Refactor boot and LV code
All checks were successful
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-centos9) (push) Successful in 16s
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 13s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora39) (push) Successful in 15s

This commit is contained in:
2024-02-17 22:44:30 -05:00
parent a39826b49b
commit 8eec5d34d4
4 changed files with 18 additions and 74 deletions

View File

@ -12,9 +12,9 @@
ansible.builtin.set_fact:
bigboot_boot_partsize: "{{ ansible_devices[bigboot_boot_device[:-1]].partitions[bigboot_boot_device].size }}"
- name: Debug bigboot_boot_partsize
- name: Display current parition size for /boot
ansible.builtin.debug:
var: bigboot_boot_partsize
msg: "/boot ({{ bigboot_boot_mount.device }}): {{ bigboot_boot_partsize }}"
- name: Capture required expansion space
ansible.builtin.set_fact:
@ -22,22 +22,13 @@
"{{ bigboot_size | human_to_bytes - bigboot_boot_partsize | human_to_bytes }}"
no_log: false
- name: Debug bigboot_expansion_diff
ansible.builtin.debug:
var: bigboot_expansion_diff
- name: Boo
ansible.builtin.meta: end_host
- name: Convert size difference to MB
ansible.builtin.set_fact:
bigboot_size_expansion_mb: "{{ bigboot_expansion_diff | int | human_readable(unit='M') }}"
- name: Set bigboot size 4k aligned
ansible.builtin.set_fact:
bigboot_size_target: "{{ bigboot_size_expansion_mb[:-2] \
| regex_replace('\\.\\d+ ', '') \
| int | get_block_size_up }}"
bigboot_size_target: "{{ bigboot_size_expansion_mb[:-2] | int | get_block_size_up }}"
- name: Validate if we need to expand boot
block:
@ -53,4 +44,4 @@
rescue:
- name: Expansion of /boot required
ansible.builtin.debug:
msg: "Expanding /boot by an additional {{ bigboot_size_target }}."
msg: "Will need to expand /boot by an additional {{ bigboot_size_target }}."