summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roles/preseed/defaults/main.yml2
-rw-r--r--roles/preseed/templates/preseed_ubuntu-bionic.cfg.j24
-rw-r--r--roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j24
-rw-r--r--roles/vm/install/tasks/main.yml1
4 files changed, 11 insertions, 0 deletions
diff --git a/roles/preseed/defaults/main.yml b/roles/preseed/defaults/main.yml
index b120f133..c5400493 100644
--- a/roles/preseed/defaults/main.yml
+++ b/roles/preseed/defaults/main.yml
@@ -1,2 +1,4 @@
---
#preseed_force_net_ifnames_policy: path
+
+preseed_no_netplan: no
diff --git a/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 b/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2
index 92bb00af..a2fffd11 100644
--- a/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2
+++ b/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2
@@ -13,7 +13,9 @@ d-i keyboard-configuration/layoutcode string us
d-i hw-detect/load_firmware boolean false
+{% if preseed_no_netplan %}
d-i netcfg/do_not_use_netplan boolean true
+{% endif %}
d-i netcfg/choose_interface select {{ install_interface | default(hostvars[hostname].network_cooked.primary.interface) }}
{% if 'install_dhcp' in hostvars[hostname] and hostvars[hostname].install_dhcp %}
d-i netcfg/disable_dhcp boolean false
@@ -140,7 +142,9 @@ d-i preseed/late_command string \
lvremove -f {{ hostvars[hostname].host_name }}/dummy; \
in-target bash -c "swapoff -a; sed -e '/^\/swapfile/d' -i /etc/fstab; rm -f /swapfile"; \
in-target bash -c "apt-get update -q && apt-get full-upgrade -y -q"; \
+{% if preseed_no_netplan %}
in-target bash -c "apt-get purge -y -q netplan.io && apt-get autoremove -y -q && rm -rf /etc/netplan"; \
+{% endif %}
in-target bash -c "sed -e 's/^allow-hotplug/auto/' -i /etc/network/interfaces"; \
{% if preseed_force_net_ifnames_policy is defined %}
mkdir -p /target/etc/systemd/network; \
diff --git a/roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j2 b/roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j2
index 50dcfc7c..22f47ce7 100644
--- a/roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j2
+++ b/roles/preseed/templates/preseed_xubuntu-cosmic-desktop-with-raid.cfg.j2
@@ -16,7 +16,9 @@ d-i console-setup/ask_detect boolean false
d-i hw-detect/load_firmware boolean false
+{% if preseed_no_netplan %}
d-i netcfg/do_not_use_netplan boolean true
+{% endif %}
d-i netcfg/choose_interface select {{ install_interface | default(hostvars[hostname].network_cooked.primary.interface) }}
{% if 'install_dhcp' in hostvars[hostname] and hostvars[hostname].install_dhcp %}
d-i netcfg/disable_dhcp boolean false
@@ -146,7 +148,9 @@ d-i preseed/late_command string \
lvremove -f {{ hostvars[hostname].host_name }}/dummy; \
in-target bash -c "swapoff -a; sed -e '/^\/swapfile/d' -i /etc/fstab; rm -f /swapfile"; \
in-target bash -c "apt-get update -q && apt-get full-upgrade -y -q"; \
+{% if preseed_no_netplan %}
in-target bash -c "apt-get purge -y -q netplan.io && apt-get autoremove -y -q && rm -rf /etc/netplan"; \
+{% endif %}
in-target bash -c "sed -e 's/^allow-hotplug/auto/' -i /etc/network/interfaces"; \
{% if preseed_force_net_ifnames_policy is defined %}
mkdir -p /target/etc/systemd/network; \
diff --git a/roles/vm/install/tasks/main.yml b/roles/vm/install/tasks/main.yml
index a79d5074..162ece24 100644
--- a/roles/vm/install/tasks/main.yml
+++ b/roles/vm/install/tasks/main.yml
@@ -34,6 +34,7 @@
ssh_keys_root: "{{ hostvars[hostname].ssh_keys_root }}"
preseed_tmpdir: "{{ tmpdir.path }}"
preseed_force_net_ifnames_policy: path
+ preseed_no_netplan: yes
install_interface: enp1s1
- name: Make preseed workdir readable by qemu