Enable full-disk LVM root sizing

This commit is contained in:
2026-01-02 16:08:36 +01:00
parent 90cc9add01
commit 396d802dc3
3 changed files with 30 additions and 2 deletions

View File

@@ -129,6 +129,7 @@ Use these only when you need to override the default layout logic.
| `partitioning_boot_size_mib` | `/boot` size in MiB when a separate boot is used. | `1024` | | `partitioning_boot_size_mib` | `/boot` size in MiB when a separate boot is used. | `1024` |
| `partitioning_separate_boot` | Force a separate `/boot` partition. | `true` | | `partitioning_separate_boot` | Force a separate `/boot` partition. | `true` |
| `partitioning_boot_fs_fstype` | Filesystem for `/boot` when separate. | `ext4` | | `partitioning_boot_fs_fstype` | Filesystem for `/boot` when separate. | `ext4` |
| `partitioning_use_full_disk` | Use remaining LVM space for the root volume. | `true` |
To protect sensitive information, such as passwords, API keys, and other confidential variables (e.g., `hypervisor_password`), **it is recommended to use Ansible Vault**. To protect sensitive information, such as passwords, API keys, and other confidential variables (e.g., `hypervisor_password`), **it is recommended to use Ansible Vault**.

View File

@@ -22,6 +22,7 @@ partitioning_efi_size_mib: 512
partitioning_efi_start_mib: 1 partitioning_efi_start_mib: 1
partitioning_efi_end_mib: "{{ (partitioning_efi_start_mib | int) + (partitioning_efi_size_mib | int) }}" partitioning_efi_end_mib: "{{ (partitioning_efi_start_mib | int) + (partitioning_efi_size_mib | int) }}"
partitioning_boot_size_mib: 1024 partitioning_boot_size_mib: 1024
partitioning_use_full_disk: true
partitioning_separate_boot: >- partitioning_separate_boot: >-
{{ {{
(partitioning_luks_enabled | bool) (partitioning_luks_enabled | bool)

View File

@@ -278,7 +278,11 @@
- partitioning_lvm_swap_target_gb - partitioning_lvm_swap_target_gb
) | float ) | float
}} }}
partitioning_lvm_root_gb: >- partitioning_lvm_home_gb: >-
{{
([([(((partitioning_vm_size_effective | float) - 20) * 0.1), 2] | max), 20] | min)
}}
partitioning_lvm_root_default_gb: >-
{{ {{
[ [
( (
@@ -310,6 +314,28 @@
partitioning_lvm_swap_target_gb partitioning_lvm_swap_target_gb
) )
}} }}
partitioning_lvm_root_full_gb: >-
{{
[
(
(partitioning_vm_size_effective | float)
- (partitioning_reserved_gb | float)
- (partitioning_lvm_swap_gb | float)
- (
(partitioning_lvm_home_gb | float) + 5.5
if cis_enabled
else 0
)
),
4
] | max | round(2, 'floor')
}}
partitioning_lvm_root_gb: >-
{{
partitioning_lvm_root_full_gb
if partitioning_use_full_disk | bool
else partitioning_lvm_root_default_gb
}}
community.general.lvol: community.general.lvol:
vg: sys vg: sys
lv: "{{ item.lv }}" lv: "{{ item.lv }}"
@@ -321,7 +347,7 @@
- lv: swap - lv: swap
size: "{{ partitioning_lvm_swap_gb | string + 'G' }}" size: "{{ partitioning_lvm_swap_gb | string + 'G' }}"
- lv: home - lv: home
size: "{{ ([([(((partitioning_vm_size_effective | float) - 20) * 0.1), 2] | max), 20] | min) | string + 'G' }}" size: "{{ partitioning_lvm_home_gb | string + 'G' }}"
- {lv: var, size: "2G"} - {lv: var, size: "2G"}
- {lv: var_log, size: "2G"} - {lv: var_log, size: "2G"}
- {lv: var_log_audit, size: "1.5G"} - {lv: var_log_audit, size: "1.5G"}