From d90144d2190009f8bd121cb8f773a9209500f034 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 1 Jan 2022 20:19:56 +0100 Subject: in-place variable cooking --- roles/installer/debian/iso/tasks/main.yml | 2 +- roles/installer/debian/iso/templates/grub.cfg.j2 | 2 +- .../installer/debian/iso/templates/isolinux.cfg.j2 | 2 +- .../debian/preseed/templates/partman_config.j2 | 14 +++---- .../preseed/templates/partman_early-command.sh.j2 | 10 ++--- .../templates/preseed_debian-bullseye.cfg.j2 | 14 +++---- .../preseed/templates/preseed_debian-buster.cfg.j2 | 14 +++---- .../preseed/templates/preseed_debian-jessie.cfg.j2 | 14 +++---- .../templates/preseed_debian-stretch.cfg.j2 | 14 +++---- .../preseed/templates/preseed_ubuntu-bionic.cfg.j2 | 16 ++++---- .../preseed/templates/preseed_ubuntu-focal.cfg.j2 | 16 ++++---- .../preseed/templates/preseed_ubuntu-xenial.cfg.j2 | 16 ++++---- roles/installer/debian/usb/tasks/main.yml | 2 +- .../installer/debian/usb/templates/syslinux.cfg.j2 | 2 +- .../autoinstall/templates/auto_install.conf.j2 | 12 +++--- .../autoinstall/templates/autoinstall.yml.j2 | 48 +++++++++++----------- roles/installer/ubuntu/iso/tasks/main.yml | 2 +- roles/installer/ubuntu/iso/templates/grub.cfg.j2 | 2 +- .../installer/ubuntu/iso/templates/isolinux.cfg.j2 | 2 +- roles/installer/ubuntu/usb/tasks/main.yml | 2 +- roles/installer/ubuntu/usb/templates/grub.cfg.j2 | 2 +- .../installer/ubuntu/usb/templates/isolinux.cfg.j2 | 2 +- 22 files changed, 105 insertions(+), 105 deletions(-) (limited to 'roles/installer') diff --git a/roles/installer/debian/iso/tasks/main.yml b/roles/installer/debian/iso/tasks/main.yml index cfbb9721..7ace53c3 100644 --- a/roles/installer/debian/iso/tasks/main.yml +++ b/roles/installer/debian/iso/tasks/main.yml @@ -4,7 +4,7 @@ vars: debian_installer_distro: "{{ install_distro }}" debian_installer_codename: "{{ install_codename }}" - debian_installer_arch: "{{ install_cooked.arch | default('amd64') }}" + debian_installer_arch: "{{ install.arch | default('amd64') }}" debian_installer_variant: mini-iso import_role: role: installer/debian/fetch diff --git a/roles/installer/debian/iso/templates/grub.cfg.j2 b/roles/installer/debian/iso/templates/grub.cfg.j2 index e2f480fa..4e83cd6c 100644 --- a/roles/installer/debian/iso/templates/grub.cfg.j2 +++ b/roles/installer/debian/iso/templates/grub.cfg.j2 @@ -15,6 +15,6 @@ set timeout=10 set default=0 menuentry "automated installer for {{ inventory_hostname }}" { - linux /linux --- auto {{ (install_cooked.kernel_cmdline | default([])) | join(' ') }} + linux /linux --- auto {{ (install.kernel_cmdline | default([])) | join(' ') }} initrd /initrd.gz } diff --git a/roles/installer/debian/iso/templates/isolinux.cfg.j2 b/roles/installer/debian/iso/templates/isolinux.cfg.j2 index 1a758bda..aa14696f 100644 --- a/roles/installer/debian/iso/templates/isolinux.cfg.j2 +++ b/roles/installer/debian/iso/templates/isolinux.cfg.j2 @@ -12,4 +12,4 @@ SAY ** LABEL {{ inventory_hostname }} KERNEL linux INITRD initrd.gz - APPEND auto fb=false {{ (install_cooked.kernel_cmdline | default([])) | join(' ') }} + APPEND auto fb=false {{ (install.kernel_cmdline | default([])) | join(' ') }} diff --git a/roles/installer/debian/preseed/templates/partman_config.j2 b/roles/installer/debian/preseed/templates/partman_config.j2 index 77bc0f8b..70d218a7 100644 --- a/roles/installer/debian/preseed/templates/partman_config.j2 +++ b/roles/installer/debian/preseed/templates/partman_config.j2 @@ -15,7 +15,7 @@ d-i partman-auto-lvm/new_vg_name string {{ host_name }} d-i partman-auto-lvm/guided_size string max d-i partman-auto-lvm/no_boot boolean true -{% if (install_cooked.efi | default(false)) %} +{% if (install.efi | default(false)) %} d-i partman-efi/non_efi_system boolean true d-i partman/choose_label string gpt d-i partman/default_label string gpt @@ -32,29 +32,29 @@ d-i partman-basicfilesystems/choose_label string msdos d-i partman-basicfilesystems/default_label string msdos {% endif %} -{% set system_lvm_size = install_cooked.system_lvm.size | default(debian_preseed_system_lvm_size_default) %} -{% set system_lvm_volumes = install_cooked.system_lvm.volumes | default(debian_preseed_system_lvm_volumes_default) %} +{% set system_lvm_size = install.system_lvm.size | default(debian_preseed_system_lvm_size_default) %} +{% set system_lvm_volumes = install.system_lvm.volumes | default(debian_preseed_system_lvm_volumes_default) %} {# on small disks this probably triggers: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896826 ... #} -{# set system_lvm_reserve = install_cooked.system_lvm.reserve | default(debian_preseed_system_lvm_reserve_default) #} +{# set system_lvm_reserve = install.system_lvm.reserve | default(debian_preseed_system_lvm_reserve_default) #} {# set system_lvm_pv_size_min_mb = (((system_lvm_volumes | map(attribute='size') | map('human_to_bytes') | sum) / (1024*1024)) | int) + (((system_lvm_reserve | human_to_bytes) / (1024*1024)) | int) #} {# ... so let's go for a 1 MB minimum. #} {% set system_lvm_pv_size_min_mb = 1 %} -{% if install_cooked.disks.primary == "software-raid" %} +{% if install.disks.primary == "software-raid" %} d-i partman-auto/method string raid {% else %} d-i partman-auto/method string lvm {% endif %} d-i partman-auto/expert_recipe string \ ansible :: \ -{% if (install_cooked.efi | default(false)) %} +{% if (install.efi | default(false)) %} {% set efi_esp_size_mb = ((debian_preseed_efi_esp_size | human_to_bytes) / (1024*1024)) | int %} {{ efi_esp_size_mb }} {{ efi_esp_size_mb }} {{ efi_esp_size_mb }} fat16 \ $primary{ } $bootable{ } \ method{ efi } format{ } \ . \ {% endif %} -{% if install_cooked.disks.primary == "software-raid" %} +{% if install.disks.primary == "software-raid" %} {% set swraid_boot_size_mb = ((debian_preseed_swraid_boot_size | human_to_bytes) / (1024*1024)) | int %} {{ swraid_boot_size_mb }} {{ swraid_boot_size_mb }} {{ swraid_boot_size_mb }} raid \ $lvmignore{ } $primary{ } $bootable{ } \ diff --git a/roles/installer/debian/preseed/templates/partman_early-command.sh.j2 b/roles/installer/debian/preseed/templates/partman_early-command.sh.j2 index c7ceb8c6..4e8215c2 100644 --- a/roles/installer/debian/preseed/templates/partman_early-command.sh.j2 +++ b/roles/installer/debian/preseed/templates/partman_early-command.sh.j2 @@ -3,10 +3,10 @@ umount -l /media || true -{% if install_cooked.disks.primary == "software-raid" %} -disks="{% for disk in install_cooked.disks.raid.members %}$(readlink -f {{ disk }}) {% endfor %}" +{% if install.disks.primary == "software-raid" %} +disks="{% for disk in install.disks.raid.members %}$(readlink -f {{ disk }}) {% endfor %}" -{% if (install_cooked.efi | default(false)) %} +{% if (install.efi | default(false)) %} idx=1 {% else %} idx=0 @@ -24,11 +24,11 @@ for disk in $disks; do raid_members_lvm="$raid_members_lvm$disk"p$((idx + 2)) fi done -raid_config="{{ install_cooked.disks.raid.level }} {{ install_cooked.disks.raid.members | length }} 0" +raid_config="{{ install.disks.raid.level }} {{ install.disks.raid.members | length }} 0" debconf-set partman-auto-raid/recipe "$raid_config ext4 /boot $raid_members_boot . $raid_config lvm - $raid_members_lvm ." {% else %} -disks="$(readlink -f {{ install_cooked.disks.primary }})" +disks="$(readlink -f {{ install.disks.primary }})" {% endif %} debconf-set partman-auto/disk "$disks" debconf-set grub-installer/bootdev "$disks" diff --git a/roles/installer/debian/preseed/templates/preseed_debian-bullseye.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-bullseye.cfg.j2 index fa3304f4..e4c0a80c 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-bullseye.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-bullseye.cfg.j2 @@ -14,24 +14,24 @@ d-i keyboard-configuration/variantcode string {{ debian_preseed_keyboard_variant d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(network_cooked.primary.name) }} +d-i netcfg/choose_interface select {{ install_interface | default(network.primary.name) }} {% if (install_dhcp | default(false)) %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ network_cooked.primary.address | ipaddr('address') }} -d-i netcfg/get_netmask string {{ network_cooked.primary.address | ipaddr('netmask') }} -d-i netcfg/get_gateway string {{ network_cooked.primary.gateway }} -d-i netcfg/get_nameservers string {{ network_cooked.nameservers | join(' ') }} +d-i netcfg/get_ipaddress string {{ network.primary.address | ipaddr('address') }} +d-i netcfg/get_netmask string {{ network.primary.address | ipaddr('netmask') }} +d-i netcfg/get_gateway string {{ network.primary.gateway }} +d-i netcfg/get_nameservers string {{ network.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true {% endif %} d-i netcfg/hostname string {{ host_name }} d-i netcfg/get_hostname string {{ host_name }} -d-i netcfg/domain string {{ network_cooked.domain }} -d-i netcfg/get_domain string {{ network_cooked.domain }} +d-i netcfg/domain string {{ network.domain }} +d-i netcfg/get_domain string {{ network.domain }} d-i netcfg/wireless_wep string diff --git a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 index 23fe064d..edd360e1 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 @@ -14,24 +14,24 @@ d-i keyboard-configuration/variantcode string {{ debian_preseed_keyboard_variant d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(network_cooked.primary.name) }} +d-i netcfg/choose_interface select {{ install_interface | default(network.primary.name) }} {% if (install_dhcp | default(false)) %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ network_cooked.primary.address | ipaddr('address') }} -d-i netcfg/get_netmask string {{ network_cooked.primary.address | ipaddr('netmask') }} -d-i netcfg/get_gateway string {{ network_cooked.primary.gateway }} -d-i netcfg/get_nameservers string {{ network_cooked.nameservers | join(' ') }} +d-i netcfg/get_ipaddress string {{ network.primary.address | ipaddr('address') }} +d-i netcfg/get_netmask string {{ network.primary.address | ipaddr('netmask') }} +d-i netcfg/get_gateway string {{ network.primary.gateway }} +d-i netcfg/get_nameservers string {{ network.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true {% endif %} d-i netcfg/hostname string {{ host_name }} d-i netcfg/get_hostname string {{ host_name }} -d-i netcfg/domain string {{ network_cooked.domain }} -d-i netcfg/get_domain string {{ network_cooked.domain }} +d-i netcfg/domain string {{ network.domain }} +d-i netcfg/get_domain string {{ network.domain }} d-i netcfg/wireless_wep string diff --git a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 index 46a8be9a..39d17262 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 @@ -14,24 +14,24 @@ d-i keyboard-configuration/variantcode string {{ debian_preseed_keyboard_variant d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(network_cooked.primary.name) }} +d-i netcfg/choose_interface select {{ install_interface | default(network.primary.name) }} {% if (install_dhcp | default(false)) %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ network_cooked.primary.address | ipaddr('address') }} -d-i netcfg/get_netmask string {{ network_cooked.primary.address | ipaddr('netmask') }} -d-i netcfg/get_gateway string {{ network_cooked.primary.gateway }} -d-i netcfg/get_nameservers string {{ network_cooked.nameservers | join(' ') }} +d-i netcfg/get_ipaddress string {{ network.primary.address | ipaddr('address') }} +d-i netcfg/get_netmask string {{ network.primary.address | ipaddr('netmask') }} +d-i netcfg/get_gateway string {{ network.primary.gateway }} +d-i netcfg/get_nameservers string {{ network.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true {% endif %} d-i netcfg/hostname string {{ host_name }} d-i netcfg/get_hostname string {{ host_name }} -d-i netcfg/domain string {{ network_cooked.domain }} -d-i netcfg/get_domain string {{ network_cooked.domain }} +d-i netcfg/domain string {{ network.domain }} +d-i netcfg/get_domain string {{ network.domain }} d-i netcfg/wireless_wep string diff --git a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 index 172f1879..4c7b2f12 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 @@ -14,24 +14,24 @@ d-i keyboard-configuration/variantcode string {{ debian_preseed_keyboard_variant d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(network_cooked.primary.name) }} +d-i netcfg/choose_interface select {{ install_interface | default(network.primary.name) }} {% if (install_dhcp | default(false)) %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ network_cooked.primary.address | ipaddr('address') }} -d-i netcfg/get_netmask string {{ network_cooked.primary.address | ipaddr('netmask') }} -d-i netcfg/get_gateway string {{ network_cooked.primary.gateway }} -d-i netcfg/get_nameservers string {{ network_cooked.nameservers | join(' ') }} +d-i netcfg/get_ipaddress string {{ network.primary.address | ipaddr('address') }} +d-i netcfg/get_netmask string {{ network.primary.address | ipaddr('netmask') }} +d-i netcfg/get_gateway string {{ network.primary.gateway }} +d-i netcfg/get_nameservers string {{ network.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true {% endif %} d-i netcfg/hostname string {{ host_name }} d-i netcfg/get_hostname string {{ host_name }} -d-i netcfg/domain string {{ network_cooked.domain }} -d-i netcfg/get_domain string {{ network_cooked.domain }} +d-i netcfg/domain string {{ network.domain }} +d-i netcfg/get_domain string {{ network.domain }} d-i netcfg/wireless_wep string diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 index 3f31f66b..a36e3d9d 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 @@ -18,24 +18,24 @@ d-i hw-detect/load_firmware boolean false {% if debian_preseed_no_netplan %} d-i netcfg/do_not_use_netplan boolean true {% endif %} -d-i netcfg/choose_interface select {{ install_interface | default(network_cooked.primary.name) }} +d-i netcfg/choose_interface select {{ install_interface | default(network.primary.name) }} {% if (install_dhcp | default(false)) %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ network_cooked.primary.address | ipaddr('address') }} -d-i netcfg/get_netmask string {{ network_cooked.primary.address | ipaddr('netmask') }} -d-i netcfg/get_gateway string {{ network_cooked.primary.gateway }} -d-i netcfg/get_nameservers string {{ network_cooked.nameservers | join(' ') }} +d-i netcfg/get_ipaddress string {{ network.primary.address | ipaddr('address') }} +d-i netcfg/get_netmask string {{ network.primary.address | ipaddr('netmask') }} +d-i netcfg/get_gateway string {{ network.primary.gateway }} +d-i netcfg/get_nameservers string {{ network.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true {% endif %} d-i netcfg/hostname string {{ host_name }} d-i netcfg/get_hostname string {{ host_name }} -d-i netcfg/domain string {{ network_cooked.domain }} -d-i netcfg/get_domain string {{ network_cooked.domain }} +d-i netcfg/domain string {{ network.domain }} +d-i netcfg/get_domain string {{ network.domain }} d-i netcfg/wireless_wep string @@ -74,7 +74,7 @@ d-i debian-installer/add-kernel-opts string nosplash d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[apt_repo_provider].ubuntu.host }} d-i apt-setup/security_path string {{ apt_repo_providers[apt_repo_provider].ubuntu.path }} -{% if install_cooked.arch | default('amd64') == 'amd64' %} +{% if install.arch | default('amd64') == 'amd64' %} d-i apt-setup/multiarch string amd64 {% endif %} diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 index f895a668..abcbe576 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 @@ -18,24 +18,24 @@ d-i hw-detect/load_firmware boolean false {% if debian_preseed_no_netplan %} d-i netcfg/do_not_use_netplan boolean true {% endif %} -d-i netcfg/choose_interface select {{ install_interface | default(network_cooked.primary.name) }} +d-i netcfg/choose_interface select {{ install_interface | default(network.primary.name) }} {% if (install_dhcp | default(false)) %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ network_cooked.primary.address | ipaddr('address') }} -d-i netcfg/get_netmask string {{ network_cooked.primary.address | ipaddr('netmask') }} -d-i netcfg/get_gateway string {{ network_cooked.primary.gateway }} -d-i netcfg/get_nameservers string {{ network_cooked.nameservers | join(' ') }} +d-i netcfg/get_ipaddress string {{ network.primary.address | ipaddr('address') }} +d-i netcfg/get_netmask string {{ network.primary.address | ipaddr('netmask') }} +d-i netcfg/get_gateway string {{ network.primary.gateway }} +d-i netcfg/get_nameservers string {{ network.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true {% endif %} d-i netcfg/hostname string {{ host_name }} d-i netcfg/get_hostname string {{ host_name }} -d-i netcfg/domain string {{ network_cooked.domain }} -d-i netcfg/get_domain string {{ network_cooked.domain }} +d-i netcfg/domain string {{ network.domain }} +d-i netcfg/get_domain string {{ network.domain }} d-i netcfg/wireless_wep string @@ -74,7 +74,7 @@ d-i debian-installer/add-kernel-opts string nosplash d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[apt_repo_provider].ubuntu.host }} d-i apt-setup/security_path string {{ apt_repo_providers[apt_repo_provider].ubuntu.path }} -{% if install_cooked.arch | default('amd64') == 'amd64' %} +{% if install.arch | default('amd64') == 'amd64' %} d-i apt-setup/multiarch string amd64 {% endif %} diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 index 248afd67..3a8e35b5 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 @@ -15,24 +15,24 @@ d-i keyboard-configuration/variantcode string {{ debian_preseed_keyboard_variant d-i hw-detect/load_firmware boolean false -d-i netcfg/choose_interface select {{ install_interface | default(network_cooked.primary.name) }} +d-i netcfg/choose_interface select {{ install_interface | default(network.primary.name) }} {% if (install_dhcp | default(false)) %} d-i netcfg/disable_dhcp boolean false d-i netcfg/disable_autoconfig boolean false {% else %} d-i netcfg/disable_dhcp boolean true d-i netcfg/disable_autoconfig boolean true -d-i netcfg/get_ipaddress string {{ network_cooked.primary.address | ipaddr('address') }} -d-i netcfg/get_netmask string {{ network_cooked.primary.address | ipaddr('netmask') }} -d-i netcfg/get_gateway string {{ network_cooked.primary.gateway }} -d-i netcfg/get_nameservers string {{ network_cooked.nameservers | join(' ') }} +d-i netcfg/get_ipaddress string {{ network.primary.address | ipaddr('address') }} +d-i netcfg/get_netmask string {{ network.primary.address | ipaddr('netmask') }} +d-i netcfg/get_gateway string {{ network.primary.gateway }} +d-i netcfg/get_nameservers string {{ network.nameservers | join(' ') }} d-i netcfg/confirm_static boolean true {% endif %} d-i netcfg/hostname string {{ host_name }} d-i netcfg/get_hostname string {{ host_name }} -d-i netcfg/domain string {{ network_cooked.domain }} -d-i netcfg/get_domain string {{ network_cooked.domain }} +d-i netcfg/domain string {{ network.domain }} +d-i netcfg/get_domain string {{ network.domain }} d-i netcfg/wireless_wep string @@ -71,7 +71,7 @@ d-i debian-installer/add-kernel-opts string nosplash d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[apt_repo_provider].ubuntu.host }} d-i apt-setup/security_path string {{ apt_repo_providers[apt_repo_provider].ubuntu.path }} -{% if install_cooked.arch | default('amd64') == 'amd64' %} +{% if install.arch | default('amd64') == 'amd64' %} d-i apt-setup/multiarch string amd64 {% endif %} diff --git a/roles/installer/debian/usb/tasks/main.yml b/roles/installer/debian/usb/tasks/main.yml index ced56372..6beb0121 100644 --- a/roles/installer/debian/usb/tasks/main.yml +++ b/roles/installer/debian/usb/tasks/main.yml @@ -16,7 +16,7 @@ vars: debian_installer_distro: "{{ install_distro }}" debian_installer_codename: "{{ install_codename }}" - debian_installer_arch: "{{ install_cooked.arch | default('amd64') }}" + debian_installer_arch: "{{ install.arch | default('amd64') }}" debian_installer_variant: netboot import_role: role: installer/debian/fetch diff --git a/roles/installer/debian/usb/templates/syslinux.cfg.j2 b/roles/installer/debian/usb/templates/syslinux.cfg.j2 index badb7e81..79c9d78e 100644 --- a/roles/installer/debian/usb/templates/syslinux.cfg.j2 +++ b/roles/installer/debian/usb/templates/syslinux.cfg.j2 @@ -21,5 +21,5 @@ LABEL {{ host }} MENU LABEL automated installer for {{ host }} KERNEL linux INITRD initrd.{{ host }}.gz - APPEND auto fb=false {{ (hostvars[host].install_cooked.kernel_cmdline | default([])) | join(' ') }} + APPEND auto fb=false {{ (hostvars[host].install.kernel_cmdline | default([])) | join(' ') }} {% endfor %} diff --git a/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 b/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 index 4cfdbfa7..e6437ff1 100644 --- a/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 +++ b/roles/installer/openbsd/autoinstall/templates/auto_install.conf.j2 @@ -1,15 +1,15 @@ System hostname = {{ host_name }} -Which network interface do you wish to configure = {{ install_interface | default(network_cooked.primary.name) }} +Which network interface do you wish to configure = {{ install_interface | default(network.primary.name) }} {% if (install_dhcp | default(false)) %} IPv4 address = dhcp {% else %} -IPv4 address = {{ network_cooked.primary.address | ipaddr('address') }} -Netmask = {{ network_cooked.primary.address | ipaddr('netmask') }} -Default IPv4 route = {{ network_cooked.primary.gateway }} +IPv4 address = {{ network.primary.address | ipaddr('address') }} +Netmask = {{ network.primary.address | ipaddr('netmask') }} +Default IPv4 route = {{ network.primary.gateway }} {% endif %} -DNS domain name = {{ network_cooked.domain }} -DNS nameservers = {{ network_cooked.nameservers | join(' ') }} +DNS domain name = {{ network.domain }} +DNS nameservers = {{ network.nameservers | join(' ') }} {% if obsd_autoinstall_serial_device is defined %} Change the default console to {{ obsd_autoinstall_serial_device }} = yes diff --git a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 index 8b4538d5..85fb9d53 100644 --- a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 +++ b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 @@ -13,27 +13,27 @@ autoinstall: network: version: 2 ethernets: - {{ install_interface | default(network_cooked.primary.name) }}: + {{ install_interface | default(network.primary.name) }}: {% if install_dhcp | default(false) %} dhcp4: yes {% else %} addresses: - - {{ network_cooked.primary.address }} - gateway4: {{ network_cooked.primary.gateway }} -{% if (network_cooked.nameservers | default([]) | length) > 0 %} + - {{ network.primary.address }} + gateway4: {{ network.primary.gateway }} +{% if (network.nameservers | default([]) | length) > 0 %} nameservers: search: [ {{ host_domain }} ] - addresses: [ {{ network_cooked.nameservers | join(', ') }} ] + addresses: [ {{ network.nameservers | join(', ') }} ] {% endif %} {% endif %} storage: config: -{% if install_cooked.disks.primary != "software-raid" %} +{% if install.disks.primary != "software-raid" %} - id: disk-primary type: disk - path: {{ install_cooked.disks.primary }} -{% if install_cooked.efi | default(false) %} + path: {{ install.disks.primary }} +{% if install.efi | default(false) %} ptable: gpt {% else %} ptable: msdos @@ -41,11 +41,11 @@ autoinstall: {% endif %} wipe: superblock-recursive {% else %} -{% for raid_member in install_cooked.disks.raid.members %} +{% for raid_member in install.disks.raid.members %} - id: raid-disk{{ loop.index }} type: disk path: {{ raid_member }} -{% if install_cooked.efi | default(false) %} +{% if install.efi | default(false) %} ptable: gpt {% else %} ptable: msdos @@ -55,9 +55,9 @@ autoinstall: {% endfor %} {% endif %} -{% if install_cooked.efi | default(false) %} +{% if install.efi | default(false) %} {% set part_offset = 1 %} -{% if install_cooked.disks.primary != "software-raid" %} +{% if install.disks.primary != "software-raid" %} - id: partition-esp type: partition device: disk-primary @@ -75,7 +75,7 @@ autoinstall: device: format-esp path: /boot/efi {% else %} -{% for raid_member in install_cooked.disks.raid.members %} +{% for raid_member in install.disks.raid.members %} - id: partition-esp{{ loop.index }} type: partition device: raid-disk{{ loop.index }} @@ -98,8 +98,8 @@ autoinstall: {% else %} {% set part_offset = 0 %} {% endif %} -{% if install_cooked.disks.primary == "software-raid" %} -{% for raid_member in install_cooked.disks.raid.members %} +{% if install.disks.primary == "software-raid" %} +{% for raid_member in install.disks.raid.members %} - id: raid-partition-boot{{ loop.index }} type: partition device: raid-disk{{ loop.index }} @@ -109,9 +109,9 @@ autoinstall: - id: partition-boot type: raid name: md-boot - raidlevel: {{ install_cooked.disks.raid.level }} + raidlevel: {{ install.disks.raid.level }} devices: -{% for raid_member in install_cooked.disks.raid.members %} +{% for raid_member in install.disks.raid.members %} - raid-partition-boot{{ loop.index }} {% endfor %} - id: format-boot @@ -125,9 +125,9 @@ autoinstall: {% set part_offset = part_offset + 1 %} {% endif %} -{% set system_lvm_size = install_cooked.system_lvm.size | default(ubuntu_autoinstall_system_lvm_size_default) %} -{% set system_lvm_volumes = install_cooked.system_lvm.volumes | default(ubuntu_autoinstall_system_lvm_volumes_default) %} -{% if install_cooked.disks.primary != "software-raid" %} +{% set system_lvm_size = install.system_lvm.size | default(ubuntu_autoinstall_system_lvm_size_default) %} +{% set system_lvm_volumes = install.system_lvm.volumes | default(ubuntu_autoinstall_system_lvm_volumes_default) %} +{% if install.disks.primary != "software-raid" %} - id: partition-lvm type: partition device: disk-primary @@ -144,7 +144,7 @@ autoinstall: size: -1 {% else %} -{% for raid_member in install_cooked.disks.raid.members %} +{% for raid_member in install.disks.raid.members %} - id: raid-partition-lvm{{ loop.index }} type: partition device: raid-disk{{ loop.index }} @@ -162,9 +162,9 @@ autoinstall: - id: partition-lvm type: raid name: md-lvm - raidlevel: {{ install_cooked.disks.raid.level }} + raidlevel: {{ install.disks.raid.level }} devices: -{% for raid_member in install_cooked.disks.raid.members %} +{% for raid_member in install.disks.raid.members %} - raid-partition-lvm{{ loop.index }} {% endfor %} @@ -239,7 +239,7 @@ autoinstall: {% endif %} - curtin in-target --target=/target -- apt-mark manual iputils-ping isc-dhcp-client netcat-openbsd netplan.io sudo - curtin in-target --target=/target -- apt-get -y -q purge policykit-1 multipath-tools ubuntu-minimal unattended-upgrades sound-theme-freedesktop thin-provisioning-tools cryptsetup byobu open-iscsi btrfs-progs pollinate lxd-agent-loader open-vm-tools -{% if install_cooked.disks.primary != "software-raid" %} +{% if install.disks.primary != "software-raid" %} - curtin in-target --target=/target -- apt-get -y -q purge mdadm {% endif %} - curtin in-target --target=/target -- env SUDO_FORCE_REMOVE=yes apt-get -y -q purge sudo diff --git a/roles/installer/ubuntu/iso/tasks/main.yml b/roles/installer/ubuntu/iso/tasks/main.yml index ecfc2265..be46d923 100644 --- a/roles/installer/ubuntu/iso/tasks/main.yml +++ b/roles/installer/ubuntu/iso/tasks/main.yml @@ -3,7 +3,7 @@ run_once: true vars: ubuntu_installer_codename: "{{ install_codename }}" - ubuntu_installer_arch: "{{ install_cooked.arch | default('amd64') }}" + ubuntu_installer_arch: "{{ install.arch | default('amd64') }}" ubuntu_installer_variant: "{{ ubuntu_installer_iso_variant }}" import_role: role: installer/ubuntu/fetch diff --git a/roles/installer/ubuntu/iso/templates/grub.cfg.j2 b/roles/installer/ubuntu/iso/templates/grub.cfg.j2 index ccbc25eb..74d7709e 100644 --- a/roles/installer/ubuntu/iso/templates/grub.cfg.j2 +++ b/roles/installer/ubuntu/iso/templates/grub.cfg.j2 @@ -13,6 +13,6 @@ set default=0 menuentry "automated installer for {{ inventory_hostname }}" { set gfxpayload=keep - linux /casper/vmlinuz quiet nopersistent autoinstall "ds=nocloud;s=/cdrom/autoinstall/{{ inventory_hostname }}/" {{ (install_cooked.kernel_cmdline | default([])) | join(' ') }} + linux /casper/vmlinuz quiet nopersistent autoinstall "ds=nocloud;s=/cdrom/autoinstall/{{ inventory_hostname }}/" {{ (install.kernel_cmdline | default([])) | join(' ') }} initrd /casper/initrd } diff --git a/roles/installer/ubuntu/iso/templates/isolinux.cfg.j2 b/roles/installer/ubuntu/iso/templates/isolinux.cfg.j2 index 99401b8b..b407b149 100644 --- a/roles/installer/ubuntu/iso/templates/isolinux.cfg.j2 +++ b/roles/installer/ubuntu/iso/templates/isolinux.cfg.j2 @@ -12,4 +12,4 @@ SAY ** LABEL {{ inventory_hostname }} KERNEL /casper/vmlinuz INITRD /casper/initrd - APPEND quiet nopersistent autoinstall ds=nocloud;s=/cdrom/autoinstall/{{ inventory_hostname }}/ {{ (install_cooked.kernel_cmdline | default([])) | join(' ') }} + APPEND quiet nopersistent autoinstall ds=nocloud;s=/cdrom/autoinstall/{{ inventory_hostname }}/ {{ (install.kernel_cmdline | default([])) | join(' ') }} diff --git a/roles/installer/ubuntu/usb/tasks/main.yml b/roles/installer/ubuntu/usb/tasks/main.yml index c7eb9e41..94b7c316 100644 --- a/roles/installer/ubuntu/usb/tasks/main.yml +++ b/roles/installer/ubuntu/usb/tasks/main.yml @@ -15,7 +15,7 @@ run_once: true vars: ubuntu_installer_codename: "{{ install_codename }}" - ubuntu_installer_arch: "{{ install_cooked.arch | default('amd64') }}" + ubuntu_installer_arch: "{{ install.arch | default('amd64') }}" ubuntu_installer_variant: "{{ ubuntu_installer_usb_variant }}" import_role: role: installer/ubuntu/fetch diff --git a/roles/installer/ubuntu/usb/templates/grub.cfg.j2 b/roles/installer/ubuntu/usb/templates/grub.cfg.j2 index adeb5672..8282e95c 100644 --- a/roles/installer/ubuntu/usb/templates/grub.cfg.j2 +++ b/roles/installer/ubuntu/usb/templates/grub.cfg.j2 @@ -16,7 +16,7 @@ set default=0 menuentry "automated installer for {{ host }}" { set gfxpayload=keep - linux /casper/vmlinuz quiet nopersistent autoinstall "ds=nocloud;s=/cdrom/autoinstall/{{ host }}/" {{ (hostvars[host].install_cooked.kernel_cmdline | default([])) | join(' ') }} + linux /casper/vmlinuz quiet nopersistent autoinstall "ds=nocloud;s=/cdrom/autoinstall/{{ host }}/" {{ (hostvars[host].install.kernel_cmdline | default([])) | join(' ') }} initrd /casper/initrd } {% endfor %} diff --git a/roles/installer/ubuntu/usb/templates/isolinux.cfg.j2 b/roles/installer/ubuntu/usb/templates/isolinux.cfg.j2 index 03d581d4..12e7179d 100644 --- a/roles/installer/ubuntu/usb/templates/isolinux.cfg.j2 +++ b/roles/installer/ubuntu/usb/templates/isolinux.cfg.j2 @@ -21,5 +21,5 @@ LABEL {{ host }} MENU LABEL automated installer for {{ host }} KERNEL /casper/vmlinuz INITRD /casper/initrd - APPEND quiet nopersistent autoinstall ds=nocloud;s=/cdrom/autoinstall/{{ host }}/ {{ (hostvars[host].install_cooked.kernel_cmdline | default([])) | join(' ') }} + APPEND quiet nopersistent autoinstall ds=nocloud;s=/cdrom/autoinstall/{{ host }}/ {{ (hostvars[host].install.kernel_cmdline | default([])) | join(' ') }} {% endfor %} -- cgit v1.2.3