diff options
author | Christian Pointner <equinox@spreadspace.org> | 2022-09-05 23:22:02 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2022-09-05 23:22:02 +0200 |
commit | f4969bbc97a390adde7a8597ecf23ac495910991 (patch) | |
tree | 8a2b0b11bb3a31c864a8b33b8f6f39ccff206035 /roles/installer/ubuntu/autoinstall | |
parent | Debian 11+ and Ubuntu 22.04+ have exfat support in kernel (diff) |
ubuntu/installer: add support for desktop installs
Diffstat (limited to 'roles/installer/ubuntu/autoinstall')
-rw-r--r-- | roles/installer/ubuntu/autoinstall/defaults/main.yml | 1 | ||||
-rw-r--r-- | roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 | 21 |
2 files changed, 17 insertions, 5 deletions
diff --git a/roles/installer/ubuntu/autoinstall/defaults/main.yml b/roles/installer/ubuntu/autoinstall/defaults/main.yml index 1115442e..a470dfac 100644 --- a/roles/installer/ubuntu/autoinstall/defaults/main.yml +++ b/roles/installer/ubuntu/autoinstall/defaults/main.yml @@ -10,6 +10,7 @@ ubuntu_autoinstall_timezone: Europe/Vienna # ubuntu_autoinstall_kernel_image: ubuntu_autoinstall_virtual_machine: no +# ubuntu_autoinstall_desktop: xubuntu ubuntu_autoinstall_efi_esp_size: 128M diff --git a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 index 7add2640..4d83c6b2 100644 --- a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 +++ b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 @@ -211,7 +211,10 @@ autoinstall: - {{ key }} {% endfor %} runcmd: - - [ apt-get, -y, -q, purge, snapd, cloud-init, cloud-guest-utils, cloud-initramfs-copymods, cloud-initramfs-dyn-netconf, python3-cryptography, gpg, sosreport, update-notifier-common, ssh-import-id ] + - [ 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 ] +{% endif %} - [ rm, -rf, /etc/cloud, /var/lib/cloud ] - [ apt-get, -y, -q, auto-remove ] - [ bash, -c, 'dpkg -l | grep "^rc" | awk "{ print(\$2) }" | xargs dpkg -P' ] @@ -228,6 +231,9 @@ autoinstall: packages: - python3 - python3-apt +{% if ubuntu_autoinstall_desktop is defined %} + - {{ ubuntu_autoinstall_desktop }}-desktop^ +{% endif %} {% for task in ubuntu_autoinstall_install_tasks %} - {{ task }}^ {% endfor %} @@ -237,20 +243,25 @@ autoinstall: {% if ansible_port is defined %} - curtin in-target --target=/target -- sed -e 's/^\(\s*#*\s*Port.*\)/Port {{ ansible_port }}/' -i /etc/ssh/sshd_config {% endif %} - - curtin in-target --target=/target -- apt-mark manual iputils-ping isc-dhcp-client netcat-openbsd netplan.io sudo - - curtin in-target --target=/target -- apt-get -y -q purge policykit-1 multipath-tools ubuntu-minimal unattended-upgrades sound-theme-freedesktop thin-provisioning-tools cryptsetup byobu open-iscsi btrfs-progs pollinate lxd-agent-loader open-vm-tools + - curtin in-target --target=/target -- apt-get -y -q purge multipath-tools open-vm-tools {% if ubuntu_installer_codename != 'focal' %} - curtin in-target --target=/target -- apt-get -y -q purge systemd-oomd {% endif %} -{% if install.disks.primary != "software-raid" %} +{% if ubuntu_autoinstall_desktop is undefined %} + - curtin in-target --target=/target -- apt-mark manual iputils-ping isc-dhcp-client netcat-openbsd netplan.io sudo + - curtin in-target --target=/target -- apt-get -y -q purge policykit-1 ubuntu-minimal unattended-upgrades sound-theme-freedesktop thin-provisioning-tools cryptsetup byobu open-iscsi btrfs-progs pollinate lxd-agent-loader +{% if install.disks.primary != "software-raid" %} - curtin in-target --target=/target -- apt-get -y -q purge mdadm -{% endif %} +{% endif %} - curtin in-target --target=/target -- env SUDO_FORCE_REMOVE=yes apt-get -y -q purge sudo +{% endif %} - curtin in-target --target=/target -- apt-get -y -q autoremove - curtin in-target --target=/target -- bash -c 'dpkg -l | grep "^rc" | awk "{ print(\$2) }" | xargs dpkg -P' +{% if ubuntu_autoinstall_desktop is undefined %} {# purging the snapd package here would trigger a bug in den postrm script because some filesystems in /run/ can not be unmounted... #} {# to workadound this issue we only remove the package here and rely on cloud-init to fully purge it on first boot (see user-data: above) #} - curtin in-target --target=/target -- apt-get -y -q remove snapd +{% endif %} - curtin in-target --target=/target -- bash -c 'apt-get update -q && apt-get full-upgrade -y -q' {% if ubuntu_autoinstall_kernel_image is defined or ubuntu_autoinstall_virtual_machine %} |