From 8ef2f52313f5affce1614c9eee27d6466fc6f46d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 1 Jul 2021 01:21:02 +0200 Subject: ubuntu usb installer can now install multiple hosts from same drive --- roles/installer/ubuntu/usb/templates/grub.cfg.j2 | 8 ++++++-- roles/installer/ubuntu/usb/templates/isolinux.cfg.j2 | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'roles/installer/ubuntu/usb/templates') diff --git a/roles/installer/ubuntu/usb/templates/grub.cfg.j2 b/roles/installer/ubuntu/usb/templates/grub.cfg.j2 index a9a1761c..1f97113a 100644 --- a/roles/installer/ubuntu/usb/templates/grub.cfg.j2 +++ b/roles/installer/ubuntu/usb/templates/grub.cfg.j2 @@ -8,11 +8,15 @@ fi set menu_color_normal=white/black set menu_color_highlight=black/light-gray +{% if (ansible_play_hosts_all | length) == 1 %} set timeout=10 set default=0 +{% endif %} +{% for host in ansible_play_hosts_all %} -menuentry "automated installer for {{ inventory_hostname }}" { +menuentry "automated installer for {{ host }}" { set gfxpayload=keep - linux /casper/vmlinuz quiet nopersistent autoinstall "ds=nocloud;s=/cdrom/autoinstall/" {{ (install_cooked.kernel_cmdline | default([])) | join(' ') }} + linux /casper/vmlinuz quiet nopersistent autoinstall "ds=nocloud;s=/cdrom/autoinstall/{{ host }}/" {{ (hostvars[host].install_cooked.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 4c84dd45..8360c057 100644 --- a/roles/installer/ubuntu/usb/templates/isolinux.cfg.j2 +++ b/roles/installer/ubuntu/usb/templates/isolinux.cfg.j2 @@ -1,3 +1,4 @@ +{% if (ansible_play_hosts_all | length) == 1 %} DEFAULT {{ inventory_hostname }} TIMEOUT 100 PROMPT 1 @@ -8,8 +9,17 @@ SAY ** Codename: {{ install_codename }} SAY ** SAY ** will be booting automated installer for {{ inventory_hostname }} in 10s ... SAY ** +{% else %} +DEFAULT menu.c32 +TIMEOUT 0 +PROMPT 0 +MENU TITLE {{ install_distro }} / {{ install_codename }} +{% endif %} +{% for host in ansible_play_hosts_all %} -LABEL {{ inventory_hostname }} +LABEL {{ host }} + MENU LABEL automatic installer for {{ host }} KERNEL /casper/vmlinuz INITRD /casper/initrd - APPEND quiet nopersistent autoinstall ds=nocloud;s=/cdrom/autoinstall/ {{ (install_cooked.kernel_cmdline | default([])) | join(' ') }} + APPEND quiet nopersistent autoinstall ds=nocloud;s=/cdrom/autoinstall/{{ host }}/ {{ (hostvars[host].install_cooked.kernel_cmdline | default([])) | join(' ') }} +{% endfor %} -- cgit v1.2.3