From 0d9e56473c751cf78a1787665eb92a725e7a1d4c Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 27 Sep 2012 12:14:41 +0000 Subject: [PATCH] deployment: do not modify /etc/hosts if retrieving hosts config From: Michael Prokop --- deployment.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/deployment.sh b/deployment.sh index fae5573..99e25a7 100755 --- a/deployment.sh +++ b/deployment.sh @@ -1293,8 +1293,10 @@ EOF fi fi # if $DHCP -# finalise hostname configuration -cat > $TARGET/etc/hosts << EOF +generate_etc_hosts() { + + # finalise hostname configuration + cat > $TARGET/etc/hosts << EOF 127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts @@ -1306,11 +1308,8 @@ ff02::2 ip6-allrouters EOF -# append hostnames of sp1/sp2 so they can talk to each other -# in the HA setup -if "$RETRIEVE_MGMT_CONFIG" ; then - echo "Nothing to do, /etc/hosts was already set up." -else + # append hostnames of sp1/sp2 so they can talk to each other + # in the HA setup if "$PRO_EDITION" ; then cat >> $TARGET/etc/hosts << EOF $IP1 sp1 @@ -1323,6 +1322,14 @@ EOF 127.0.0.1 $TARGET_HOSTNAME EOF fi + +} + +if "$RETRIEVE_MGMT_CONFIG" ; then + echo "Nothing to do, /etc/hosts was already set up." +else + echo "Generting /etc/hosts" + generate_etc_hosts fi if [ -n "$PUPPET" ] ; then