summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-05-31 04:11:07 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-05-31 04:11:07 +0200
commit000a5c1501da6575460d96b47e8918a359ff0b49 (patch)
treedb30256fc5833b6b1ab3c37a8f5f56c04e9524fc /roles
parentadd riot-desktop to ch-equinox-ws (diff)
cloud-install: add ubuntu/focal support
Diffstat (limited to 'roles')
-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" %}