summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorDominic Schlegel <dominic.schlegel@hostpoint.ch>2018-03-15 12:47:42 -0400
committerScott Moser <smoser@brickies.net>2018-03-15 12:47:42 -0400
commitb389b196c834e4eaf9020952a92cd471ced599d2 (patch)
treea27b844510628d193179886433bb502426108fc3 /cloudinit
parent2f5d4cebb243cf2f30c665f034668ba4b14178f9 (diff)
downloadvyos-cloud-init-b389b196c834e4eaf9020952a92cd471ced599d2.tar.gz
vyos-cloud-init-b389b196c834e4eaf9020952a92cd471ced599d2.zip
FreeBSD: Set hostname to FQDN.
FreeBSD requires the hostname to be set to FQDN. Previously the hostname just got set to short hostname (without FQDN part). Now cloud-init does set the hostname to the FQDN on FreeBSD hosts if a valid FQDN is given. LP: #1753499
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/distros/freebsd.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cloudinit/distros/freebsd.py b/cloudinit/distros/freebsd.py
index aa468bca..754d3df6 100644
--- a/cloudinit/distros/freebsd.py
+++ b/cloudinit/distros/freebsd.py
@@ -132,6 +132,12 @@ class Distro(distros.Distro):
LOG.debug("Using network interface %s", bsddev)
return bsddev
+ def _select_hostname(self, hostname, fqdn):
+ # Should be FQDN if available. See rc.conf(5) in FreeBSD
+ if fqdn:
+ return fqdn
+ return hostname
+
def _read_system_hostname(self):
sys_hostname = self._read_hostname(filename=None)
return ('rc.conf', sys_hostname)