aboutsummaryrefslogtreecommitdiff
path: root/files/vserver
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-08-15 23:15:35 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-08-15 23:15:35 -0300
commiteec18d1f040d8a1672f47e64c93adf27e3596215 (patch)
tree2c8daf7e32e84f1c9e2227a268cae81ef13d4e13 /files/vserver
parent30ad2d163277554f341904dc5ee2481b18a33543 (diff)
downloadpuppet-virtual-eec18d1f040d8a1672f47e64c93adf27e3596215.tar.gz
puppet-virtual-eec18d1f040d8a1672f47e64c93adf27e3596215.tar.bz2
Additional /etc/hosts entry at build_vserver
Diffstat (limited to 'files/vserver')
-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/