From: Peter Palfrader Date: Fri, 19 Sep 2014 10:20:10 +0000 (+0200) Subject: See if we still need instance-debootstrap X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=commitdiff_plain;h=b85152452204fdacaa807997158c1980dcb26ebe See if we still need instance-debootstrap --- diff --git a/modules/ganeti2/manifests/init.pp b/modules/ganeti2/manifests/init.pp index f5032041..4dd32fee 100644 --- a/modules/ganeti2/manifests/init.pp +++ b/modules/ganeti2/manifests/init.pp @@ -17,10 +17,6 @@ class ganeti2 { ensure => installed } - package { 'ganeti-instance-debootstrap': - ensure => installed - } - if $drbd { package { 'drbd8-utils': ensure => installed @@ -28,53 +24,4 @@ class ganeti2 { } site::linux_module { 'tun': } - - file { - '/etc/ganeti/instance-debootstrap/variants.list': - content => template('ganeti2/instance-debootstrap/variants.list.erb'), - require => Package['ganeti-instance-debootstrap'], - ; - '/etc/ganeti/instance-debootstrap/variants/dsa.conf': - content => template('ganeti2/instance-debootstrap/variants/dsa.conf.erb'), - require => Package['ganeti-instance-debootstrap'], - ; - '/etc/ganeti/instance-debootstrap/variants/dsa-wheezy.conf': - content => template('ganeti2/instance-debootstrap/variants/dsa-wheezy.conf.erb'), - require => Package['ganeti-instance-debootstrap'], - ; - '/etc/ganeti/instance-debootstrap/hooks/00-dsa-configure-networking': - content => template('ganeti2/instance-debootstrap/hooks/00-dsa-configure-networking.erb'), - require => Package['ganeti-instance-debootstrap'], - mode => '0555', - ; - '/etc/ganeti/instance-debootstrap/hooks/10-dsa-install-extra-packages': - content => template('ganeti2/instance-debootstrap/hooks/10-dsa-install-extra-packages.erb'), - require => Package['ganeti-instance-debootstrap'], - mode => '0555', - ; - '/etc/ganeti/instance-debootstrap/hooks/20-dsa-install-bootloader': - content => template('ganeti2/instance-debootstrap/hooks/20-dsa-install-bootloader.erb'), - require => Package['ganeti-instance-debootstrap'], - mode => '0555', - ; - '/etc/ganeti/instance-debootstrap/hooks/30-dsa-install-ssh-keys': - content => template('ganeti2/instance-debootstrap/hooks/30-dsa-install-ssh-keys.erb'), - require => Package['ganeti-instance-debootstrap'], - mode => '0555', - ; - '/etc/ganeti/instance-debootstrap/hooks/40-dsa-setup-swapfile': - content => template('ganeti2/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb'), - require => Package['ganeti-instance-debootstrap'], - mode => '0555', - ; - '/etc/ganeti/instance-debootstrap/hooks/clear-root-password': - require => Package['ganeti-instance-debootstrap'], - mode => '0444', - ; - '/etc/ganeti/instance-debootstrap/hooks/xen-hvc0': - require => Package['ganeti-instance-debootstrap'], - mode => '0444', - ; - } - } diff --git a/modules/ganeti2/templates/instance-debootstrap/hooks/00-dsa-configure-networking.erb b/modules/ganeti2/templates/instance-debootstrap/hooks/00-dsa-configure-networking.erb deleted file mode 100755 index e06ecfff..00000000 --- a/modules/ganeti2/templates/instance-debootstrap/hooks/00-dsa-configure-networking.erb +++ /dev/null @@ -1,161 +0,0 @@ -#!/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 - -touch $TARGET/etc/udev/rules.d/75-cd-aliases-generator.rules -touch $TARGET/etc/udev/rules.d/75-persistent-net-generator.rules - - -########################################### -fqdn=$(cat $TARGET/etc/hostname) -echo ${fqdn%%.*} > $TARGET/etc/hostname - -########################################### -if [ "$NIC_COUNT" -ge 1 ]; then - cat > $TARGET/etc/network/interfaces << EOF -# /etc/network/interfaces - -auto lo -iface lo inet loopback - -EOF -fi - - -########################################### -########################################### -<% if scope.lookupvar('::cluster').to_s == 'ganeti2.debian.org' -%> - -########################################### -if [ "$NIC_COUNT" -ge 1 ]; then - cat >> $TARGET/etc/network/interfaces << EOF -auto eth0 -iface eth0 inet static - address ${NIC_0_IP} - netmask 255.255.255.0 - gateway 206.12.19.254 - - pre-up /sbin/sysctl -w net.ipv6.conf.\$IFACE.accept_ra=0 || true - up ip addr add 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS/64 dev \$IFACE - up ip r add default via 2607:f8f0:610:4000::1 src 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS dev \$IFACE - down ip r del default via 2607:f8f0:610:4000::1 src 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS dev \$IFACE - down ip addr del 2607:f8f0:610:4000:6564:0a62:\$IF_ADDRESS/64 dev \$IFACE -EOF - -fi - -########################################### -cat > $TARGET/etc/resolv.conf < -# -########################################### -if [ "$NIC_COUNT" -ge 1 ]; then - cat >> $TARGET/etc/network/interfaces << EOF -auto eth0 -iface eth0 inet static - address ${NIC_0_IP} - netmask 255.255.255.128 - gateway 140.211.166.1 - - pre-up /sbin/sysctl -w net.ipv6.conf.\$IFACE.accept_ra=0 || true -EOF - -fi - -########################################### -cat > $TARGET/etc/resolv.conf < -# -########################################### -if [ "$NIC_COUNT" -ge 1 ]; then - cat >> $TARGET/etc/network/interfaces << EOF -auto eth0 -iface eth0 inet static - address ${NIC_0_IP} - netmask 255.255.255.192 - gateway 82.195.75.126 - - pre-up /sbin/sysctl -w net.ipv6.conf.\$IFACE.accept_ra=0 || true -EOF - -fi - -########################################### -cat > $TARGET/etc/resolv.conf < - -# No config for cluster <%= scope.lookupvar('::cluster').to_s %> -cp /etc/resolv.conf $TARGET/etc/resolv.conf - -<% end -%> - - - - -########################################### -if [ "$NIC_COUNT" -ge 2 ]; then - cat >> $TARGET/etc/network/interfaces << EOF - -auto eth1 -iface eth1 inet static - address ${NIC_1_IP} - netmask 255.255.255.0 -EOF - -fi - -########################################### -# clean up etc/hosts -cat > $TARGET/etc/hosts << EOF -127.0.0.1 localhost -${NIC_0_IP} ${fqdn} ${fqdn%%.*} - -# The following lines are desirable for IPv6 capable hosts -::1 ip6-localhost ip6-loopback -fe00::0 ip6-localnet -ff00::0 ip6-mcastprefix -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -EOF - -exit 0 - -# vim:set syn=sh: diff --git a/modules/ganeti2/templates/instance-debootstrap/hooks/10-dsa-install-extra-packages.erb b/modules/ganeti2/templates/instance-debootstrap/hooks/10-dsa-install-extra-packages.erb deleted file mode 100755 index 0b0b866c..00000000 --- a/modules/ganeti2/templates/instance-debootstrap/hooks/10-dsa-install-extra-packages.erb +++ /dev/null @@ -1,21 +0,0 @@ -#!/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 - -node="$(hostname)" -instance="$(cat $TARGET/etc/hostname)" -sed -e "s#root@$node#root@$instance#" -i "$TARGET"/etc/ssh/ssh*pub - -if [ "$ARCH" = "amd64" ]; then - chroot "$TARGET" apt-get -qq install linux-image-amd64 -fi - -exit 0 diff --git a/modules/ganeti2/templates/instance-debootstrap/hooks/20-dsa-install-bootloader.erb b/modules/ganeti2/templates/instance-debootstrap/hooks/20-dsa-install-bootloader.erb deleted file mode 100755 index 2bbba5e7..00000000 --- a/modules/ganeti2/templates/instance-debootstrap/hooks/20-dsa-install-bootloader.erb +++ /dev/null @@ -1,35 +0,0 @@ -#!/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 diff --git a/modules/ganeti2/templates/instance-debootstrap/hooks/30-dsa-install-ssh-keys.erb b/modules/ganeti2/templates/instance-debootstrap/hooks/30-dsa-install-ssh-keys.erb deleted file mode 100755 index 895d9d6b..00000000 --- a/modules/ganeti2/templates/instance-debootstrap/hooks/30-dsa-install-ssh-keys.erb +++ /dev/null @@ -1,16 +0,0 @@ -#!/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 diff --git a/modules/ganeti2/templates/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb b/modules/ganeti2/templates/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb deleted file mode 100755 index e8cd1d19..00000000 --- a/modules/ganeti2/templates/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -. common.sh - -if [ -z "$TARGET" -o ! -d "$TARGET" ]; then - echo "Missing target directory" - exit 1 -fi - -dd if=/dev/zero of="$TARGET/swapfile" bs=1024k count=512 -chmod 400 "$TARGET/swapfile" -mkswap "$TARGET/swapfile" - -cat >> "$TARGET/etc/fstab" < -ARCH="amd64" -SUITE="wheezy" diff --git a/modules/ganeti2/templates/instance-debootstrap/variants/dsa.conf.erb b/modules/ganeti2/templates/instance-debootstrap/variants/dsa.conf.erb deleted file mode 100644 index affb9732..00000000 --- a/modules/ganeti2/templates/instance-debootstrap/variants/dsa.conf.erb +++ /dev/null @@ -1,11 +0,0 @@ -<%= -case scope.lookupvar('::cluster') - when "ganeti2.debian.org" then 'MIRROR="http://mirror-ubc.debian.org/debian"' - when "ganeti-osuosl.debian.org" then 'MIRROR="http://debian.osuosl.org/debian"' - when "ganeti3.debian.org" then 'MIRROR="http://mirror.ayous.org/debian"' - when "ganeti-bytemark.debian.org" then 'MIRROR="http://mirror.bytemark.co.uk/debian"' - else 'MIRROR="http://http.debian.net/debian"' -end -%> -ARCH="amd64" -SUITE="squeeze"