summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-05-31 06:42:02 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-05-31 06:42:02 +0200
commitb589b44e418d833874ed84d4beb8847b780a7c97 (patch)
tree3e4d959e52274e8cbf22475d218fc4495f1c0793
parentcloud-install: add ubuntu/focal support (diff)
cloud install: differnet kernel packages and no firmwares for virtual machines
-rw-r--r--roles/cloud/install/templates/hetzner_postinst.sh.j220
1 files changed, 14 insertions, 6 deletions
diff --git a/roles/cloud/install/templates/hetzner_postinst.sh.j2 b/roles/cloud/install/templates/hetzner_postinst.sh.j2
index df1565c7..613f57ac 100644
--- a/roles/cloud/install/templates/hetzner_postinst.sh.j2
+++ b/roles/cloud/install/templates/hetzner_postinst.sh.j2
@@ -7,13 +7,21 @@ OS_MAJOR_VERSION=$(. /etc/os-release; echo $VERSION_ID | cut -d . -f 1)
export DEBIAN_FRONTEND=noninteractive
apt-get update -q
apt-get full-upgrade -y -q
-apt-get install -y -q --no-install-recommends openssh-server
-if [ "$OS_DISTRO" == "ubuntu" ] && [ "$OS_MAJOR_VERSION" -ge 20 ]; then
- apt-get install -y -q --no-install-recommends python3 python3-apt
-else
- apt-get install -y -q --no-install-recommends python python-apt
-fi
+PYTHON_BASENAME="python"
+if [ "$OS_DISTRO" == "ubuntu" ]; then
+ if [ "$OS_MAJOR_VERSION" -ge 20 ]; then PYTHON_BASENAME="python3"; fi
+{% if cloud_provider == 'hcloud' %}
+ apt-get install -y -q --no-install-recommends linux-image-virtual
+ apt-get purge -y -q linux-image-generic intel-microcode amd64-microcode iucode-tool linux-firmware
+{% endif %}
+elif [ "$OS_DISTRO" == "debian" ]; then
+ if [ "$OS_MAJOR_VERSION" -ge 11 ]; then PYTHON_BASENAME="python3"; fi
+{% if cloud_provider == 'hcloud' %}
+ apt-get purge -y -q intel-microcode amd64-microcode iucode-tool firmware-bnx2x firmware-realtek firmware-linux firmware-linux-free firmware-linux-nonfree
+{% endif %}
+fi
+apt-get install -y -q --no-install-recommends openssh-server "$PYTHON_BASENAME" "$PYTHON_BASENAME-apt"
passwd -d root && passwd -l root
{% if install_distro == "debian" %}