The half-disk LV pattern affects ~90% of mk-labs VMs. Treating the
fix-up as application-specific (as it was in day1_deploy_honcho.yml)
means future deploys would each carry the same boilerplate, and any
day1 author could forget it.
This commit:
* Adds playbooks/day0_expand_root_lv.yml — standalone day0 step,
targets {{ target | default("all") }}, honors a per-host
expand_root_lv_skip opt-out for multi-LV layouts.
* Adds playbooks/day0_provision.yml — umbrella playbook chaining
day0_linux_baseline + day0_expand_root_lv, so the operator runs
ONE command per new VM.
* Removes expand_root_lv from day1_deploy_honcho.yml — day0 is
assumed complete before day1 begins (cleaner separation of
concerns, matches the convention day1_deploy_semaphore already
follows).
* Updates the role README to document the lifecycle position and
the opt-out flag for hosts with multi-LV plans.
33 lines
1.4 KiB
YAML
33 lines
1.4 KiB
YAML
---
|
|
# ============================================================================
|
|
# day0_expand_root_lv.yml
|
|
# ----------------------------------------------------------------------------
|
|
# Reclaims unallocated PE on the root volume group, extending the root LV
|
|
# to fill the VG and resizing the underlying filesystem (ext4 or xfs).
|
|
#
|
|
# Belongs to the day0 host-provisioning lifecycle. The Ubuntu Server
|
|
# autoinstall template ships with the root LV at ~half the disk size by
|
|
# default; this playbook is the canonical one-shot fix-up for that.
|
|
#
|
|
# Idempotent and safe to re-run. Hosts without LVM are no-op'd cleanly.
|
|
#
|
|
# Opt-out: set `expand_root_lv_skip: true` in host_vars/<host>.yml for
|
|
# hosts where free PE should NOT be claimed by root (e.g. hosts with a
|
|
# planned second LV in the same VG for application data).
|
|
#
|
|
# Usage:
|
|
# ansible-playbook playbooks/day0_expand_root_lv.yml
|
|
# ansible-playbook playbooks/day0_expand_root_lv.yml -e target=lincoln
|
|
# ansible-playbook playbooks/day0_expand_root_lv.yml -e target=honcho_server
|
|
# ============================================================================
|
|
|
|
- name: Expand root logical volume to fill VG
|
|
hosts: "{{ target | default('all') }}"
|
|
become: true
|
|
gather_facts: true
|
|
tasks:
|
|
- name: Apply expand_root_lv role unless host opts out
|
|
ansible.builtin.include_role:
|
|
name: expand_root_lv
|
|
when: not (expand_root_lv_skip | default(false) | bool)
|