summaryrefslogtreecommitdiff
path: root/vmdebootstrap/network.py
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2016-07-31 14:47:40 +0100
committerNeil Williams <codehelp@debian.org>2016-07-31 14:47:40 +0100
commit7c065342c39f410faf2a7b9806ce1c16e774785c (patch)
tree6f18f1f5c82a5b0522f464bed696cfe5ca5b8939 /vmdebootstrap/network.py
parent68193d8c674402b5b19eae091ccc07a207080fa2 (diff)
downloadvmdebootstrap-7c065342c39f410faf2a7b9806ce1c16e774785c.tar.gz
Add support for systemd-resolved
For Jessie, --enable-dhcp is still needed to get a usable interface other than lo. For Stretch and later, --enable-dhcp is redundant if systemd-networkd is enabled. Add note to the docs.
Diffstat (limited to 'vmdebootstrap/network.py')
-rw-r--r--vmdebootstrap/network.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/vmdebootstrap/network.py b/vmdebootstrap/network.py
index 2e74c73..bed5134 100644
--- a/vmdebootstrap/network.py
+++ b/vmdebootstrap/network.py
@@ -91,8 +91,6 @@ class Networking(Base):
https://coreos.com/os/docs/latest/network-config-with-networkd.html
http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
"""
- if not self.settings['enable-dhcp']:
- return
self.message('Enabling systemd-networkd for DHCP')
ethpath = os.path.join(rootdir, 'etc', 'systemd', 'network', '99-dhcp.network')
with open(ethpath, 'w') as eth:
@@ -102,6 +100,10 @@ class Networking(Base):
eth.write('DHCP=yes\n')
runcmd(['chroot', rootdir, 'systemctl', 'enable', 'systemd-networkd'])
+ def enable_systemd_resolved(self, rootdir):
+ """
+ only for unstable or testing, not present in jessie
+ """
self.message('Enabling systemctl-resolved for DNS')
runcmd(['chroot', rootdir, 'systemctl', 'enable', 'systemd-resolved'])
runcmd(['chroot', rootdir, 'ln', '-sfT',