From 8ddd500f6b4d02d3d4e8f27914720c009a02f83d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 25 Dec 2009 00:55:33 -0200 Subject: Introducing hostname and interface parameters --- files/vserver/build_vserver | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'files/vserver') 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 -- cgit v1.2.3