--- # ============================================================================ # 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/.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)