Add explicit systemd network names

Ensure NIC naming does not change with systemd versions changing

Change-Id: Ib5b309a37c5ba7b5c606e88aaa01e87c51473f33
This commit is contained in:
Anderson, Craig (ca846m) 2021-02-25 16:15:34 -08:00
parent 9f71952feb
commit 821aa1aa7a
3 changed files with 14 additions and 4 deletions

View File

@ -3,6 +3,8 @@ rootfs_arch: amd64
k8s_version: 1.18.6-00 k8s_version: 1.18.6-00
kernel_base_pkg: linux-image-generic kernel_base_pkg: linux-image-generic
kernel_headers_pkg: linux-headers-generic kernel_headers_pkg: linux-headers-generic
systemd_nic_names_policy: keep kernel database onboard path slot
systemd_nic_alternative_names_policy: database onboard path slot
ubuntu_packages: ubuntu_packages:
- apparmor - apparmor
- apt-file - apt-file

View File

@ -56,10 +56,11 @@
shell: shell:
cmd: "multistrap -f {{ multistrap_tempdir.path }}/multistrap.conf" cmd: "multistrap -f {{ multistrap_tempdir.path }}/multistrap.conf"
#- name: "create grub.cfg" - name: "Set systemd NIC naming"
# shell: template:
# cmd: | src: 99-default.link.j2
# chroot {{ rootfs_root }} update-grub dest: "{{ rootfs_root }}/etc/systemd/network/99-default.link"
mode: '0644'
- name: "Lock sources.list to prevent conflict and duplicates with multistrap repo list" - name: "Lock sources.list to prevent conflict and duplicates with multistrap repo list"
shell: | shell: |

View File

@ -0,0 +1,7 @@
[Match]
OriginalName=*
[Link]
NamePolicy={{ systemd_nic_names_policy }}
AlternativeNamesPolicy={{ systemd_nic_alternative_names_policy }}
MACAddressPolicy=persistent