aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2009-12-25 00:55:33 -0200
committerSilvio Rhatto <rhatto@riseup.net>2009-12-25 00:55:33 -0200
commit8ddd500f6b4d02d3d4e8f27914720c009a02f83d (patch)
treed90541a789731c9578a2f19041c48ca49adb9888 /files
parent0915a963bf42445f7a59d9e776d47c86ef35859a (diff)
downloadpuppet-virtual-8ddd500f6b4d02d3d4e8f27914720c009a02f83d.tar.gz
puppet-virtual-8ddd500f6b4d02d3d4e8f27914720c009a02f83d.tar.bz2
Introducing hostname and interface parameters
Diffstat (limited to 'files')
-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