Fixing the possibility to disable network interfaces from NM: do not presume eth0 is the network interface.

This commit is contained in:
Emiliano Vavassori 2019-11-20 00:51:41 +01:00
parent b40ddd873b
commit d0c5109586
1 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,7 @@
---
# Fixing NetworkManager issues.
# Since students are disabling deliberately the network interface from
# NetworkManager, we insert the default interface in /etc/network/interfaces
# so they are not available to NM
- name: Ensuring first NIC will never be disabled again
lineinfile:
@ -9,10 +11,10 @@
insertafter: EOF
with_items:
- " "
- "auto eth0"
- "iface eth0 inet dhcp"
- "auto {{ ansible_default_ipv4.interface }}"
- "iface {{ ansible_default_ipv4.interface }} inet dhcp"
# Hiding icon for any sessions
# Hiding NetworkManager icon from any sessions
- name: Disabling NetworkManager from popping up in sessions
shell: mv /etc/xdg/autostart/nm-applet.desktop /etc/xdg/autostart/nm-applet.desktop.disabled