Remove defaults for required vars

This commit is contained in:
2025-12-28 17:10:00 +01:00
parent fd37b4ee96
commit 98d0a4954d
19 changed files with 136 additions and 135 deletions

View File

@@ -3,7 +3,14 @@
when: partitioning_luks_enabled | bool
vars:
configuration_luks_passphrase_effective: >-
{{ partitioning_luks_passphrase | string }}
{{
(
partitioning_luks_passphrase
if partitioning_luks_passphrase is defined
else (luks_passphrase if luks_passphrase is defined else '')
)
| string
}}
block:
- name: Set LUKS configuration facts
vars:

View File

@@ -32,7 +32,7 @@
if '.' in hostname
else (
hostname + '.' + vm_dns_search
if vm_dns_search | length
if vm_dns_search is defined and vm_dns_search | length
else hostname
)
}}
@@ -49,7 +49,7 @@
if '.' in hostname
else (
hostname + '.' + vm_dns_search
if vm_dns_search | length
if vm_dns_search is defined and vm_dns_search | length
else hostname
)
}}
@@ -57,7 +57,7 @@
configuration_hostname_entries: >-
{{ [configuration_hostname_fqdn, configuration_hostname_short] | unique | join(' ') }}
configuration_hosts_line: >-
{{ (vm_ip if vm_ip | length > 0 else inventory_hostname) }} {{ configuration_hostname_entries }}
{{ (vm_ip if vm_ip is defined and vm_ip | length > 0 else inventory_hostname) }} {{ configuration_hostname_entries }}
ansible.builtin.lineinfile:
path: /mnt/etc/hosts
line: "{{ configuration_hosts_line }}"

View File

@@ -3,7 +3,7 @@
when: is_rhel | bool
block:
- name: Fix SELinux by pre-labeling the filesystem before first boot
when: os | lower in ['almalinux', 'rhel8', 'rhel9', 'rhel10', 'rocky'] and (selinux | bool)
when: os | lower in ['almalinux', 'rhel8', 'rhel9', 'rhel10', 'rocky'] and (selinux is not defined or selinux | bool)
ansible.builtin.command: >
arch-chroot /mnt /sbin/setfiles -v -F
-e /dev -e /proc -e /sys -e /run
@@ -12,7 +12,7 @@
changed_when: configuration_setfiles_result.rc == 0
- name: Disable SELinux
when: os | lower == "fedora" or not (selinux | bool)
when: os | lower == "fedora" or (selinux is defined and not (selinux | bool))
ansible.builtin.lineinfile:
path: /mnt/etc/selinux/config
regexp: ^SELINUX=