Can't use Autoinstaller in cloud-init script
I am trying to use the autoinstaller on a debian 11 VM via the following cloud-init script:
#cloud-config
preserve_hostname: false
fqdn: server.btcpay.host
hostname: server
prefer_fqdn_over_hostname: true
manage_etc_hosts: true
runcmd:
- echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
- systemctl restart ssh
- apt-get update
- apt-get -y dist-upgrade
- wget -O - https://get.ispconfig.org | sh -s -- --unattended-upgrades --use-php=8.0,8.1 --i-know-what-i-am-doing
- tail -n10 /var/log/cloud-init-output.log > /etc/motd
- echo "Please overwrite /etc/motd after you obtained your credentials!" >> /etc/motd
My problem now is that the autoinstall script fails at TTY detection with the following error:
sh: 69: cannot open /dev/?: No such file
From my understanding the code in line 69 shouldn't be needed, because I'm running in non-interactive (i-know-what-i-am-doing) mode.
It would help me imensly if someone could restructure the code between line 67 and 73, so that TTY is only querried when it is actually needed.
Being able to use the autoinstaller in cloud-init enviroments would add quite a bit of value.