diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | cloudinit/config/cc_update_etc_hosts.py | 5 | ||||
-rw-r--r-- | templates/hosts.debian.tmpl (renamed from templates/hosts.ubuntu.tmpl) | 0 |
3 files changed, 4 insertions, 2 deletions
@@ -32,6 +32,7 @@ - support grouping linux distros into "os_families". This allows a module to operate on the family (redhat or debian) rather than the distro (ubuntu, debian, fedora, rhel) (LP: #1100029) + - fix /etc/hosts writing when templates are used (LP: #1100036) 0.7.1: - sysvinit: fix missing dependency in cloud-init job for RHEL 5.6 - config-drive: map hostname to local-hostname (LP: #1061964) diff --git a/cloudinit/config/cc_update_etc_hosts.py b/cloudinit/config/cc_update_etc_hosts.py index 96103615..d3dd1f32 100644 --- a/cloudinit/config/cc_update_etc_hosts.py +++ b/cloudinit/config/cc_update_etc_hosts.py @@ -37,10 +37,11 @@ def handle(name, cfg, cloud, log, _args): # Render from a template file tpl_fn_name = cloud.get_template_filename("hosts.%s" % - (cloud.distro.name)) + (cloud.distro.osfamily)) if not tpl_fn_name: raise RuntimeError(("No hosts template could be" - " found for distro %s") % (cloud.distro.name)) + " found for distro %s") % + (cloud.distro.osfamily)) templater.render_to_file(tpl_fn_name, '/etc/hosts', {'hostname': hostname, 'fqdn': fqdn}) diff --git a/templates/hosts.ubuntu.tmpl b/templates/hosts.debian.tmpl index ae120b02..ae120b02 100644 --- a/templates/hosts.ubuntu.tmpl +++ b/templates/hosts.debian.tmpl |