summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-04-02 12:00:36 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-04-02 12:00:36 -0300
commit25fb72320e31f97809e915fc00b0ef0505e4fd21 (patch)
treeb2f50f2d0f1b3c25b7497d3cfd83a67ef635c4f7
parentecb42a7bcbc9ba284c4fb3a4c03cb53e8b6ece10 (diff)
downloadhydra-25fb72320e31f97809e915fc00b0ef0505e4fd21.tar.gz
hydra-25fb72320e31f97809e915fc00b0ef0505e4fd21.tar.bz2
Fix default /etc/hosts at provision
-rwxr-xr-xshare/hydractl/provision8
1 files changed, 5 insertions, 3 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index 1a9b98d..0c57e49 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -279,9 +279,11 @@ echo "search $hostname.$domain" | $SUDO tee -a $WORK/etc/resolv.conf > /dev/nul
grep nameserver /etc/resolv.conf | $SUDO tee -a $WORK/etc/resolv.conf > /dev/null
# Hostname configuration.
-echo $hostname.$domain | $SUDO tee $WORK/etc/hostname > /dev/null
-echo "127.0.0.1 localhost" | $SUDO tee -a $WORK/etc/hosts > /dev/null
-echo "127.0.0.1 $hostname $hostname.$domain" | $SUDO tee -a $WORK/etc/hosts > /dev/null
+echo $hostname.$domain | $SUDO tee $WORK/etc/hostname > /dev/null
+echo "127.0.0.1 localhost" | $SUDO tee -a $WORK/etc/hosts > /dev/null
+
+# This ordering is important for facter correctly guess the domain name
+echo "127.0.0.1 $hostname.$domain $hostname" | $SUDO tee -a $WORK/etc/hosts > /dev/null
# Invert hostname contents to avoid http://projects.puppetlabs.com/issues/2533
tac $WORK/etc/hosts | $SUDO tee $WORK/etc/hosts.new > /dev/null