]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
initial scripts to install cr13 and gw1301
authorHolger Levsen <holger@layer-acht.org>
Wed, 20 Feb 2013 17:30:16 +0000 (18:30 +0100)
committerHolger Levsen <holger@layer-acht.org>
Wed, 20 Feb 2013 17:30:16 +0000 (18:30 +0100)
pxe_install.sh [new file with mode: 0755]
pxe_riserver_setup.sh

diff --git a/pxe_install.sh b/pxe_install.sh
new file mode 100755 (executable)
index 0000000..1ddb789
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+# copyright 2013 Holger Levsen <holger@layer-acht.org>
+# GPL2 licenced
+
+set -x
+export
+echo
+
+if [ "$3" = "" ] ; then 
+       echo "$0 must be called with exactly three arguments: hostname mac networkdevice"
+       echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1"
+       exit 1
+fi
+
+TARGET_HOST=$1
+TARGET_MAC=$2
+TARGET_DEV=$3
+TMPOUTPUT=$(mktemp)
+
+$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV install ; \
+ipmitool -H ${TARGET_HOST}-ipmi -f /etc/jenkins/$TARGET_HOST.ipmi -U ADMIN chassis power reset ; \
+sleep 90 ; \
+$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV localboot 
+
+#ipmitool -H ${TARGET_HOST}-ipmi -f /etc/jenkins/$TARGET_HOST.ipmi -U ADMIN -I lanplus sol activate < /dev/zero | tee $TMPOUTPUT &
+
+set +x
+#
+# check for 15min whether ssh comes back
+#
+echo "Checking for sshd running on $TARGET_HOST..."
+for i in $(seq 1 90) ; do
+       sleep 10
+       if $(ping -c 1 $TARGET_HOST >/dev/null)  ; then
+               echo -n "ping $TARGET_HOST ok..."
+               # check ssh 
+               if $(nc -z $TARGET_HOST 22 ) ; then
+                       echo "ok, sshd is running at $(date +%H:%M:%S)"
+                       break
+               else
+                       echo "but sshd is not running at $(date +%H:%M:%S)"
+               fi
+       fi
+done
+if ! $(nc -z $TARGET_HOST 22 ) ; then
+       figlet "Failure:"
+       echo "$TARGET_HOST still not running sshd, please investigate."
+       exit 1
+fi
+echo
+
+rm $TMPOUTPUT
+
index ddcc596054ae8fe29754793c33ad9f15063fbcb2..f810148bef932de9b00c510eded7a8c55d443490 100755 (executable)
@@ -42,12 +42,12 @@ LOCALBOOT 0
 LABEL sysinfo
 MENU LABEL sysinfo
 KERNEL fai/vmlinuz-install
-APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=sysinfo FAI_FLAGS=verbose,sshd,createvt,reboot console=tty0 console=ttyS1,115200
+APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=sysinfo FAI_FLAGS=verbose,createvt,reboot console=tty0 console=ttyS1,115200
 
 LABEL install
 MENU LABEL install
 KERNEL fai/vmlinuz-install
-APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=install FAI_FLAGS=verbose,sshd,createvt,reboot console=tty0 console=ttyS1,115200 hostname=$TARGET_HOST
+APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=install FAI_FLAGS=verbose,createvt,reboot console=tty0 console=ttyS1,115200 hostname=$TARGET_HOST
 EOF
 
 cat $TMPFILE