forked from infra/ansible
common: fix network interfaces names
(ensXX -> ethX) in consistent way with systems upgraded from debian 8
This commit is contained in:
parent
0622787e0c
commit
66c36c4896
10
roles/common/files/50-virtio-kernel-names.link
Normal file
10
roles/common/files/50-virtio-kernel-names.link
Normal file
@ -0,0 +1,10 @@
|
||||
# udev 226 introduced predictable interface names for virtio;
|
||||
# disable this for upgrades. You can remove this file if you update your
|
||||
# network configuration to move to the ens* names instead.
|
||||
# See /usr/share/doc/udev/README.Debian.gz for details about predictable
|
||||
# network interface names.
|
||||
[Match]
|
||||
Driver=virtio_net
|
||||
|
||||
[Link]
|
||||
NamePolicy=onboard kernel
|
6
roles/common/files/99-default.link
Normal file
6
roles/common/files/99-default.link
Normal file
@ -0,0 +1,6 @@
|
||||
# This machine is most likely a virtualized guest, where the old persistent
|
||||
# network interface mechanism (75-persistent-net-generator.rules) did not work.
|
||||
# This file disables /lib/systemd/network/99-default.link to avoid
|
||||
# changing network interface names on upgrade. Please read
|
||||
# /usr/share/doc/udev/README.Debian.gz about how to migrate to the currently
|
||||
# supported mechanism.
|
@ -63,6 +63,15 @@
|
||||
copy: src=resume dest=/etc/initramfs-tools/conf.d/resume
|
||||
notify: update-initramfs
|
||||
|
||||
# TODO template /etc/network/interfaces
|
||||
|
||||
- name: Fix network interface names
|
||||
copy: src={{ item }} dest=/etc/systemd/network/{{ item }}
|
||||
with_items:
|
||||
- 50-virtio-kernel-names.link
|
||||
- 99-default.link
|
||||
notify: update-initramfs
|
||||
|
||||
- name: Prevent normal users from running su
|
||||
lineinfile:
|
||||
path: /etc/pam.d/su
|
||||
|
Loading…
Reference in New Issue
Block a user