summaryrefslogtreecommitdiff
path: root/cloudinit/distros/debian.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-06-20 17:10:45 -0400
committerScott Moser <smoser@ubuntu.com>2016-06-20 17:10:45 -0400
commite6b594bf2bf4cd40bbfbe9581c2b62f3b77e9123 (patch)
treec67eaf601903947d866fe5d2bfdc9e8078927f4d /cloudinit/distros/debian.py
parent776b0cfe847f531d8d5a235f52673c3da1f06064 (diff)
parent4fc10ef3f349e6280e2002d980c4c63e6a741d2f (diff)
downloadvyos-cloud-init-e6b594bf2bf4cd40bbfbe9581c2b62f3b77e9123.tar.gz
vyos-cloud-init-e6b594bf2bf4cd40bbfbe9581c2b62f3b77e9123.zip
do not render systemd.link files
When fixing bug 1579130, we made cloud-init rename devices itself, rather than relying on the systemd.link files to do that. That was necessary to - rename devices in a container - rename devices on first boot or in any situation when the link files in the initramfs were stale. However, cloud-init was still writing .link files like: /etc/systemd/network/50-cloud-init-ens2.link That leads to just a confusing situation as cloud-init will trump any renaming systemd does in all cases. Also added here is a header into the rendered ENI file: /etc/network/interfaces.d/50-cloud-init.cfg that describes how to disable cloud-init networking. LP: #1594546
Diffstat (limited to 'cloudinit/distros/debian.py')
-rw-r--r--cloudinit/distros/debian.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py
index 53f3aa4d..5ae9a509 100644
--- a/cloudinit/distros/debian.py
+++ b/cloudinit/distros/debian.py
@@ -43,6 +43,13 @@ APT_GET_WRAPPER = {
'enabled': 'auto',
}
+ENI_HEADER = """# This file is generated from information provided by
+# the datasource. Changes to it will not persist across an instance.
+# To disable cloud-init's network configuration capabilities, write a file
+# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
+# network: {config: disabled}
+"""
+
class Distro(distros.Distro):
hostname_conf_fn = "/etc/hostname"
@@ -59,7 +66,8 @@ class Distro(distros.Distro):
self.osfamily = 'debian'
self._net_renderer = eni.Renderer({
'eni_path': self.network_conf_fn,
- 'links_prefix_path': self.links_prefix,
+ 'eni_header': ENI_HEADER,
+ 'links_prefix_path': None,
'netrules_path': None,
})