From 61fd970b469973e13ddde78a1159ef62438c1a2f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 25 Dec 2009 11:04:35 -0200 Subject: Changing variable names and defaults --- files/vserver/build_vserver | 10 +++++----- manifests/vserver.pp | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/files/vserver/build_vserver b/files/vserver/build_vserver index 569451b..6fd1073 100644 --- a/files/vserver/build_vserver +++ b/files/vserver/build_vserver @@ -4,20 +4,20 @@ NAME=$1 CONTEXT=$2 RELEASE=$3 DEBOOTSTRAP_MIRROR=$4 -HOSTNAME=$5 -INTERFACE=$6 +VHOSTNAME=$5 +VINTERFACE=$6 if [ $HOSTNAME != "none" ]; then - hostname="--hostname $HOSTNAME" + VHOSTNAME="--hostname $VHOSTNAME" fi if [ ! -z $INTERFACE]; then - interface="--interface $INTERFACE" + VINTERFACE="--interface $VINTERFACE" fi # create basic vserver vserver $NAME build -n $NAME --context $CONTEXT \ - $hostname $interace -m debootstrap -- -d $RELEASE -m $DEBOOTSTRAP_MIRROR + $VHOSTNAME $VINTERFACE -m debootstrap -- -d $RELEASE -m $DEBOOTSTRAP_MIRROR # copy in some some defaults TARGET=/etc/vservers/$NAME/vdir/ diff --git a/manifests/vserver.pp b/manifests/vserver.pp index 4709ac8..459d1fd 100644 --- a/manifests/vserver.pp +++ b/manifests/vserver.pp @@ -103,8 +103,9 @@ class vserver::host { define vs_create($in_domain, $context, $legacy = false, $distro = 'etch', $debootstrap_mirror = 'http://ftp.debian.org/debian', $hostname = false, $interface = false) { - $vs_name = $legacy ? { true => $name, false => $in_domain ? { '' => $name, default => "${name}.${in_domain}" } } - $vs_hostname = $hostname ? { false => 'none', default => $hostname } + $vs_name = $legacy ? { true => $name, false => $in_domain ? { '' => $name, default => "${name}.${in_domain}" } } + $vs_hostname = $hostname ? { false => 'none', default => $hostname } + $vs_interface = $interface ? { false => 'none', default => $interface } case $vs_name { '': { fail ( "Cannot create VServer with empty name" ) } } -- cgit v1.2.3