137 lines
4.1 KiB
YAML
137 lines
4.1 KiB
YAML
---
|
|
partitioning_luks_enabled: "{{ luks_enabled | bool }}"
|
|
partitioning_luks_passphrase: "{{ luks_passphrase }}"
|
|
partitioning_luks_mapper_name: "{{ luks_mapper_name }}"
|
|
partitioning_luks_type: "{{ luks_type }}"
|
|
partitioning_luks_cipher: "{{ luks_cipher }}"
|
|
partitioning_luks_hash: "{{ luks_hash }}"
|
|
partitioning_luks_iter_time: "{{ luks_iter_time }}"
|
|
partitioning_luks_key_size: "{{ luks_key_size }}"
|
|
partitioning_luks_pbkdf: "{{ luks_pbkdf }}"
|
|
partitioning_luks_use_urandom: "{{ luks_use_urandom | bool }}"
|
|
partitioning_luks_verify_passphrase: "{{ luks_verify_passphrase | bool }}"
|
|
partitioning_luks_auto_decrypt: "{{ luks_auto_decrypt | bool }}"
|
|
partitioning_luks_auto_decrypt_method: "{{ luks_auto_decrypt_method }}"
|
|
partitioning_luks_tpm2_device: "{{ luks_tpm2_device }}"
|
|
partitioning_luks_tpm2_pcrs: "{{ luks_tpm2_pcrs }}"
|
|
partitioning_luks_keyfile_size: "{{ luks_keyfile_size }}"
|
|
partitioning_luks_options: "{{ luks_options }}"
|
|
partitioning_boot_partition_suffix: 1
|
|
partitioning_main_partition_suffix: 2
|
|
partitioning_efi_size_mib: 512
|
|
partitioning_boot_size_mib: 1024
|
|
partitioning_separate_boot: >-
|
|
{{
|
|
(partitioning_luks_enabled | bool)
|
|
and (os | lower not in ['archlinux'])
|
|
}}
|
|
partitioning_boot_fs_fstype: >-
|
|
{{
|
|
(filesystem | lower)
|
|
if (filesystem | lower) != 'btrfs'
|
|
else ('xfs' if is_rhel 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 or (os | 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
|
|
if (partitioning_vm_size is defined and (partitioning_vm_size | float) > 0)
|
|
else (vm_size if vm_size is defined else 0)
|
|
)
|
|
| float
|
|
}}
|
|
partitioning_vm_memory_effective: >-
|
|
{{
|
|
(
|
|
partitioning_vm_memory
|
|
if (partitioning_vm_memory is defined and (partitioning_vm_memory | float) > 0)
|
|
else (vm_memory if vm_memory is defined else 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
|
|
)
|
|
}}
|