diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-07-16 21:51:02 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-07-16 21:51:02 +0200 |
commit | fda8b1d384178b45ff2dc0759a76278fa3525e2c (patch) | |
tree | 1bbd8ac1643e1a4fae977c78db35955868f39f9f /roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 | |
parent | ch-router: make firewall script a little bit nicer (diff) | |
parent | final tests with net ifname namepolicy succeeded (diff) |
Merge branch 'buster-unpredictable-network-ifnames'
Diffstat (limited to 'roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2')
-rw-r--r-- | roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 b/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 index f4b0fff1..5fcab0aa 100644 --- a/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 +++ b/roles/preseed/templates/preseed_ubuntu-bionic.cfg.j2 @@ -141,8 +141,14 @@ 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 -m 0700 /target/root/.ssh; \ - cp /authorized_keys /target/root/.ssh/; \ +{% 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 'NamePolicy={{ preseed_force_net_ifnames_policy }}' >> /etc/systemd/network/90-namepolicy.link"; \ + in-target bash -c "update-initramfs -u"; \ +{% endif %} {% if hostvars[hostname].ansible_port is defined %} - in-target bash -c "sed -e 's/^\(\s*#*\s*Port.*\)/Port {{ hostvars[hostname].ansible_port }}/' -i /etc/ssh/sshd_config" + in-target bash -c "sed -e 's/^\(\s*#*\s*Port.*\)/Port {{ hostvars[hostname].ansible_port }}/' -i /etc/ssh/sshd_config"; \ {% endif %} + mkdir -p -m 0700 /target/root/.ssh; \ + cp /authorized_keys /target/root/.ssh/ |