aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files/vserver/build_vserver19
1 files changed, 11 insertions, 8 deletions
diff --git a/files/vserver/build_vserver b/files/vserver/build_vserver
index ddf37e0..6b8e33f 100644
--- a/files/vserver/build_vserver
+++ b/files/vserver/build_vserver
@@ -8,26 +8,29 @@ VHOSTNAME="$5"
VINTERFACE="$6"
if [ "$VHOSTNAME" != "none" ]; then
- VHOSTNAME="--hostname $VHOSTNAME"
+ VHOSTNAME_OPT="--hostname $VHOSTNAME"
fi
if [ ! -z "$VINTERFACE" ]; then
- VINTERFACE="--interface $VINTERFACE"
+ VINTERFACE_OPT="--interface $VINTERFACE"
+ VIP="`echo $VINTERFACE | cut -d : -f 2 | cut -d '/' -f 1`"
fi
# create basic vserver
vserver $NAME build -n $NAME --context $CONTEXT \
- $VHOSTNAME $VINTERFACE -m debootstrap -- -d $RELEASE -m $DEBOOTSTRAP_MIRROR || exit 1
+ $VHOSTNAME_OPT $VINTERFACE_OPT -m debootstrap -- -d $RELEASE -m $DEBOOTSTRAP_MIRROR || exit 1
# copy in some some defaults
TARGET=/etc/vservers/$NAME/vdir/
cp /etc/apt/{preferences,sources.list} $TARGET/etc/apt/
-# this is needed so puppet can find the puppetmaster and creates the right
-# certificate
-#grep -v $NAME /etc/hosts > $TARGET/etc/hosts
-#echo "127.0.0.1 $NAME" >> $TARGET/etc/hosts
-echo "127.0.0.1 $NAME" > $TARGET/etc/hosts
+# add minimum /etc/hosts entries
+if [ "$VHOSTNAME" != "none" ]; then
+ echo "$VIP $VHOSTNAME" > $TARGET/etc/hosts
+fi
+
+echo "127.0.0.1 $NAME" >> $TARGET/etc/hosts
+
#mkdir -p $TARGET/var/lib/puppet/modules/dbp
#cp /var/lib/puppet/modules/dbp/puppet_current.deb $TARGET/var/lib/puppet/modules/dbp/