summaryrefslogtreecommitdiff
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
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.
-rw-r--r--doc/overview.rst9
-rw-r--r--vmdebootstrap/network.py6
2 files changed, 13 insertions, 2 deletions
diff --git a/doc/overview.rst b/doc/overview.rst
index 65f039a..2d9b8c0 100644
--- a/doc/overview.rst
+++ b/doc/overview.rst
@@ -234,6 +234,15 @@ If DHCP is also enabled, the following configuration is used::
overridden by putting another file into place using the customisation
scripts, using a lower sorting filename.
+Stretch and later
+-----------------
+
+There is no need to use the ``--enable-dhcp`` option when using
+``systemd`` for networking with stretch or sid. ``systemd-resolved`` is
+enabled instead if ``systemd-networkd`` is specified. (``--enable-dhcp``
+would simply add an unused entry to ``/etc/network/interfaces`` for
+``eth0``.)
+
::
[Match]
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',