summaryrefslogtreecommitdiff
path: root/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-06-22 02:37:11 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-06-22 02:37:11 +0200
commit5a35c210ddb64998586b69b921e8d721395f09d5 (patch)
tree9a65e26f147c59ab379e1cd23a1baf60ac5d5264 /roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
parentMerge branch 'topic/kubernetes-network-plugins' (diff)
parentconverted other physical machines to new network config (diff)
Merge branch 'topic/network-interfaces-variables-refactoring'
Diffstat (limited to 'roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2')
-rw-r--r--roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j211
1 files changed, 7 insertions, 4 deletions
diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
index 093bfdc5..ca018fd2 100644
--- a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
@@ -16,15 +16,15 @@ 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[install_hostname].network_cooked.primary.interface) }}
+d-i netcfg/choose_interface select {{ install_interface | default(hostvars[install_hostname].network_cooked.primary.name) }}
{% if 'install_dhcp' in hostvars[install_hostname] and hostvars[install_hostname].install_dhcp %}
d-i netcfg/disable_dhcp boolean false
d-i netcfg/disable_autoconfig boolean false
{% else %}
d-i netcfg/disable_dhcp boolean true
d-i netcfg/disable_autoconfig boolean true
-d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.ip }}
-d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.mask }}
+d-i netcfg/get_ipaddress string {{ hostvars[install_hostname].network_cooked.primary.address | ipaddr('address') }}
+d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.address | ipaddr('netmask') }}
d-i netcfg/get_gateway string {{ hostvars[install_hostname].network_cooked.primary.gateway }}
d-i netcfg/get_nameservers string {{ hostvars[install_hostname].network_cooked.nameservers | join(' ') }}
d-i netcfg/confirm_static boolean true
@@ -152,7 +152,10 @@ d-i preseed/late_command string \
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; \
- in-target bash -c "echo '[Link]' > /etc/systemd/network/90-namepolicy.link"; \
+ in-target bash -c "echo '[Match]' > /etc/systemd/network/90-namepolicy.link"; \
+ in-target bash -c "echo 'OriginalName=*' >> /etc/systemd/network/90-namepolicy.link"; \
+ in-target bash -c "echo '' >> /etc/systemd/network/90-namepolicy.link"; \
+ in-target bash -c "echo '[Link]' >> /etc/systemd/network/90-namepolicy.link"; \
in-target bash -c "echo 'NamePolicy={{ preseed_force_net_ifnames_policy }}' >> /etc/systemd/network/90-namepolicy.link"; \
in-target bash -c "update-initramfs -u"; \
{% endif %}