From: Matt <mat...@us...> - 2007-06-27 15:53:49
|
Update of /cvsroot/openqrm/plugins/linuxcoe/sbin In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22035/plugins/linuxcoe/sbin Modified Files: qrm-linuxcoe-manage Log Message: added post section to automatically install the openQRM agents and integrate the local booted system into openQRM Index: qrm-linuxcoe-manage =================================================================== RCS file: /cvsroot/openqrm/plugins/linuxcoe/sbin/qrm-linuxcoe-manage,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** qrm-linuxcoe-manage 26 Jun 2007 18:20:45 -0000 1.5 --- qrm-linuxcoe-manage 27 Jun 2007 15:53:49 -0000 1.6 *************** *** 82,87 **** --- 82,94 ---- CURRENT=`pwd` case "$LINUXCOE_INSTALL_METHOD" in + kickstart) + linuxcoe_log qrm-linuxcoe-manage "NOTICE : Preparing $LINUXCOE_INSTALL_METHOD pxe-configuration for resource $LINUXCOE_RESOURCE_ID" + + # get the whole server-config + qrm_get_server_config 1>/dev/null + export LINUXCOE_PROFILE + # add to automatic reboot after installation if not already in the ks.cfg if ! grep ^reboot $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg 1>/dev/null; then *************** *** 92,95 **** --- 99,104 ---- echo "" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg echo "" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg + echo "firewall --disabled" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg + echo "selinux --disabled" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg echo "reboot" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg echo "" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg *************** *** 100,103 **** --- 109,126 ---- linuxcoe_log qrm-linuxcoe-manage "NOTICE : Automatic reboot after installation is already in ks""$LINUXCOE_PROFILE"".cfg" fi + + # add openQRM post section if not already in the ks.cfg + if ! grep openQRM $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg 1>/dev/null; then + linuxcoe_log qrm-linuxcoe-manage "NOTICE : Adding openQRM post-section to ks""$LINUXCOE_PROFILE"".cfg" + echo "" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg + echo "# openQRM post section" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg + echo "wget -O $LINUXCOE_PROFILE.post http://$QRM_SERVER_IP_ADDRESS/plugins/linuxcoe/inst/$LINUXCOE_PROFILE.post" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg + echo "chmod +x $LINUXCOE_PROFILE.post" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg + echo "./$LINUXCOE_PROFILE.post" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg + echo "# /bin/rm -f $LINUXCOE_PROFILE.post" >> $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg + else + linuxcoe_log qrm-linuxcoe-manage "NOTICE : openQRM post-section already in ks""$LINUXCOE_PROFILE"".cfg" + fi + # get the kickstart file in a short http-path ln -sf $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/scratch_monkey/systemdesigner/img""$LINUXCOE_PROFILE"".iso_unpacked/ks.cfg $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/web/secure/inst/ks""$LINUXCOE_PROFILE"".cfg *************** *** 117,128 **** ln -sf vmlinuz-""$LINUXCOE_PROFILE res-""$LINUXCOE_RESOURCE_ID""-kernel - # get the whole server-config - qrm_get_server_config 1>/dev/null - export LINUXCOE_PROFILE - # create the new pxe configuration file interpolate $LINUXCOE_PXE_TEMPLATE_KICKSTART > $QRM_SERVER_BASE_DIR/qrm/tftpboot/pxelinux.cfg/res-""$LINUXCOE_RESOURCE_ID"".netboot.linuxcoe chmod 777 $QRM_SERVER_BASE_DIR/qrm/tftpboot/pxelinux.cfg/res-""$LINUXCOE_RESOURCE_ID"".netboot.linuxcoe # adjust the pxe link cd $QRM_SERVER_BASE_DIR/qrm/tftpboot/pxelinux.cfg/ --- 140,151 ---- ln -sf vmlinuz-""$LINUXCOE_PROFILE res-""$LINUXCOE_RESOURCE_ID""-kernel # create the new pxe configuration file interpolate $LINUXCOE_PXE_TEMPLATE_KICKSTART > $QRM_SERVER_BASE_DIR/qrm/tftpboot/pxelinux.cfg/res-""$LINUXCOE_RESOURCE_ID"".netboot.linuxcoe chmod 777 $QRM_SERVER_BASE_DIR/qrm/tftpboot/pxelinux.cfg/res-""$LINUXCOE_RESOURCE_ID"".netboot.linuxcoe + # create the post-installation script + cat $LINUXCOE_POST_INSTALL_TEMPLATE_KICKSTART | sed -e "s#ZZZ_LINUXCOE_PROFILE_ZZZ#$LINUXCOE_PROFILE#g" | sed -e "s#ZZZ_QRM_SERVER_IP_ADDRESS_ZZZ#$QRM_SERVER_IP_ADDRESS#g" > $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/web/secure/inst/""$LINUXCOE_PROFILE"".post + chmod 777 $QRM_SERVER_BASE_DIR/qrm/plugins/linuxcoe/web/secure/inst/""$LINUXCOE_PROFILE"".post + # adjust the pxe link cd $QRM_SERVER_BASE_DIR/qrm/tftpboot/pxelinux.cfg/ *************** *** 215,221 **** # reboot the node to install it ! $QRM_CLI resource reboot --resource_id $LINUXCOE_RESOURCE_ID ! # TODO : set to localboot after the node started the automatic installation ;; --- 238,250 ---- # reboot the node to install it ! $QRM_CLI resource reboot --internal_cr_id $LINUXCOE_RESOURCE_ID ! # TODO : start script in background via screen ! # save the nodes mac pxe-file, set to localboot ! # check when the node gets into error state ! # remove the node to enable it adding it again via easy-migration ! # restore mac pxe-file to enable localboot for the node ! # node will reboot after installation and ! # add itself to openQRM via the post section ;; |