120 lines
4.2 KiB
YAML
120 lines
4.2 KiB
YAML
---
|
|
partitioning_luks_enabled: "{{ luks_enabled | default(false) | bool }}"
|
|
partitioning_luks_mapper_name: "{{ luks_mapper_name | default('SYSTEM_DECRYPTED') }}"
|
|
partitioning_luks_type: "{{ luks_type | default('luks2') }}"
|
|
partitioning_luks_cipher: "{{ luks_cipher | default('aes-xts-plain64') }}"
|
|
partitioning_luks_hash: "{{ luks_hash | default('sha512') }}"
|
|
partitioning_luks_iter_time: "{{ luks_iter_time | default(4000) }}"
|
|
partitioning_luks_key_size: "{{ luks_key_size | default(512) }}"
|
|
partitioning_luks_pbkdf: "{{ luks_pbkdf | default('argon2id') }}"
|
|
partitioning_luks_use_urandom: "{{ luks_use_urandom | default(true) | bool }}"
|
|
partitioning_luks_verify_passphrase: "{{ luks_verify_passphrase | default(true) | bool }}"
|
|
partitioning_luks_auto_decrypt: "{{ luks_auto_decrypt | default(true) | bool }}"
|
|
partitioning_luks_auto_decrypt_method: "{{ luks_auto_decrypt_method | default('tpm2') }}"
|
|
partitioning_luks_tpm2_device: "{{ luks_tpm2_device | default('auto') }}"
|
|
partitioning_luks_tpm2_pcrs: "{{ luks_tpm2_pcrs | default('') }}"
|
|
partitioning_luks_keyfile_size: "{{ luks_keyfile_size | default(64) }}"
|
|
partitioning_luks_options: "{{ luks_options | default('discard,tries=3') }}"
|
|
partitioning_boot_partition_suffix: 1
|
|
partitioning_main_partition_suffix: 2
|
|
partitioning_efi_size_mib: 50
|
|
partitioning_boot_size_mib: 1024
|
|
partitioning_separate_boot: >-
|
|
{{
|
|
(partitioning_luks_enabled | bool)
|
|
and (os | default('') | lower not in ['archlinux'])
|
|
}}
|
|
partitioning_boot_fs_fstype: >-
|
|
{{
|
|
(filesystem | default('') | lower)
|
|
if (filesystem | default('') | lower) != 'btrfs'
|
|
else ('xfs' if (is_rhel | default(false)) else 'ext4')
|
|
}}
|
|
partitioning_boot_fs_partition_suffix: >-
|
|
{{
|
|
((partitioning_boot_partition_suffix | int) + 1)
|
|
if (partitioning_separate_boot | bool) else ''
|
|
}}
|
|
partitioning_root_partition_suffix: >-
|
|
{{
|
|
(partitioning_main_partition_suffix | int)
|
|
+ (1 if (partitioning_separate_boot | bool) else 0)
|
|
}}
|
|
partitioning_efi_mountpoint: >-
|
|
{{
|
|
'/boot/efi'
|
|
if (partitioning_separate_boot | bool)
|
|
else (
|
|
'/boot/efi'
|
|
if (is_rhel | default(false)) or (os | default('') | lower in ['ubuntu', 'ubuntu-lts'])
|
|
else '/boot'
|
|
)
|
|
}}
|
|
partitioning_boot_end_mib: "{{ (partitioning_efi_size_mib | int) + (partitioning_boot_size_mib | int) }}"
|
|
partitioning_reserved_gb: >-
|
|
{{
|
|
(
|
|
(partitioning_efi_size_mib | float)
|
|
+ ((partitioning_boot_size_mib | float) if (partitioning_separate_boot | bool) else 0)
|
|
) / 1024
|
|
}}
|
|
partitioning_layout: >-
|
|
{{
|
|
[
|
|
{
|
|
'number': 1,
|
|
'part_end': (partitioning_efi_size_mib | string) + 'MiB',
|
|
'name': 'efi',
|
|
'flags': ['boot', 'esp']
|
|
},
|
|
{
|
|
'number': 2,
|
|
'part_start': (partitioning_efi_size_mib | string) + 'MiB',
|
|
'part_end': (partitioning_boot_end_mib | string) + 'MiB',
|
|
'name': 'boot'
|
|
},
|
|
{
|
|
'number': 3,
|
|
'part_start': (partitioning_boot_end_mib | string) + 'MiB',
|
|
'name': 'root'
|
|
}
|
|
]
|
|
if partitioning_separate_boot | bool else
|
|
[
|
|
{
|
|
'number': 1,
|
|
'part_end': (partitioning_efi_size_mib | string) + 'MiB',
|
|
'name': 'boot',
|
|
'flags': ['boot', 'esp']
|
|
},
|
|
{
|
|
'number': 2,
|
|
'part_start': (partitioning_efi_size_mib | string) + 'MiB',
|
|
'name': 'root'
|
|
}
|
|
]
|
|
}}
|
|
partitioning_grub_enable_cryptodisk: >-
|
|
{{
|
|
(partitioning_luks_enabled | bool)
|
|
and not (partitioning_separate_boot | bool)
|
|
and (partitioning_efi_mountpoint == '/boot/efi')
|
|
}}
|
|
partitioning_luks_device: "{{ install_drive ~ (partitioning_root_partition_suffix | string) }}"
|
|
partitioning_root_device: >-
|
|
{{
|
|
'/dev/mapper/' + partitioning_luks_mapper_name
|
|
if (partitioning_luks_enabled | bool)
|
|
else install_drive ~ (partitioning_root_partition_suffix | string)
|
|
}}
|
|
partitioning_vm_size_effective: "{{ (partitioning_vm_size | default(vm_size | default(0))) | float }}"
|
|
partitioning_vm_memory_effective: "{{ (partitioning_vm_memory | default(vm_memory | default(0))) | float }}"
|
|
partitioning_swap_size_gb: >-
|
|
{{
|
|
((partitioning_vm_memory_effective / 1024) >= 16.0)
|
|
| ternary(
|
|
(partitioning_vm_memory_effective / 2048) | int,
|
|
[partitioning_vm_memory_effective / 1024, 4.0] | max | int
|
|
)
|
|
}}
|