Disable predictable NIC names for >=stretch

This is just a compabibility hack for now, we should figure
out how to get this working properly.
Issue: #245
Thanks to @apolloclark for this one.
This commit is contained in:
Anders Ingemann 2016-06-04 16:52:22 +02:00
parent 46d4424c65
commit 0614952014
2 changed files with 10 additions and 0 deletions

View file

@ -2,6 +2,11 @@ Changelog
=========
2016-06-04
----------
Anders Ingemann
* Disable persistent network interface names for >=stretch
2016-06-02
----------
Peter Wagner

View file

@ -22,8 +22,13 @@ class ConfigureGrub(Task):
@classmethod
def run(cls, info):
from bootstrapvz.common.releases import stretch
from bootstrapvz.common.tools import sed_i
grub_def = os.path.join(info.root, 'etc/default/grub')
if info.manifest.release >= stretch:
# Disable "Predictable Network Interface Names"
# See issue #245 for more details
sed_i(grub_def, '^GRUB_CMDLINE_LINUX=""', 'GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"')
sed_i(grub_def, '^#GRUB_TERMINAL=console', 'GRUB_TERMINAL=console')
sed_i(grub_def, '^GRUB_CMDLINE_LINUX_DEFAULT="quiet"',
'GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"')