Use hostname -s instead of hostnamectl --transient
authorDan Prince <dprince@redhat.com>
Wed, 14 Dec 2016 20:48:07 +0000 (15:48 -0500)
committerDan Prince <dprince@redhat.com>
Wed, 14 Dec 2016 20:48:07 +0000 (15:48 -0500)
This patch updates the deployed-server interface to use a
simple hostname -s. The previous hostnamectl --transient
can pick up extra domain name configuration in some cases
that can cause very odd hostname generation if used
with the tripleo-heat-template host file generation.

This would actually break the new undercloud t-h-t installer
in that some of the /etc/hosts entries would be invalid
(no IP address) due to substring replacements failing in
a variety of odd hostname situations. Simplifying the
hostname of deployed servers to just the short version seems
the most sensable way to avoid all this.

Change-Id: Ia7e636d021f948ea5234475cef02f666d8ce6999

deployed-server/deployed-server.yaml

index 22797c2..4f8c1c7 100644 (file)
@@ -69,7 +69,7 @@ resources:
           #!/bin/bash
           set -eux
           mkdir -p $heat_outputs_path
-          host=$(hostnamectl --transient)
+          host=$(hostname -s)
           echo -n $host > $heat_outputs_path.hostname
           cat $heat_outputs_path.hostname
       outputs: