Antoine Musso 23be09ce35 debian: cloud hostname ignored by Jessie
5af25b5f fixed the hostname of Debian images to "debian" since a lack of
hostname definition set the hostname to "(None)".

It has been done by introducing /etc/cloud/cloud.cfg.d/01_hostname.cfg
with content:

  hostname: debian

Review supposed the hostname would be overriden by cloud meta-data. That
might have stand true for Wheezy but it is not the case for Jessie.

cloud-init 0.7.6 ignores cloud metadata whenever "hostname" or "fqdn"
are set in a config file. Roughly:

    # no fqdn set, get fqdn from cloud
    # get hostname from cfg if available otherwise cloud
    fqdn = cloud.get_hostname(fqdn=True)
    if "hostname" in cfg:
        # hashar: set from config file NOT cloud
        hostname = cfg['hostname']
    else:
        # fallback to cloud
        hostname = cloud.get_hostname()

Relevant code is
https://github.com/number5/cloud-init/blob/0.7.6/cloudinit/util.py#L839-L860

Only inject "hostname: debian" for the Wheezy release.

Bug: https://phabricator.wikimedia.org/T117283
Change-Id: I6e2522bd725cbf9651f11c76ecdc72ecbc92f402
2015-10-30 22:34:10 +01:00
..
2015-05-17 02:07:40 +00:00
2015-02-12 10:41:32 +11:00
2015-10-13 17:54:09 -07:00
2015-06-02 05:35:03 +00:00
2015-02-12 10:41:32 +11:00
2015-09-23 23:55:18 -07:00
2015-02-12 10:41:32 +11:00
2015-02-12 10:41:32 +11:00
2015-06-26 09:57:12 +08:00
2015-07-01 22:03:50 +02:00
2015-02-12 10:41:32 +11:00
2015-10-12 15:31:09 -05:00
2015-02-12 10:41:32 +11:00
2015-03-04 23:11:27 +00:00
2015-02-12 10:41:32 +11:00