forked from David-VTUK/Rancher-Packer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
39 lines (34 loc) · 1.07 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Apply updates
#
zypper -n dup -y
# Disable swap - generally recommendeded for K8s
#
swapoff -a
sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
# Reset the machine-id value. This has known to cause issues with DHCP
#
truncate -s 0 /etc/machine-id
rm /var/lib/dbus/machine-id
ln -s /etc/machine-id /var/lib/dbus/machine-id
# Ensure cloud-init services are enabled
systemctl enable cloud-init.service
systemctl enable cloud-init-local.server
systemctl enable cloud-config.service
systemctl enable cloud-final.service
# Cleanup
#
zypper -n clean --all
/usr/sbin/SUSEConnect --de-register
zypper -n rr SLES15-SP2-15.2-0
rm -f /etc/udev/rules.d/70-persistent-net.rules
touch /etc/udev/rules.d/75-persistent-net-generator.rules
truncate -s 0 /etc/{hostname,hosts,resolv.conf}
for seed in /var/lib/systemd/random-seed /var/lib/misc/random-seed; do
[ -f "$seed" ] && rm -f "$seed"
done
if [ -d /var/lib/wicked ]; then
rm -rf /var/lib/wicked/*
fi
rm -rf /tmp/* /tmp/.* /var/tmp/* /var/tmp/.* &> /dev/null || true
rm -rf /var/cache/*/* /var/crash/* /var/lib/systemd/coredump/*
cloud-init clean -s -l