summaryrefslogtreecommitdiff
path: root/roles/installer/debian/preseed
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-06-21 04:11:47 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-06-21 04:11:47 +0200
commit742ab1e5e72c4f7b6678cf586309d6d98d96272d (patch)
tree2e3b0e54ee28c0b5a8c7849be61ca511d28d4e97 /roles/installer/debian/preseed
parentinitial tests with new network config (diff)
further improved network config
Diffstat (limited to 'roles/installer/debian/preseed')
-rw-r--r--roles/installer/debian/preseed/tasks/main.yml3
-rw-r--r--roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j24
-rw-r--r--roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j29
-rw-r--r--roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j24
-rw-r--r--roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j24
-rw-r--r--roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j24
-rw-r--r--roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j29
-rw-r--r--roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j24
-rw-r--r--roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j24
9 files changed, 27 insertions, 18 deletions
diff --git a/roles/installer/debian/preseed/tasks/main.yml b/roles/installer/debian/preseed/tasks/main.yml
index aa71335e..46d6a1d9 100644
--- a/roles/installer/debian/preseed/tasks/main.yml
+++ b/roles/installer/debian/preseed/tasks/main.yml
@@ -29,6 +29,9 @@
copy:
dest: "{{ preseed_tmpdir }}/etc/systemd/network/90-namepolicy.link"
content: |
+ [Match]
+ OriginalName=*
+
[Link]
NamePolicy={{ preseed_force_net_ifnames_policy }}
diff --git a/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2
index b92aa1eb..ca4cc37e 100644
--- a/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_debian-buster-with-raid.cfg.j2
@@ -16,8 +16,8 @@ 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.prefix | ipaddr('address') }}
+d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | 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
diff --git a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2
index dd0aa0ab..5b7e12e9 100644
--- a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2
@@ -16,8 +16,8 @@ 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.prefix | ipaddr('address') }}
+d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | 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
@@ -135,7 +135,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 %}
diff --git a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2
index 453349db..f4448dbd 100644
--- a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2
@@ -16,8 +16,8 @@ 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.prefix | ipaddr('address') }}
+d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | 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
diff --git a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2
index da33c0f5..0896c569 100644
--- a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2
@@ -16,8 +16,8 @@ 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.prefix | ipaddr('address') }}
+d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | 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
diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2
index ab18b8a2..df3b6e90 100644
--- a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2
@@ -23,8 +23,8 @@ 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.prefix | ipaddr('address') }}
+d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | 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
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 33cf0738..4b13133c 100644
--- a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2
@@ -23,8 +23,8 @@ 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.prefix | ipaddr('address') }}
+d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | 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 %}
diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2
index b86d7523..d84ab9a6 100644
--- a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2
@@ -20,8 +20,8 @@ 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.prefix | ipaddr('address') }}
+d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | 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
diff --git a/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2
index e20825bf..02efc018 100644
--- a/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2
+++ b/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2
@@ -26,8 +26,8 @@ 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.prefix | ipaddr('address') }}
+d-i netcfg/get_netmask string {{ hostvars[install_hostname].network_cooked.primary.prefix | 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