@@ -15,37 +15,11 @@ resource "leaseweb_dedicated_server_installation" "main" {
1515#!/bin/bash
1616set -ex
1717
18- dnf install yum-utils
18+ dnf install -y yum-utils
1919dnf config-manager --set-enabled crb
2020dnf install -y epel-release
2121dnf install -y systemd-networkd
2222
23- cat > /etc/udev/rules.d/10-shared.rules <<EOR
24- SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="${ lower (var. internal_mac )} ", ATTR{addr_assign_type}=="0", NAME="shared"
25- EOR
26-
27- mkdir -p /etc/systemd/network
28- cat > /etc/systemd/network/shared.network <<EOR
29- [Match]
30- MACAddress=${ var . internal_mac }
31-
32- [Network]
33- Address=${ var . internal_ip } /16
34- Gateway=10.32.0.1
35- DNS=10.164.15.230
36- EOR
37-
38- nmcli con down public
39- systemctl stop NetworkManager
40- systemctl start systemd-networkd
41-
42- systemctl disable NetworkManager
43- systemctl enable systemd-networkd
44-
45- cat > /etc/resolv.conf <<EOR
46- nameserver 10.164.15.230
47- EOR
48-
4923mkdir -p /var/lib/sftd
5024chmod 700 /var/lib/sftd
5125echo "${ var . enrollment_token } " > /var/lib/sftd/enrollment.token
@@ -75,8 +49,29 @@ update-crypto-policies --set LEGACY
7549dnf install -y scaleft-server-tools
7650systemctl enable sftd
7751
52+ cat > /etc/udev/rules.d/10-shared.rules <<EOR
53+ SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="${ lower (var. internal_mac )} ", ATTR{addr_assign_type}=="0", NAME="shared"
54+ EOR
55+
56+ mkdir -p /etc/systemd/network
57+ cat > /etc/systemd/network/shared.network <<EOR
58+ [Match]
59+ MACAddress=${ var . internal_mac }
60+
61+ [Network]
62+ Address=${ var . internal_ip } /16
63+ Gateway=10.32.0.1
64+ DNS=10.164.15.230
65+ EOR
66+
67+ systemctl disable NetworkManager
68+ systemctl enable systemd-networkd
69+
70+ cat > /etc/resolv.conf <<EOR
71+ nameserver 10.164.15.230
72+ EOR
73+
7874sgdisk -n 4:0:0 -t 4:bf01 -c 4:data /dev/sda
79- partprobe
8075
8176reboot
8277EOT
0 commit comments