feat(expand_root_lv): new role to grow root LV to fill VG + resize fs

Reclaims the half-disk LV left by the Ubuntu Server autoinstall
template default. Idempotent — no-ops cleanly when there are no free PE
in the VG, and exits the play cleanly on hosts without LVM.

Supports ext4 and xfs. Does not handle partition resize (cloud-utils
growpart) — out of scope for the template fix-up case.

Wired into day1_deploy_honcho.yml ahead of the honcho role so newly
provisioned VMs get the fix-up automatically. Suitable to add to any
day1 playbook by simply listing it before the application role.
This commit is contained in:
JARVIS
2026-05-30 23:03:10 -05:00
parent 4d7766d1b1
commit 9ed7466fd8
5 changed files with 186 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
---
# ============================================================================
# expand-root-lv role defaults
# ============================================================================
# Extends the root LVM logical volume to fill its volume group, then grows
# the underlying filesystem to match. Idempotent: when there's no free PE
# in the VG (i.e. the LV already fills the VG), the lvextend step is a
# no-op and resize2fs/xfs_growfs simply confirms the filesystem is at
# capacity.
#
# Designed for Ubuntu cloud-image-style installations where the autoinstall
# template provisions an LV at half the disk size (the Ubuntu Server
# installer's longstanding default). Run once after VM provisioning to
# reclaim the unallocated PE; safe to leave in a day1 playbook so future
# disk expansions are picked up automatically.
# ============================================================================
# The LV and VG names follow the Ubuntu Server installer's convention.
# Override per-host if your template differs.
expand_root_lv_vg_name: ubuntu-vg
expand_root_lv_lv_name: ubuntu-lv
# Mount point we expect to be backed by the target LV. Used purely for
# the resize2fs / xfs_growfs decision — the role inspects this path's
# filesystem type and dispatches to the correct grow command.
expand_root_lv_mountpoint: /