aboutsummaryrefslogtreecommitdiff
path: root/files/vserver
diff options
context:
space:
mode:
Diffstat (limited to 'files/vserver')
-rw-r--r--files/vserver/build_vserver19
1 files changed, 13 insertions, 6 deletions
diff --git a/files/vserver/build_vserver b/files/vserver/build_vserver
index 3645ea9..569451b 100644
--- a/files/vserver/build_vserver
+++ b/files/vserver/build_vserver
@@ -4,16 +4,23 @@ NAME=$1
CONTEXT=$2
RELEASE=$3
DEBOOTSTRAP_MIRROR=$4
-# create basic vserver
-vserver $NAME build -m debootstrap -- -d $RELEASE -m $DEBOOTSTRAP_MIRROR
+HOSTNAME=$5
+INTERFACE=$6
+
+if [ $HOSTNAME != "none" ]; then
+ hostname="--hostname $HOSTNAME"
+fi
-# default settings
-echo $NAME >/etc/vservers/$NAME/uts/nodename
-echo $CONTEXT >/etc/vservers/$NAME/context
+if [ ! -z $INTERFACE]; then
+ interface="--interface $INTERFACE"
+fi
+
+# create basic vserver
+vserver $NAME build -n $NAME --context $CONTEXT \
+ $hostname $interace -m debootstrap -- -d $RELEASE -m $DEBOOTSTRAP_MIRROR
# 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