summaryrefslogtreecommitdiff
path: root/roles/installer/ubuntu/autoinstall/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2024-04-27 02:26:23 +0200
committerChristian Pointner <equinox@spreadspace.org>2024-04-27 02:26:23 +0200
commit012046624239206f4989d64d6d2f2b68b71b805d (patch)
tree412d453b1e18f12c4e2499b89a82ba297e1ba30b /roles/installer/ubuntu/autoinstall/templates
parentinitial support for ubuntu 24.04 (diff)
autoselection for installer_variant and some more ubunut noble fixes
Diffstat (limited to 'roles/installer/ubuntu/autoinstall/templates')
-rw-r--r--roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j227
1 files changed, 17 insertions, 10 deletions
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