From 0c780c77fc6854a13bd3b804a641ba0ef7785020 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Thu, 24 Nov 2022 20:39:24 +0100 Subject: [PATCH] add interface config for additional interfaces on debian --- hetzner/autoinstall/templates/post-install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hetzner/autoinstall/templates/post-install.sh b/hetzner/autoinstall/templates/post-install.sh index 4ba20c5..20d2a9e 100644 --- a/hetzner/autoinstall/templates/post-install.sh +++ b/hetzner/autoinstall/templates/post-install.sh @@ -1,6 +1,6 @@ #!/bin/bash - +DEBIAN_INTERFACES_CONFIG=/etc/network/interfaces add_rfc3442_hook() { cat << EOF > /etc/initramfs-tools/hooks/add-rfc3442-dhclient-hook #!/bin/sh @@ -49,3 +49,11 @@ echo "DEVICE={{ autoinstall_initramfs_interface }}" >> /etc/initramfs-tools/init # Update system apt-get update >/dev/null apt-get -y install cryptsetup-initramfs dropbear-initramfs + +{% for interface in ansible_interfaces %} +{% if "ens" in interface and interface != "ens3" and ansible_distribution|lower == "debian" %} +echo "" >> $DEBIAN_INTERFACES_CONFIG +echo "auto {{ interface }}" >> $DEBIAN_INTERFACES_CONFIG +echo "iface {{ interface }} inet dhcp" >> $DEBIAN_INTERFACES_CONFIG +{% endif %} +{% endfor %}