summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roles/preseed/tasks/main.yml14
-rw-r--r--roles/preseed/templates/preseed_debian-buster.cfg.j24
2 files changed, 18 insertions, 0 deletions
diff --git a/roles/preseed/tasks/main.yml b/roles/preseed/tasks/main.yml
index 8e00fb82..c32a032e 100644
--- a/roles/preseed/tasks/main.yml
+++ b/roles/preseed/tasks/main.yml
@@ -17,6 +17,16 @@
path: "{{ preseed_tmpdir }}/authorized_keys"
key: "{{ ssh_keys_root | join('\n') }}"
+## TODO: make this nicer (only needed für debian buster? does it work with others too?)
+- file:
+ path: "{{ preseed_tmpdir }}/etc/systemd/network"
+ state: directory
+- copy:
+ dest: "{{ preseed_tmpdir }}/etc/systemd/network/90-namepolicy-path.link"
+ content: |
+ [Link]
+ NamePolicy=path
+
- name: Inject files into initramfs
shell: cpio -H newc -o | gzip -9 >> 'initrd.preseed.gz'
args:
@@ -24,5 +34,9 @@
stdin: |
preseed.cfg
authorized_keys
+ etc/
+ etc/systemd/
+ etc/systemd/network/
+ etc/systemd/network/90-namepolicy-path.link
tags:
- skip_ansible_lint
diff --git a/roles/preseed/templates/preseed_debian-buster.cfg.j2 b/roles/preseed/templates/preseed_debian-buster.cfg.j2
index 6e9f4e47..44d8a814 100644
--- a/roles/preseed/templates/preseed_debian-buster.cfg.j2
+++ b/roles/preseed/templates/preseed_debian-buster.cfg.j2
@@ -134,6 +134,10 @@ d-i preseed/late_command string \
in-target bash -c "apt-get update -q && apt-get full-upgrade -y -q"; \
in-target bash -c "passwd -d root && passwd -l root"; \
in-target bash -c "sed -e 's/^allow-hotplug/auto/' -i /etc/network/interfaces"; \
+ mkdir -p /target/etc/systemd/network; \
+ bash -c "echo '[Link]' > /target/etc/systemd/network/90-namepolicy-path.link"; \
+ bash -c "echo 'NamePolicy=path' >> /target/etc/systemd/network/90-namepolicy-path.link"; \
+ in-target bash -c "update-initramfs -u"; \
mkdir -p -m 0700 /target/root/.ssh; \
cp /authorized_keys /target/root/.ssh/; \
{% if hostvars[hostname].ansible_port is defined %}