]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix default /etc/hosts at provision
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 2 Apr 2016 15:00:36 +0000 (12:00 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 2 Apr 2016 15:00:36 +0000 (12:00 -0300)
share/hydractl/provision

index 1a9b98dd1d79f6584cf6758f433bb9edf6fe89d9..0c57e49ce3c3f29c37e08820a82b028d9ea6975d 100755 (executable)
@@ -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