From 012046624239206f4989d64d6d2f2b68b71b805d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 27 Apr 2024 02:26:23 +0200 Subject: autoselection for installer_variant and some more ubunut noble fixes --- .../autoinstall/templates/autoinstall.yml.j2 | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'roles/installer/ubuntu/autoinstall') diff --git a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 index 2a5ad758..7ab7fa91 100644 --- a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 +++ b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 @@ -216,21 +216,28 @@ autoinstall: {% for key in ssh_keys_root %} - {{ key }} {% endfor %} - runcmd: - - [ apt-get, -y, -q, purge, cloud-init, cloud-guest-utils, cloud-initramfs-copymods, cloud-initramfs-dyn-netconf, sosreport, update-notifier-common ] + write_files: + - content: | + #!/bin/bash + apt-get -y -q purge cloud-init cloud-guest-utils cloud-initramfs-copymods cloud-initramfs-dyn-netconf sosreport update-notifier-common {% if ubuntu_autoinstall_desktop is undefined %} - - [ apt-get, -y, -q, purge, snapd, python3-cryptography, gpg, ssh-import-id ] + apt-get -y -q purge snapd python3-cryptography gpg ssh-import-id {% endif %} - - [ rm, -rf, /etc/cloud, /var/lib/cloud ] - - [ apt-get, -y, -q, auto-remove ] - - [ bash, -c, 'dpkg -l | grep "^rc" | awk "{ print(\$2) }" | xargs -r dpkg -P' ] - - [ sed, '/^PasswordAuthentication /d', -i, '/etc/ssh/sshd_config' ] - - [ rm, -f, '/etc/ssh/sshd_config.d/50-cloud-init.conf' ] + rm -rf /etc/cloud /var/lib/cloud + apt-get -y -q auto-remove + dpkg -l | grep "^rc" | awk "{ print(\$2) }" | xargs -r dpkg -P + sed '/^PasswordAuthentication /d' -i '/etc/ssh/sshd_config' + rm -f '/etc/ssh/sshd_config.d/50-cloud-init.conf' + rm -f /root/post-cleanup.sh {% if ubuntu_autoinstall_poweroff_when_done %} - - [ poweroff ] + poweroff {% else %} - - [ reboot ] + reboot {% endif %} + path: /root/post-cleanup.sh + permissions: '0755' + runcmd: + - ['systemd-run', '-p', 'StandardOutput=journal+console', '--on-active=10', '/root/post-cleanup.sh'] ssh: install-server: true -- cgit v1.2.3