diff --git a/templates/ipxe/Dockerfile b/templates/ipxe/Dockerfile index 488b94b5..97d4b95b 100644 --- a/templates/ipxe/Dockerfile +++ b/templates/ipxe/Dockerfile @@ -41,7 +41,7 @@ RUN mkdir /src && cd /src \ && git checkout "${IPXE_VERSION}" \ && mkdir /ipxe \ # Patch DHCP settings - && sed -i 's/^\(#define DHCP_DISC_END_TIMEOUT_SEC [0-9]\+$/\132/g' './config/dhcp.h' \ + && sed -i 's/^\(#define DHCP_DISC_END_TIMEOUT_SEC \)[0-9]\+$/\132/g' './config/dhcp.h' \ # Build each iPXE platforms # * usage: make [platform]/[driver].[extension] ### ARCH [0x00] - BIOS diff --git a/templates/kiss/assets/boot/boot-ubuntu2404.ipxe b/templates/kiss/assets/boot/boot-ubuntu2404.ipxe index e62f9a35..dd722578 100644 --- a/templates/kiss/assets/boot/boot-ubuntu2404.ipxe +++ b/templates/kiss/assets/boot/boot-ubuntu2404.ipxe @@ -20,7 +20,7 @@ kernel --name vmlinuz ${repo}/netboot/${arch}/linux || goto kernel initrd --name initrd ${repo}/netboot/${arch}/initrd || goto initrd :initargs -imgargs vmlinuz initrd=initrd autoinstall ip=dhcp url=${repo}/ubuntu-${os_ver}-live-server-${arch}.iso cloud-config-url=${cloud_config_url} +imgargs vmlinuz initrd=initrd autoinstall ip=dhcp modprobe.blacklist=rndis_host url=${repo}/ubuntu-${os_ver}-live-server-${arch}.iso cloud-config-url=${cloud_config_url} :boot boot || goto boot diff --git a/templates/kiss/assets/boot/cloud-init_ubuntu_24.04.yaml b/templates/kiss/assets/boot/cloud-init_ubuntu_24.04.yaml index 47262bf7..90823d3b 100644 --- a/templates/kiss/assets/boot/cloud-init_ubuntu_24.04.yaml +++ b/templates/kiss/assets/boot/cloud-init_ubuntu_24.04.yaml @@ -42,8 +42,8 @@ autoinstall: users: - name: kiss groups: docker, sudo, users, wheel - lock_passwd: true - passwd: "$6$rBhSuMvNSgbLh2H/$1rCRSowuivSwaXvjmBaGLOYp5ad5EFuxw78YTx3I3TrhyduLmw2fpmA9QxNTHq.OAIJmkO/KHZH/ImalRwpaP1" # TODO: remove after debugging + lock_passwd: false + passwd: $6$Tt5aacrWjfFz/v6l$lfIW/m1.dYdoJlRnYrtx/pKDyfUTJg8Sh/rbsOcMD2vJa.4rAzSZy7Lp89Q/3ijK97RQUm/zS0cApJmLFLwyx0 shell: /bin/bash ssh_authorized_keys: - "ENV_SSH_AUTHORIZED_KEYS" @@ -66,6 +66,25 @@ autoinstall: DNS=10.64.0.3 EOF systemctl restart systemd-resolved.service + - | + mkdir -p /etc/NetworkManager/conf.d/ + cat </etc/NetworkManager/conf.d/99-systemd.conf + [main] + dns=default + rc-manager=resolvconf + EOF + - rm -f /etc/netplan/50-cloud-init* + - | + cat </etc/netplan/50-cloud-init.yaml + network: + version: 2 + renderer: NetworkManager + ethernets: + alleths: + match: + name: en* + dhcp4: true + EOF - > apt-get update && apt-get install -y network-manager && systemctl disable --now systemd-networkd.service systemd-networkd.socket @@ -74,7 +93,8 @@ autoinstall: && for dev in $(nmcli connection show --active | awk '{print $4}' | grep -P '^en'); do nmcli connection down "${dev}" || true ; done - && netplan apply + - until netplan apply; do sleep 3; done + - until curl "http://assets.kiss.svc.ops.openark"; do netplan apply || true; sleep 30; done late-commands: # Install dependencies - > diff --git a/templates/kiss/assets/boot/cloud-init_ubuntu_24.04_post-install.sh b/templates/kiss/assets/boot/cloud-init_ubuntu_24.04_post-install.sh index 65adfef5..9de86b2c 100755 --- a/templates/kiss/assets/boot/cloud-init_ubuntu_24.04_post-install.sh +++ b/templates/kiss/assets/boot/cloud-init_ubuntu_24.04_post-install.sh @@ -17,18 +17,24 @@ _IS_NVIDIA_MANUAL="false" # Advanced Network configuration mkdir -p /etc/NetworkManager/system-connections/ -## Wireless - WIFI -if [ "NETWORK_WIRELESS_WIFI_SSID" != "" ]; then - ## Disable Power Saving Mode (iwlmvm) - cat </etc/modprobe.d/iwlmvm.conf + +## Disable Kernel Module: rndis_host +cat </etc/default/grub.d/10-blacklist-rndis_host.cfg +GRUB_CMDLINE_LINUX="modprobe.blacklist=rndis_host" +EOF +cat </etc/modprobe.d/blacklist-rndis_host.conf +blacklist rndis_host +EOF + +## Disable Power Saving Mode (iwlmvm) +cat </etc/modprobe.d/iwlmvm.conf options iwlmvm power_scheme=1 EOF - ## Disable Power Saving Mode (iwlwifi) - cat </etc/modprobe.d/iwlwifi.conf +## Disable Power Saving Mode (iwlwifi) +cat </etc/modprobe.d/iwlwifi.conf options iwlwifi power_save=0 EOF -fi ## Disable Power Saving Mode on NetworkManager mkdir -p /etc/NetworkManager/conf.d/ @@ -518,8 +524,8 @@ BOOT_NUM="$( grep -P '\\EFI\\ubuntu\\shimx64.efi\)$' | grep -Po '^Boot\K[0-9A-F]+' )" -#sudo efibootmgr --bootnum "${BOOT_NUM}" --active -sudo efibootmgr --bootorder "${BOOT_NUM}" +#efibootmgr --bootnum "${BOOT_NUM}" --active +efibootmgr --bootorder "${BOOT_NUM}" # Hostname UUID="$(cat /sys/class/dmi/id/product_uuid)" diff --git a/templates/kiss/tasks/commission/network-ethernet-conf-network-manager.yaml b/templates/kiss/tasks/commission/network-ethernet-conf-network-manager.yaml index 26cd6862..2baae2ba 100644 --- a/templates/kiss/tasks/commission/network-ethernet-conf-network-manager.yaml +++ b/templates/kiss/tasks/commission/network-ethernet-conf-network-manager.yaml @@ -69,6 +69,16 @@ when: kiss_allow_pruning_network_interfaces | default(False) command: nmcli connection reload +- name: Reboot the boxes if network is changed (The task will be restarted) + when: kiss_allow_pruning_network_interfaces | default(False) + reboot: + reboot_timeout: 3600 # 1h (booting can take a long time) + +- name: Assert rebooting + when: kiss_allow_pruning_network_interfaces | default(False) + fail: + msg: The nodes should be rebooted! + - name: Enable bonds now | NetworkManager when: - all_interfaces | length > 0