summaryrefslogtreecommitdiff
path: root/roles/cloud
diff options
context:
space:
mode:
Diffstat (limited to 'roles/cloud')
-rw-r--r--roles/cloud/install/templates/hetzner_postinst.sh.j211
1 files changed, 10 insertions, 1 deletions
diff --git a/roles/cloud/install/templates/hetzner_postinst.sh.j2 b/roles/cloud/install/templates/hetzner_postinst.sh.j2
index 39a3fd7d..df1565c7 100644
--- a/roles/cloud/install/templates/hetzner_postinst.sh.j2
+++ b/roles/cloud/install/templates/hetzner_postinst.sh.j2
@@ -1,10 +1,19 @@
#!/bin/bash
set -euf -o pipefail
+OS_DISTRO=$(. /etc/os-release; echo $ID)
+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 python python-apt
+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
+
passwd -d root && passwd -l root
{% if install_distro == "debian" %}