rule => 'proto tcp dport ssh @subchain \'ganeti-ssh\' { saddr ( $HOST_GANETI_V4 $HOST_GANETI_BACKEND_V4) ACCEPT; }',
notarule => true,
}
+
+ file {
+ '/etc/ganeti/instance-debootstrap/variants.list':
+ content => template('ganeti2/instance-debootstrap/variants.list.erb'),
+ ;
+ '/etc/ganeti/instance-debootstrap/variants/dsa.conf':
+ content => template('ganeti2/instance-debootstrap/variants/dsa.conf.erb'),
+ ;
+ '/etc/ganeti/instance-debootstrap/hooks/00-dsa-configure-networking':
+ content => template('ganeti2/instance-debootstrap/hooks/00-dsa-configure-networking.erb'),
+ ;
+ '/etc/ganeti/instance-debootstrap/hooks/10-dsa-install-extra-packages':
+ content => template('ganeti2/instance-debootstrap/hooks/10-dsa-install-extra-packages.erb'),
+ ;
+ '/etc/ganeti/instance-debootstrap/hooks/20-dsa-install-bootloader':
+ content => template('ganeti2/instance-debootstrap/hooks/20-dsa-install-bootloader.erb'),
+ ;
+ '/etc/ganeti/instance-debootstrap/hooks/30-dsa-install-ssh-keys':
+ content => template('ganeti2/instance-debootstrap/hooks/30-dsa-install-ssh-keys.erb'),
+ ;
+ }
+
}
--- /dev/null
+#!/bin/bash
+
+set -e
+
+if [ -z "$TARGET" -o ! -d "$TARGET" ]; then
+ echo "Missing target directory"
+ exit 1
+fi
+
+if [ ! -d "$TARGET/etc/network" ]; then
+ echo "Missing target network directory"
+ exit 1
+fi
+
+if [ -z "$NIC_COUNT" ]; then
+ echo "Missing NIC COUNT"
+ exit 1
+fi
+
+rm -f $TARGET/etc/udev/rules.d/70-persistent-net.rules
+
+if [ "$NIC_COUNT" -gt 0 ]; then
+
+ cat > $TARGET/etc/network/interfaces <<EOF
+# /etc/network/interfaces
+
+auto lo
+iface lo inet loopback
+
+auto eth0
+iface eth0 inet static
+ address ${NIC_0_IP}
+ netmask 255.255.255.0
+ gateway 206.12.19.254
+
+EOF
+
+fi
+
+cat > $TARGET/etc/resolv.conf <<EOF
+# /etc/resolv.conf
+search debprivate-ubc.debian.org debian.org
+nameserver 206.12.19.20
+nameserver 206.12.19.21
+EOF
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+set -e
+
+if [ -z "$TARGET" -o ! -d "$TARGET" ]; then
+ echo "Missing target directory"
+ exit 1
+fi
+
+chroot "$TARGET" apt-get -qq update
+chroot "$TARGET" apt-get -qq install vim ssh extlinux
+
+if [ "$ARCH" = "amd64" ]; then
+ chroot "$TARGET" apt-get -qq install linux-image-amd64
+fi
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+set -e
+
+. common.sh
+
+CLEANUP=( )
+set -x
+trap cleanup EXIT
+
+if [ -z "$TARGET" -o ! -d "$TARGET" ]; then
+ echo "Missing target directory"
+ exit 1
+fi
+
+# allow extlinux to find device
+mount --bind /dev $TARGET/dev
+CLEANUP+=("umount $TARGET/dev")
+mount --bind /proc $TARGET/proc
+CLEANUP+=("umount $TARGET/proc")
+
+# generate configuration
+echo 'EXTLINUX_PARAMETERS="ro console=ttyS0,38400n8"' > $TARGET/etc/default/extlinux
+chroot "$TARGET" extlinux-update
+
+# install extlinux
+chroot "$TARGET" extlinux -i /boot/extlinux
+
+# install boot record
+dd if="$TARGET/usr/lib/extlinux/mbr.bin" of=$BLOCKDEV
+
+cleanup
+trap - EXIT
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+set -e
+
+. common.sh
+
+if [ -z "$TARGET" -o ! -d "$TARGET" ]; then
+ echo "Missing target directory"
+ exit 1
+fi
+
+mkdir $TARGET/etc/ssh/userkeys
+cat /etc/ssh/userkeys/root > $TARGET/etc/ssh/userkeys/root
+grep '^AuthorizedKeysFile /etc/ssh/userkeys' $TARGET/etc/ssh/sshd_config || echo 'AuthorizedKeysFile /etc/ssh/userkeys/%u' >> $TARGET/etc/ssh/sshd_config
+
+exit 0
--- /dev/null
+default
+dsa
--- /dev/null
+MIRROR="http://http.debian.net/debian"
+ARCH="amd64"
+SUITE="squeeze"