diff options
author | Micah Anderson <micah@riseup.net> | 2007-10-12 16:14:11 +0000 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2007-10-12 16:14:11 +0000 |
commit | 284b50a1d07310c8c10f1c1f953d1e979762c476 (patch) | |
tree | 3974da499c584648e3aefbb8be13270f3d90ff93 /files/build_vserver | |
download | puppet-virtual-284b50a1d07310c8c10f1c1f953d1e979762c476.tar.gz puppet-virtual-284b50a1d07310c8c10f1c1f953d1e979762c476.tar.bz2 |
add the virtual module
Diffstat (limited to 'files/build_vserver')
-rwxr-xr-x | files/build_vserver | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/files/build_vserver b/files/build_vserver new file mode 100755 index 0000000..bf4b949 --- /dev/null +++ b/files/build_vserver @@ -0,0 +1,32 @@ +#!/bin/bash + +NAME=$1 +DOMAIN=$2 + +# create basic vserver +vserver $NAME build -m debootstrap -- -d etch -m http://ftp.at.debian.org/debian + +# default settings +echo $NAME >/etc/vservers/$NAME/uts/nodename + +# 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.$DOMAIN $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/ + +# Setup is complete, now do the post-install stuff +vserver $NAME start +vserver $NAME exec dselect update +# install a few packages needed for facter +vserver $NAME exec apt-get -y install lsb-release iproute +vserver $NAME exec dpkg --install var/lib/puppet/modules/dbp/puppet_current.deb +vserver $NAME exec apt-get -fy install + +echo "Please sign now: puppetca --sign $NAME.$DOMAIN" >&2 |