From d8cad6edea49880eb93f8376c2425dfce4ed6716 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 5 Sep 2022 18:42:45 +0200 Subject: ubuntu/installer: fix early command and focal support --- roles/installer/ubuntu/autoinstall/files/early-command.py | 8 +++----- roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'roles/installer/ubuntu/autoinstall') diff --git a/roles/installer/ubuntu/autoinstall/files/early-command.py b/roles/installer/ubuntu/autoinstall/files/early-command.py index 93d72b2d..0be450c9 100644 --- a/roles/installer/ubuntu/autoinstall/files/early-command.py +++ b/roles/installer/ubuntu/autoinstall/files/early-command.py @@ -15,11 +15,9 @@ try: for c in config['storage']['config']: if 'type' not in c or c['type'] != 'disk' or 'path' not in c: continue - c['path'] = os.path.realpath(c['path']) - - with open('/autoinstall.yaml', 'w') as file: - yaml.dump(config, file, default_flow_style=False) - except KeyError: pass + +with open('/autoinstall.yaml', 'w') as file: + yaml.dump(config, file, default_flow_style=False) diff --git a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 index 8bf62cd5..7add2640 100644 --- a/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 +++ b/roles/installer/ubuntu/autoinstall/templates/autoinstall.yml.j2 @@ -238,7 +238,10 @@ autoinstall: - 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 systemd-oomd + - 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 +{% if ubuntu_installer_codename != 'focal' %} + - curtin in-target --target=/target -- apt-get -y -q purge systemd-oomd +{% endif %} {% if install.disks.primary != "software-raid" %} - curtin in-target --target=/target -- apt-get -y -q purge mdadm {% endif %} -- cgit v1.2.3