summaryrefslogtreecommitdiff
path: root/roles
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
parentinitial support for ubuntu 24.04 (diff)
autoselection for installer_variant and some more ubunut noble fixes
Diffstat (limited to 'roles')
-rw-r--r--roles/apt-repo/base/tasks/main.yml16
-rw-r--r--roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j227
-rw-r--r--roles/vm/guest/install/tasks/main.yml9
3 files changed, 26 insertions, 26 deletions
diff --git a/roles/apt-repo/base/tasks/main.yml b/roles/apt-repo/base/tasks/main.yml
index 132f7702..668f6453 100644
--- a/roles/apt-repo/base/tasks/main.yml
+++ b/roles/apt-repo/base/tasks/main.yml
@@ -5,6 +5,14 @@
dest: /etc/apt/sources.list
register: apt_repo_base_sources
+- name: remove new-style ubuntu apt source entries
+ loop:
+ - ubuntu.sources
+ - ubuntu.sources.curtin.orig
+ file:
+ path: "/etc/apt/sources.list.d/{{ item }}"
+ state: absent
+
- name: update apt cache
when: apt_repo_base_sources is changed
command: apt-get update
@@ -26,11 +34,3 @@
file:
path: /etc/apt/apt.conf.d/20apt-esm-hook.conf
state: absent
-
-- name: remove new-style ubuntu apt source entries
- loop:
- - ubuntu.sources
- - ubuntu.sources.curtin.orig
- file:
- path: "/etc/apt/sources.list.d/{{ item }}"
- state: absent
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
diff --git a/roles/vm/guest/install/tasks/main.yml b/roles/vm/guest/install/tasks/main.yml
index 0cb7b925..e79a3ef5 100644
--- a/roles/vm/guest/install/tasks/main.yml
+++ b/roles/vm/guest/install/tasks/main.yml
@@ -41,14 +41,7 @@
state: directory
register: vm_install_tmpdir
- - when: install_distro in ['debian', 'kali']
- include_tasks: installer-debian.yml
-
- - when: install_distro in ['ubuntu']
- include_tasks: installer-ubuntu.yml
-
- - when: install_distro in ['openbsd']
- include_tasks: installer-openbsd.yml
+ - include_tasks: "installer-{{ installer_variant }}.yml"
- name: Make installer workdir readable by qemu
acl: