debian-lan-config-0.13/ 0000755 0000000 0000000 00000000000 12176652571 011574 5 ustar debian-lan-config-0.13/fai/ 0000755 0000000 0000000 00000000000 12176652571 012333 5 ustar debian-lan-config-0.13/fai/config/ 0000755 0000000 0000000 00000000000 12176652571 013600 5 ustar debian-lan-config-0.13/fai/config/debconf/ 0000755 0000000 0000000 00000000000 12176652571 015200 5 ustar debian-lan-config-0.13/fai/config/debconf/KERBEROS_CLIENT 0000644 0000000 0000000 00000000412 12176652571 017372 0 ustar krb5-config krb5-config/default_realm string INTERN
krb5-config krb5-config/dns_for_default boolean true
krb5-config krb5-config/add_servers boolean false
krb5-config krb5-config/kerberos_servers string kerberos
krb5-config krb5-config/admin_server string kerberos
debian-lan-config-0.13/fai/config/debconf/DEBIAN 0000644 0000000 0000000 00000001313 12176652571 016043 0 ustar exim4-config exim4/dc_eximconfig_configtype select local delivery only; not on a network
locales locales/default_environment_locale select en_US.UTF-8
locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8
keyboard-configuration keyboard-configuration/modelcode string pc105
keyboard-configuration keyboard-configuration/xkb-keymap select us
keyboard-configuration keyboard-configuration/variant select USA
keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC
keyboard-configuration keyboard-configuration/layoutcode string us
keyboard-configuration keyboard-configuration/optionscode string ctrl:nocaps,terminate:ctrl_alt_bksp
debian-lan-config-0.13/fai/config/debconf/SERVER_A 0000644 0000000 0000000 00000000533 12176652571 016372 0 ustar ## Network interfaces on which the DHCP server should listen:
isc-dhcp-server isc-dhcp-server/interfaces string eth0
## Do you want system-wide readable home directories?
adduser adduser/homedir-permission boolean false
## Automatically download and install stable updates?
unattended-upgrades unattended-upgrades/enable_auto_updates boolean true
debian-lan-config-0.13/fai/config/debconf/CLIENT_A 0000644 0000000 0000000 00000000325 12176652571 016341 0 ustar nullmailer nullmailer/adminaddr string postmaster@mail.intern
nullmailer nullmailer/relayhost string mail.intern smtp --starttls --insecure
unattended-upgrades unattended-upgrades/enable_auto_updates boolean true
debian-lan-config-0.13/fai/config/debconf/DNS_SERVER 0000644 0000000 0000000 00000000125 12176652571 016633 0 ustar # Should resolv.conf settings be overridden?
bind9 bind9/run-resolvconf boolean true
debian-lan-config-0.13/fai/config/debconf/MAIL_SERVER 0000644 0000000 0000000 00000000504 12176652571 016732 0 ustar exim4-config exim4/dc_eximconfig_configtype select mail sent by smarthost; received via SMTP or fetchmail
exim4-config exim4/mailname string mail.intern
exim4-config exim4/dc_localdelivery select Maildir format in home directory
exim4-config exim4/use_split_config boolean true
exim4-config exim4/dc_local_interfaces string
debian-lan-config-0.13/fai/config/debconf/GERMAN 0000644 0000000 0000000 00000001166 12176652571 016100 0 ustar locales locales/default_environment_locale select de_DE.UTF-8
locales locales/locales_to_be_generated multiselect de_DE.UTF-8 UTF-8
keyboard-configuration keyboard-configuration/modelcode string pc105
keyboard-configuration keyboard-configuration/xkb-keymap select de
keyboard-configuration keyboard-configuration/variant select Germany
keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC
keyboard-configuration keyboard-configuration/layoutcode string de
keyboard-configuration keyboard-configuration/optionscode string ctrl:nocaps,terminate:ctrl_alt_bksp
debian-lan-config-0.13/fai/config/debconf/GATEWAY_A 0000644 0000000 0000000 00000000111 12176652571 016455 0 ustar unattended-upgrades unattended-upgrades/enable_auto_updates boolean true
debian-lan-config-0.13/fai/config/debconf/DISKLESS_CLIENT 0000644 0000000 0000000 00000001435 12176652571 017405 0 ustar passwd passwd/shadow boolean true
locales locales/default_environment_locale select en_US.UTF-8
locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8
xserver-xorg xserver-xorg/config/inputdevice/keyboard/model string pc105
xserver-xorg xserver-xorg/autodetect_monitor boolean false
xserver-xorg xserver-xorg/autodetect_keyboard boolean true
xserver-xorg xserver-xorg/autodetect_mouse boolean true
xserver-xorg xserver-xorg/autodetect_video_card boolean true
nbd-client nbd-client/killall boolean false
nbd-client nbd-client/device string /dev/nbd0
nbd-client nbd-client/host string swapserver
nbd-client nbd-client/port string 10809
nbd-client nbd-client/type select swap
## FIXME: workaround #685610
nbd-client nbd-client/extra string -Nswap
nbd-client nbd-client/number string 1
debian-lan-config-0.13/fai/config/debconf/LDAP_SERVER 0000644 0000000 0000000 00000000402 12176652571 016725 0 ustar slapd slapd/no_configuration boolean true
slapd shared/organization string Debian-LAN
slapd slapd/custom_suffix string dc=intern
slapd slapd/domain string intern
slapd slapd/internal/dn string dc=intern
slapd slapd/internal/admin string ^cn=admin,dc=intern$
debian-lan-config-0.13/fai/config/debconf/FR_BELGIAN 0000644 0000000 0000000 00000001102 12176652571 016545 0 ustar locales locales/default_environment_locale select fr_BE.UTF-8
locales locales/locales_to_be_generated multiselect fr_BE.UTF-8 UTF-8
keyboard-configuration keyboard-configuration/modelcode string pc105
keyboard-configuration keyboard-configuration/xkb-keymap select be
keyboard-configuration keyboard-configuration/variant select Belgium
keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC
keyboard-configuration keyboard-configuration/layoutcode string be
keyboard-configuration keyboard-configuration/optionscode string terminate:ctrl_alt_bksp
debian-lan-config-0.13/fai/config/debconf/LDAP_CLIENT 0000644 0000000 0000000 00000000367 12176652571 016707 0 ustar libnss-ldapd libnss-ldapd/nsswitch multiselect group, netgroup, networks, passwd, shadow
nslcd nslcd/ldap-base string dc=intern
nslcd nslcd/ldap-uris string ldap://ldap
nslcd nslcd/ldap-starttls boolean true
nslcd nslcd/ldap-reqcert select demand
debian-lan-config-0.13/fai/config/debconf/KERBEROS_KDC 0000644 0000000 0000000 00000000071 12176652571 017016 0 ustar krb5-admin-server krb5-admin-server/kadmind boolean true
debian-lan-config-0.13/fai/config/files/ 0000755 0000000 0000000 00000000000 12176652571 014702 5 ustar debian-lan-config-0.13/fai/config/files/var/ 0000755 0000000 0000000 00000000000 12176652571 015472 5 ustar debian-lan-config-0.13/fai/config/files/var/www/ 0000755 0000000 0000000 00000000000 12176652571 016316 5 ustar debian-lan-config-0.13/fai/config/files/var/www/index.html/ 0000755 0000000 0000000 00000000000 12176652571 020370 5 ustar debian-lan-config-0.13/fai/config/files/var/www/index.html/GOSA 0000644 0000000 0000000 00000001423 12176652571 021044 0 ustar
Debian-LAN
This is the starting web page for the Debian-LAN mainserver.
Consider changing
your password after the first login.
Available services:
More information is available in the
Debian-LAN Wiki.
debian-lan-config-0.13/fai/config/files/usr/ 0000755 0000000 0000000 00000000000 12176652571 015513 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/ 0000755 0000000 0000000 00000000000 12176652571 016605 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/sbin/ 0000755 0000000 0000000 00000000000 12176652571 017540 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/sbin/debian-lan/ 0000755 0000000 0000000 00000000000 12176652571 021532 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/sbin/debian-lan/SERVER_A 0000755 0000000 0000000 00000024252 12176652571 022733 0 ustar #!/bin/bash
#
# Manage users, pricipals and keytabs. Add machines to dhcpd.conf.
#
set -e
DATADIR="/root/installation/"
#KADMINOPTION="-force"
HOSTNAME=`hostname -s`
HOME="/lan/$HOSTNAME/home0"
DHCPCONF="/etc/dhcp/dhcpd.conf"
DATE=`date +%Y%m%d`
## Password restrictions (compliant with kerberos policy):
MINLEN=4 # minimal password length (max 8 with slappasswd as password generator)
MINCLS=2 # minimal number of character classes
usage(){
echo "Usage: debian-lan adduser|deluser|purgehomes|key2machine argument"
echo " debian-lan add2dhcp"
echo
echo "The corresponding argument can be one of the following:"
echo
echo " adduser (list|file)"
echo " \"list\" is a list of user (login) names. If instead a file"
echo " is provided, it must contain lines of the form 'name [password]'."
echo " If the password is omitted, a random password will be generated and"
echo " appended to the corresponding login name in the file given."
echo
echo " deluser (list|file)"
echo " \"list\" is a list of user (login) names. If instead a file"
echo " is provided, the first word in each lines is taken as a login name."
echo
echo " purgehomes age"
echo " \"age\" is the number of days since the (former) user has been deleted."
echo
echo " key2machine list"
echo " \"list\" is a list of host names."
echo
echo " add2dhcp"
echo " All non-local hardware MAC addresses found in the syslog may be added"
echo " to '$DHCPCONF', either as workstation or diskless machine."
echo
exit 1
}
sync_nscd(){
if pidof nscd 1>&2 > /dev/null ; then
## Clear tables to have database up to date:
nscd -i passwd
nscd -i group
fi
}
adduserLDAP(){
echo "Creating LDAP account for \"$1\": "
if ! getent group $1 > /dev/null ; then
ldapaddgroup $1
else
echo "Group \"$1\" already exists!"
fi
if ! getent passwd $1 > /dev/null ; then
ldapadduser $1 $1
else
echo "User \"$1\" already exists!"
fi
}
deluserLDAP(){
if getent passwd $1 ; then
## First, fetch user's home directory and tagg it for removal:
HOMEDIR=`getent passwd $1 | cut -d : -f 6`
RM_HOMEDIR=`dirname $HOMEDIR`"/rm_"`date "+%Y%m%d"`"_"`basename $HOMEDIR`
echo "Tagging $1's home directory $HOMEDIR for removal:"
if mv -v $HOMEDIR $RM_HOMEDIR; then
chown root:root $RM_HOMEDIR
chmod go-rwx $RM_HOMEDIR
else
echo "ERROR: Tagging $1's home directory failed!"
fi
## Then, remove user from LDAP:
echo "Deleting LDAP account for \"$1\": "
ldapdeleteuser $1 || true
ldapdeletegroup $1 || true
else
echo "User \"$1\" not found in LDAP database!"
fi
}
add2log () {
MACHINE=$1
## munin:
CONFDIR='/etc/munin/munin-conf.d/'
if [ -d $CONFDIR ] && ! grep -sq ${MACHINE} $CONFDIR/nodes.conf ; then
cat >> $CONFDIR/nodes.conf <> $CONF < MAC address already present in ${DHCPCONF}."
else
echo "Add ${HWaddr} to ${DHCPCONF}?"
read -e -n 1 -p "Choose d (diskless), w (workstation) or press RETURN to ignore [d|w|N]: " inp
inp=${inp:-N}
case $inp in
d)
NAME="diskless"
;;
w)
NAME="workstation"
;;
*)
echo "MAC address $HWaddr ignored."
echo
continue
;;
esac
sed -i "0,/\(host ${NAME}.*\) A1:B2:C3:D4:E5:\w\{2\};/s//\1 ${HWaddr};/" ${DHCPCONF}
MACHINE=$(grep $HWaddr ${DHCPCONF} | awk -F " " '{print $2}')
echo -n "MAC address $HWaddr added as: ${MACHINE}"
add2log ${MACHINE}
fi
echo
done
/etc/init.d/isc-dhcp-server restart
/etc/init.d/icinga reload
;;
*)
usage
;;
esac
debian-lan-config-0.13/fai/config/files/usr/local/sbin/gosa-create/ 0000755 0000000 0000000 00000000000 12176652571 021732 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/sbin/gosa-create/GOSA 0000755 0000000 0000000 00000003732 12176652571 022416 0 ustar #!/bin/sh
set -e
## This script is run by www-data using sudo. Keep that in mind!
## Make sure that malicious execution cannot hurt.
##
## This script creates the home directories and principals for users
## added with gosa. There are some tests that make sure only
## non-existent home directories are created. Malicious execution
## cannot hurt, because either the user is missing in ldap or his home
## directory already exists. In both cases nothing should happen.
PREFIX=/lan
HOSTNAME=$(hostname -s)
USERID=$1
## Fetch home dir permissions from 'adduser.conf':
eval $(grep "^DIR_MODE" /etc/adduser.conf)
#FIXME Change this ldap search to only find new users, to not slow down as more users are added.
# One ide might be to look for objects without the krbPasswordExpiration attributes.
## lookup user and create home directory and principal:
ldapsearch -b "ou=gosa,dc=intern" -xLLL "(&(uid=$USERID)(objectClass=posixAccount))" \
cn homeDirectory gidNumber 2>/dev/null | perl -p0e 's/\n //g' | \
while read KEY VALUE ; do
case "$KEY" in
dn:) USERNAME= ; HOMEDIR= ; GROUPID= ; USERDN="dn=$VALUE" ;;
cn:) USERNAME="$VALUE" ;;
homeDirectory:) HOMEDIR="$VALUE" ;;
gidNumber:) GROUPID="$VALUE" ;;
"")
test "$HOMEDIR" || continue
echo "$HOMEDIR" | grep -q "^$PREFIX/$HOSTNAME" || continue
test -e "$HOMEDIR" && continue
cp -r /etc/skel $HOMEDIR
if type nscd > /dev/null 2>&1 ; then
nscd -i passwd
nscd -i group
fi
chown -R $USERID:$GROUPID $HOMEDIR
chmod $DIR_MODE $HOMEDIR
kadmin.local -q "add_principal -randkey -x $USERDN $USERID"
logger -t gosa-create -p notice Home directory \'$HOMEDIR\' and principal \'$USERID\' created.
## send a welcome-email:
cat << EOF | /usr/lib/sendmail $USERID
Subject: Welcome to the mail-system
Hello $USERNAME,
welcome to the mail-system.
Your userID is $USERID, and your email
address is:
$USERID@mail.intern
Regards,
Debian-LAN SysAdmin
EOF
;;
esac
done
exit 0
debian-lan-config-0.13/fai/config/files/usr/local/sbin/add2gosa/ 0000755 0000000 0000000 00000000000 12176652571 021224 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/sbin/add2gosa/GOSA 0000755 0000000 0000000 00000015354 12176652571 021713 0 ustar #!/bin/bash
#
# Import a list of users to GOsa. Based on the ldapscripts package.
#
set -e
umask 0022
sync_nscd(){
if pidof nscd 1>&2 > /dev/null ; then
## Clear tables to have database up to date:
nscd -i passwd
nscd -i group
fi
}
mk_uname() {
GNAME=${1,,}
FNAME=${2,,}
echo ${GNAME::4}${FNAME::4}
#echo ${GNAME}_${FNAME}
}
ou2LDAP() {
OU=$1
# Add ou to LDAP
_extractldif 3 | sed -e "s||$OU|g" | _filterldif | _utf8encode | _ldapadd
[ $? -eq 0 ] || end_die "Error adding '$OU' to '$SUFFIX'."
echo_log "Successfully added '$OU' to '$SUFFIX'."
}
user2LDAP() {
set +e
GNAME=$1
FNAME=$2
_USER="$3"
_GROUP="$_USER"
# Group GID
_GID=$(_findnextgid)
[ -z "_GID" ] && end_die "Cannot guess next free group ID."
# Add group to LDAP
_extractldif 4 | _filterldif | _utf8encode | _ldapadd
[ $? -eq 0 ] || end_die "Error adding group '$_GROUP' to LDAP."
echo_log "Successfully added group '$_GROUP' to LDAP."
###################
# User UID
_UID=$(_findnextuid)
[ -z "_UID" ] && end_die "Cannot guess next free user ID."
# Compute homedir
_HOMEDIR=$(echo "$UHOMES" | sed "s|%u|$_USER|g")
# Add user to LDAP
_extractldif 5 | \
sed -e "s||$GNAME|g" \
-e "s||$FNAME|g" \
-e "s||$PWHASH|g" \
| _filterldif | _utf8encode | _ldapadd
[ $? -eq 0 ] || end_die "Error adding user '$_USER' to LDAP."
echo_log "Successfully added user '$_USER' to LDAP."
# Create Home dir
if [ -e "$_HOMEDIR" ] ; then
warn_log "Skipped home directory creation for user '$_USER' (already exists)."
else
if [ -d "$HOMESKEL" ] ; then
mkdir -p $(dirname "$_HOMEDIR") 2>>"$LOGFILE" 1>/dev/null
cp -pR "$HOMESKEL/" "$_HOMEDIR" 2>>"$LOGFILE" 1>/dev/null
else
mkdir -p "$_HOMEDIR" 2>>"$LOGFILE" 1>/dev/null
fi
chmod "$HOMEPERMS" "$_HOMEDIR" 2>>"$LOGFILE" 1>/dev/null
chown -R "$_UID":"$_GID" "$_HOMEDIR" 2>>"$LOGFILE" 1>/dev/null
echo_log "Successfully created home directory '$_HOMEDIR' for user '$_USER'."
fi
set -e
}
checkPASSWD (){
PASSWD="$1"
local NUM=0
if [ $(expr length "$PASSWD") -ge $MINLEN ] ; then
[ -n "${PASSWD//[![:lower:]]/}" ] && NUM=$(($NUM+1))
[ -n "${PASSWD//[![:upper:]]/}" ] && NUM=$(($NUM+1))
[ -n "${PASSWD//[![:digit:]]/}" ] && NUM=$(($NUM+1))
[ -n "${PASSWD//[![:punct:]]/}" ] && NUM=$(($NUM+1))
fi
echo $NUM
}
createPASSWD (){
local NUM=0
while [ $NUM -lt $MINCLS ] ; do
PASSWD=$(slappasswd -g)
NUM=$(checkPASSWD "$PASSWD")
done
echo "$PASSWD"
}
###########################################
FILE=$1
GOSAOU=$2
# Source runtime file
_RUNTIMEFILE="/usr/share/ldapscripts/runtime"
. "$_RUNTIMEFILE"
# We need to overwrite variables defined in the configuration
# and sourced in the runtime file above:
SUFFIX="$GOSAOU,ou=gosa,dc=intern"
SUFFIX=${SUFFIX#,} # remove ',' if $GOSAOU=""
GIDSTART="10000"
UIDSTART="10000"
## Map LDAP structure on the home directory tree if not switched off:
if [ -n "$GOSAOU" ] && [ "$3" != "--no-map" ] ; then
HSUFFIX=$(echo -n "${GOSAOU}," | tac -s "," | sed -e "s|ou=||g" -e "s|,|\/|g" )
UHOMES=${UHOMES/\%u/${HSUFFIX}%u}
fi
## Password restrictions (compliant with kerberos policy):
MINLEN=4 # minimal password length (max 8 with slappasswd as password generator)
MINCLS=2 # minimal number of character classes
if [ ! -r "$FILE" ] ; then
cat < [ou=[,ou=...] [--no-map]]
Where contains rows of first and last names:
... ...
Empty lines or lines starting with a '#' will be ignored. The
generated password is appended to the line during processing, the line
commented.
Optionally it is possible to specify an organizational unit within the
GOsa tree. The users will be added to that department. The location
of the home directory created will map the structure of the
organizational units in LDAP. This feature can be switched off with
the --no-map option.
Examples:
* add users to GOsa base, home directory: '//':
add2gosa
* add users to department 'ou=2013,ou=students', home directory
'//students/2013/':
add2gosa ou=2013,ou=students
The department has to be created in GOsa before adding users.
EOF
exit 1
fi
sync_nscd
# Test if dn exists:
_ldapsearch "$SUFFIX" "(objectClass=organizationalUnit)" "dn" \
| grep -q "$SUFFIX" || end_die "No Department '$SUFFIX' found. Create it in GOsa first."
# Create ou=groups if missing:
_ldapsearch "$GSUFFIX,$SUFFIX" "(objectClass=organizationalUnit)" "dn" \
| grep -q "$GSUFFIX,$SUFFIX" || ou2LDAP $GSUFFIX
# Create ou=people if missing:
_ldapsearch "$USUFFIX,$SUFFIX" "(objectClass=organizationalUnit)" "dn" \
| grep -q "$USUFFIX,$SUFFIX" || ou2LDAP $USUFFIX
echo
chmod 600 $FILE
IFS=$'\n'
for LINE in $(grep -Ev "^(#|[[:space:]]*$)" $FILE | sed "s/\#.*//g" | awk '{print $1, $2, $3}') ; do
GNAME=`echo "$LINE" | cut -d " " -f1`
FNAME=`echo "$LINE" | cut -d " " -f2`
USERNAME=$(mk_uname ${GNAME} ${FNAME})
echo "---------------- $USERNAME ----------------"
PASSWD=$(createPASSWD)
PWHASH=$(slappasswd -s $PASSWD -h {SSHA})
echo "Password and hash created."
sed -i "s|\($GNAME[[:space:]]\+$FNAME\)|\# \1:\t $USERNAME\t ${PASSWD}|" $FILE
user2LDAP "$GNAME" "$FNAME" "$USERNAME" "$PWHASH"
USERDN="dn=uid=$USERNAME,$USUFFIX,$SUFFIX"
kadmin.local -q "add_principal -pw "$PASSWD" -x $USERDN $USERNAME"
echo
done
cat <,
###objectClass: top
###objectClass: organizationalUnit
###ou:
# Ldif group template ###############################
####dn: cn=,,
####objectClass:
####cn:
####gidNumber:
####description: Group of user
# Ldif user template ################################
#####dn: uid=,,
#####objectClass: person
#####objectClass: organizationalPerson
#####objectClass: inetOrgPerson
#####objectClass: gosaAccount
#####objectClass: posixAccount
#####objectClass: shadowAccount
#####sn:
#####givenName:
#####cn:
#####gecos:
#####uid:
#####homeDirectory:
#####loginShell:
#####uidNumber:
#####gidNumber:
#####userPassword:
debian-lan-config-0.13/fai/config/files/usr/local/sbin/dhcpd-keytab/ 0000755 0000000 0000000 00000000000 12176652571 022077 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/sbin/dhcpd-keytab/SERVER_A 0000755 0000000 0000000 00000003417 12176652571 023300 0 ustar #!/bin/bash
#
# Send kerberos keytab to machines during PXE installation.
# Called by dhcpd on lease.
#
set -e
DATADIR="/root/installation/"
NFSROOT="/srv/fai/nfsroot/live/filesystem.dir/"
MACHINE=$1
WAIT=60
if [ ! -e $DATADIR/${MACHINE}.keytab ] ; then
## The keytab is missing or in use already, exit.
exit 0
elif [ "$2" != "go" ]; then
## Fork to the background and run script.
$0 "$1" go >> /var/log/`basename ${0}`.log 2>&1 &
exit 0
fi
## Only one process:
STAMP=/tmp/`basename ${0}`_$MACHINE
if [ -e $STAMP ] ; then
exit 0
else
touch $STAMP
trap "rm -f $STAMP" ERR SIGHUP SIGINT SIGTERM
fi
cleanup(){
echo $1
rm -f $STAMP
exit 0
}
## Make chroot accessible to root:
if [ ! -e ${NFSROOT}/root/.ssh/authorized_keys ] ; then
echo $MACHINE `date`
mkdir -vp ${NFSROOT}/root/.ssh/
for KEY in `ls /root/.ssh/*.pub` ; do
cat $KEY >> ${NFSROOT}/root/.ssh/authorized_keys
done
fi
sleep $WAIT
for i in `seq 8` ; do
echo $MACHINE `date`
echo "Copying keytab to $MACHINE: $i try."
## Do not check host ID and do not add the host ID to known_hosts,
## as the host will have a differen ID after installation:
if ! scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=\"$STAMP\" -p \
$DATADIR/${MACHINE}.keytab root@${MACHINE}:/target/etc/krb5.keytab ; then
echo "Copying failed, sleeping $WAIT s."
sleep $WAIT
ping -c 2 $MACHINE > /dev/null || cleanup "Cannot ping $MACHINE, exiting."
continue
fi
echo "$DATADIR/${MACHINE}.keytab copied to ${MACHINE}."
DATE=`date +%Y%m%d`
mv -v $DATADIR/${MACHINE}.keytab $DATADIR/${MACHINE}.keytab_$DATE
cleanup "Success! ${MACHINE} activated."
done
cleanup "Failed to activate ${MACHINE}. Run 'debian-lan key2machine ${MACHINE}' manually."
debian-lan-config-0.13/fai/config/files/usr/local/sbin/gosa-remove/ 0000755 0000000 0000000 00000000000 12176652571 021764 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/sbin/gosa-remove/GOSA 0000755 0000000 0000000 00000003503 12176652571 022444 0 ustar #!/bin/sh
set -e
## This script is run by www-data using sudo. Keep that in mind!
## Make sure that malicious execution cannot hurt.
##
## This script removes the home directories and principals for users removed with gosa.
## Home directories are not purged immediately, but marked with a time stamp. Next time
## this script is run it looks for all home directories marked for removal and removes
## directories older than the given age $MAXAGE.
##
## Malicious execution can mark directories for purging, but if $MAXAGE is chosen not
## too short, this will be detected by the owner and no data will get lost.
USERID=$1
HOMEDIR=$2
## minimum age to keep a directory before it is purged
## in days (only integer values):
MAXAGE_DAYS=500
####################################
MAXAGE_SEC=$(( $MAXAGE_DAYS*24*60*60 ))
[ -d $HOMEDIR ] || exit 1
PREFIX=/lan
HOSTNAME=$(hostname -s)
echo "$HOMEDIR" | egrep -q "^$PREFIX/$HOSTNAME.*$USERID" || exit 1
## move mail directory to home directory
if [ -d /var/mail/$USERID ]; then
mkdir -p $HOMEDIR/Maildir/
mv /var/mail/$USERID/* $HOMEDIR/Maildir/
rmdir /var/mail/$USERID
fi
## rename home directory and delete principal:
HOME=`dirname $HOMEDIR`
RM_HOMEDIR="$HOME/rm_"`date "+%Y%m%d"`"_"`basename $HOMEDIR`
mv $HOMEDIR $RM_HOMEDIR
chown root:root $RM_HOMEDIR
chmod go-rwx $RM_HOMEDIR
kadmin.local -q "delete_principal $USERID"
logger -t gosa-remove -p notice Home directory \'$HOMEDIR\' marked for deletion and principal \'$USERID\' removed.
for DIR in `find $HOME -maxdepth 1 -type d -regextype posix-egrep -regex ".*/rm_[0-9]{8}_[^/]+"` ; do
RMDATE=`echo $DIR | sed "s/.*rm_\([0-9]\{8\}\)_.*/\1/"`
AGE=$(( `date +"%s"`-`date +"%s" -d $RMDATE` ))
if [ $AGE -gt $MAXAGE_SEC ] ; then
rm -rf $DIR
logger -t gosa-remove -p notice Home directory \'$DIR\' purged.
fi
done
exit 0
debian-lan-config-0.13/fai/config/files/usr/local/sbin/nbdswapd/ 0000755 0000000 0000000 00000000000 12176652571 021342 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/sbin/nbdswapd/DISKLESS_SERVER 0000755 0000000 0000000 00000000430 12176652571 023574 0 ustar #!/bin/sh
#
# Inspired by nbdswapd from the ltsp-server package.
set -e
## swap size (in MB):
SIZE="128"
SWAP="$1"
SWAPDIR=${SWAP%/*}
test -d $SWAPDIR || mkdir -p $SWAPDIR
## create swap file:
dd if=/dev/zero of=$SWAP bs=1M count=0 seek="$SIZE" 2> /dev/null
chmod 600 $SWAP
debian-lan-config-0.13/fai/config/files/usr/local/sbin/gosa-sync/ 0000755 0000000 0000000 00000000000 12176652571 021443 5 ustar debian-lan-config-0.13/fai/config/files/usr/local/sbin/gosa-sync/GOSA 0000755 0000000 0000000 00000003025 12176652571 022122 0 ustar #!/bin/bash
set -e
## This script is run by www-data using sudo. Keep that in mind!
## Make sure that malicious execution cannot hurt.
##
## This script synchronizes the kerberos password of principals to the
## posix password whenever the password is changed in ldap by gosa. To
## make sure only authorized changes happen, it is tested if the
## supplied password corresponds to the supplied distinguished name in
## ldap.
##
## A caller not knowing the correct ldap password cannot change the
## principal's one.
USERDN="$1"
USERID=`echo "$USERDN" | sed "s/^uid=\([^,]*\),.*$/\1/"`
## The new user password is in environment, $USERPASSWORD.
## Check if provided password corresponds to hash saved in ldap database:
TMPFILE=$(tempfile)
trap "rm -f $TMPFILE" ERR SIGHUP SIGINT SIGTERM
cat < "$TMPFILE"
$USERPASSWORD
EOF
IAM=`ldapwhoami -x -Z -y "$TMPFILE" -D "$USERDN" 2>/dev/null || true`
# Escapes " because kadmin needs to use double quotes:
EUSERPASSWORD="$(cat $TMPFILE | sed -e 's/\"/\"\"/g')"
if [ "$IAM" = "dn:$USERDN" ] ; then
cat > "$TMPFILE" < /dev/null) 2>&1)
if [ -z "$RET" ] ; then
logger -t gosa-sync -p notice "Sucessfully changed kerberos password for '$USERID'."
else
logger -t gosa-sync -p warning "$RET"
echo "$RET"
fi
else
RET="Could not verify password for '$USERID'. Nothing done."
echo $RET
logger -t gosa-sync -p warning "$RET"
fi
rm "$TMPFILE"
exit 0
debian-lan-config-0.13/fai/config/files/usr/share/ 0000755 0000000 0000000 00000000000 12176652571 016615 5 ustar debian-lan-config-0.13/fai/config/files/usr/share/libpam-script/ 0000755 0000000 0000000 00000000000 12176652571 021363 5 ustar debian-lan-config-0.13/fai/config/files/usr/share/libpam-script/pam_script_auth/ 0000755 0000000 0000000 00000000000 12176652571 024545 5 ustar debian-lan-config-0.13/fai/config/files/usr/share/libpam-script/pam_script_auth/ROAMING 0000755 0000000 0000000 00000001721 12176652571 025570 0 ustar #!/bin/sh
#
# Create user's local home directory if it does not exist.
# Use Kerberos key as machine key if machine key is unavailable.
#
set -e
FILE="/tmp/krb5cc_roaming"
NFSHOMES="/lan/mainserver/home0/"
## Find path of user's local home directory:
HOMEDIR=$(getent passwd "$PAM_USER" | cut -d : -f 6 | sed "s:$NFSHOMES:/home/:")
if [ "$PAM_USER" = "root" ] ; then
exit 0
elif [ -n "$HOMEDIR" ] && [ ! -d "$HOMEDIR" ] ; then
## Create local home directory if it does not exist:
umask 0022
mkdir -p $(dirname "$HOMEDIR")
cp -pR /etc/skel "$HOMEDIR"
chmod 750 "$HOMEDIR"
chown -R $PAM_USER:$PAM_USER "$HOMEDIR"
echo "Successfully created off-line home directory '$HOMEDIR' for user '$PAM_USER'."
fi
# Use Kerberos key as machine key if machine key is unavailable:
if [ ! -e /etc/krb5.keytab ] && [ ! -e "$FILE" ] ; then
ID=$(id -u "$PAM_USER")
cp -v /tmp/krb5cc_${ID}_* $FILE
/etc/init.d/autofs restart > /dev/null
fi
exit 0
debian-lan-config-0.13/fai/config/files/usr/share/libpam-script/pam_script_auth/DISKLESS_CLIENT 0000755 0000000 0000000 00000000441 12176652571 026751 0 ustar #!/bin/sh
#
# Use Kerberos key as machine key if machine key is unavailable.
#
set -e
FILE="/tmp/krb5cc_diskless"
if [ "$PAM_USER" != "root" ] && [ ! -e /etc/krb5.keytab ] && [ ! -e $FILE ] ; then
cp -v /tmp/krb5cc_pam_* $FILE
/etc/init.d/autofs restart > /dev/null
fi
exit 0
debian-lan-config-0.13/fai/config/files/etc/ 0000755 0000000 0000000 00000000000 12176652571 015455 5 ustar debian-lan-config-0.13/fai/config/files/etc/sssd/ 0000755 0000000 0000000 00000000000 12176652571 016431 5 ustar debian-lan-config-0.13/fai/config/files/etc/sssd/sssd.conf/ 0000755 0000000 0000000 00000000000 12176652571 020331 5 ustar debian-lan-config-0.13/fai/config/files/etc/sssd/sssd.conf/ROAMING 0000644 0000000 0000000 00000001163 12176652571 021351 0 ustar [sssd]
config_file_version = 2
reconnection_retries = 3
sbus_timeout = 30
services = nss, pam
domains = intern
[nss]
filter_groups = root
filter_users = root
reconnection_retries = 3
[pam]
reconnection_retries = 3
[domain/intern]
; Using enumerate = true leads to high load and slow response
enumerate = false
cache_credentials = true
id_provider = ldap
auth_provider = krb5
chpass_provider = krb5
ldap_uri = ldap://ldap
ldap_search_base = dc=intern
ldap_tls_reqcert = demand
ldap_tls_cacert = /etc/ldap/slapd.crt
krb5_kdcip = kerberos
krb5_realm = INTERN
krb5_changepw_principle = kadmin/changepw
krb5_auth_timeout = 15
debian-lan-config-0.13/fai/config/files/etc/icinga/ 0000755 0000000 0000000 00000000000 12176652571 016707 5 ustar debian-lan-config-0.13/fai/config/files/etc/icinga/objects/ 0000755 0000000 0000000 00000000000 12176652571 020340 5 ustar debian-lan-config-0.13/fai/config/files/etc/icinga/objects/hostgroups_icinga.cfg/ 0000755 0000000 0000000 00000000000 12176652571 024625 5 ustar debian-lan-config-0.13/fai/config/files/etc/icinga/objects/hostgroups_icinga.cfg/LOG_SERVER 0000644 0000000 0000000 00000003154 12176652571 026262 0 ustar #### all machines ####
define hostgroup {
hostgroup_name all
alias All Servers
members *
}
define hostgroup {
hostgroup_name debian-servers
alias Debian GNU/Linux Servers
members *
}
#### server ####
define hostgroup {
hostgroup_name ssh-servers
alias SSH servers
members mainserver
hostgroup_members workstation
}
define hostgroup {
hostgroup_name http-servers
alias HTTP servers
members mainserver
}
define hostgroup {
hostgroup_name ldap-servers
alias LDAP servers
members mainserver
}
define hostgroup {
hostgroup_name nfs-servers
alias NFS servers
members mainserver
}
define hostgroup {
hostgroup_name smtp-servers
alias SMTP servers
members mainserver
}
define hostgroup {
hostgroup_name imap-servers
alias IMAP servers
members mainserver
}
define hostgroup {
hostgroup_name cups-servers
alias CUPS servers
members mainserver
}
define hostgroup {
hostgroup_name dns-servers
alias DNS
members mainserver
}
#### workstations and diskless ####
define hostgroup {
hostgroup_name workstation
alias Debian GNU/Linux Workstation
}
define hostgroup {
hostgroup_name diskless
alias Debian GNU/Linux Diskless
}
debian-lan-config-0.13/fai/config/files/etc/icinga/objects/hosts.cfg/ 0000755 0000000 0000000 00000000000 12176652571 022236 5 ustar debian-lan-config-0.13/fai/config/files/etc/icinga/objects/hosts.cfg/LOG_SERVER 0000644 0000000 0000000 00000000630 12176652571 023667 0 ustar define host{
use generic-host
host_name gateway
address $GATEWAY
}
define host{
use generic-host
host_name mainserver
address 127.0.0.1
}
define host{
use generic-host
host_name workstation00
hostgroups workstation
notifications_enabled 0
}
debian-lan-config-0.13/fai/config/files/etc/icinga/objects/services_icinga.cfg/ 0000755 0000000 0000000 00000000000 12176652571 024233 5 ustar debian-lan-config-0.13/fai/config/files/etc/icinga/objects/services_icinga.cfg/LOG_SERVER 0000644 0000000 0000000 00000013661 12176652571 025674 0 ustar #### servers ####
define service{
host mainserver
service_description APT
check_command check_apt
use generic-service
}
define service{
hostgroup_name cups-servers
service_description CUPS
check_command check_cups
use generic-service
}
define service{
host mainserver
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0
use generic-service
}
define service{
host mainserver
service_description Current Users
check_command check_users!20!50
use generic-service
}
define service{
hostgroup_name dns-servers
service_description DNS extern
check_command check_dns
use generic-service
}
define service{
hostgroup_name dns-servers
service_description DNS intern
check_command check_dig!'domain.intern'
use generic-service
}
define service{
host mainserver
service_description Disk Space
check_command check_all_disks!20%!10%
use generic-service
}
define service {
hostgroup_name http-servers
service_description HTTP
check_command check_http
use generic-service
}
define service{
hostgroup_name imap-servers
service_description IMAP
check_command check_imap
use generic-service
}
define service{
hostgroup_name ldap-servers
service_description LDAP
check_command debian-lan_check_ldap!dc=intern
use generic-service
}
define service{
hostgroup_name nfs-servers
service_description NFS
check_command debian-lan_check_nfs
use generic-service
}
define service{
host mainserver
service_description NTP Server
check_command check_ntp_ntpq
use generic-service
}
define service{
hostgroup_name smtp-servers
service_description SMTP
check_command check_smtp
use generic-service
}
define service {
hostgroup_name ssh-servers
service_description SSH
check_command check_ssh
use generic-service
}
define service{
host mainserver
service_description Squid
check_command check_squid!3128!'http://www.intern'
use generic-service
}
define service{
host mainserver
service_description Swap
check_command debian-lan_check_swap
use generic-service
}
define service{
host mainserver
service_description Total Procs
check_command check_procs!250!400
use generic-service
}
define service{
host mainserver
service_description Zombie Procs
check_command check_procs_zombie!5!10
use generic-service
}
#### gateway
define service{
host gateway
service_description Alive
check_command check-host-alive
use generic-service
}
define service{
host gateway
service_description Internet
check_command debian-lan_check_internet!8.8.8.8
use generic-service
}
#### nrpe (remote) machines
define service{
hostgroup_name workstation
service_description APT
check_command check_nrpe_1arg!check_apt
use generic-service
}
define service{
hostgroup_name workstation,diskless
service_description Current Load
check_command check_nrpe_1arg!debian-lan_check_load
use generic-service
}
define service{
hostgroup_name workstation,diskless
service_description Current Users
check_command check_nrpe_1arg!debian-lan_check_users
use generic-service
}
define service{
hostgroup_name workstation
service_description Disk Space
check_command check_nrpe_1arg!debian-lan_check_all_disks
use generic-service
}
define service{
hostgroup_name workstation
service_description Kerberos Key
check_command check_nrpe_1arg!debian-lan_check_file_age
use generic-service
}
define service{
hostgroup_name workstation,diskless
service_description Swap
check_command check_nrpe_1arg!debian-lan_check_swap
use generic-service
}
define service{
hostgroup_name workstation,diskless
service_description Time
check_command check_nrpe_1arg!debian-lan_check_ntp_time
use generic-service
}
define service{
hostgroup_name workstation,diskless
service_description Total Procs
check_command check_nrpe_1arg!debian-lan_check_procs
use generic-service
}
define service{
hostgroup_name workstation,diskless
service_description Zombie Procs
check_command check_nrpe_1arg!debian-lan_check_procs_zombie
use generic-service
}
debian-lan-config-0.13/fai/config/files/etc/icinga/objects/commands.cfg/ 0000755 0000000 0000000 00000000000 12176652571 022677 5 ustar debian-lan-config-0.13/fai/config/files/etc/icinga/objects/commands.cfg/LOG_SERVER 0000644 0000000 0000000 00000001147 12176652571 024334 0 ustar define command{
command_name debian-lan_check_swap
command_line /usr/lib/nagios/plugins/check_swap -w 50% -c 20%
}
define command{
command_name debian-lan_check_ldap
command_line /usr/lib/nagios/plugins/check_ldap -H '$HOSTNAME$' -b '$ARG1$' -T
}
define command{
command_name debian-lan_check_nfs
command_line /usr/lib/nagios/plugins/check_rpc -H '$HOSTADDRESS$' -C nfs -c2,3,4
}
define command{
command_name debian-lan_check_internet
command_line /usr/lib/nagios/plugins/check_ping -H '$ARG1$' -w 50,10% -c 100,100% -p 5
}
debian-lan-config-0.13/fai/config/files/etc/cron.daily/ 0000755 0000000 0000000 00000000000 12176652571 017517 5 ustar debian-lan-config-0.13/fai/config/files/etc/cron.daily/backup/ 0000755 0000000 0000000 00000000000 12176652571 020764 5 ustar debian-lan-config-0.13/fai/config/files/etc/cron.daily/backup/SERVER_A 0000755 0000000 0000000 00000003423 12176652571 022162 0 ustar #!/bin/bash
#
# backup ldap, package selection and debconf values
# run dirvish
#
set -e
DIR="/backup/"
MISC_DIR="${DIR}/tmp/misc/"
# from dirvish:
mount_check() {
mntout=`tempfile -p mount`
mount $1 >$mntout 2>&1 || true
if [ ! -d $1/lost+found ]; then # only works for "real" filesystems :-)
# (Yes, I know about reiserfs.)
echo "'mount $1' failed?! Stopping."
echo "mount output:"
cat $mntout
rm -f $mntout
exit 2
fi
if stat $1 | grep 'Inode: 2[^0-9]' >/dev/null; then # ditto
rm -f $mntout
return 0 # ok
fi
echo "$1 isn't inode 2 ?! Mount must have failed; stopping."
echo ''
stat $1
echo "mount output:"
cat $mntout
rm -f $mntout
umount $1
exit 2
}
if grep -q ${DIR%/} /etc/fstab ; then
MNT=true
mount_check $DIR
trap "rc=$?; umount $DIR; exit $rc" ERR
fi
## Backup LDAP, package selection and debconf data.
## Drop the data in $MISC_DIR and use dirvish for
## the backup, thereby making use of its expire
## mechanism:
if [ -x /usr/sbin/slapcat ] ; then
slapcat -l $MISC_DIR/LDAP.ldif_new
fi
dpkg --get-selections > $MISC_DIR/package.selection_new
debconf-get-selections > $MISC_DIR/debconf.selection_new
## Check if the data has changed, if not keep the old file:
for FILE in `ls $MISC_DIR/*_new` ; do
if diff -qN $FILE ${FILE%_new} >/dev/null ; then
## nothing changed:
rm $FILE
else
## use new file:
mv $FILE ${FILE%_new}
fi
done
chmod 640 $MISC_DIR/*
## dirvish:
if [ ! -x /usr/sbin/dirvish-expire ]; then exit 0; fi
if [ ! -s /etc/dirvish/master.conf ]; then exit 0; fi
/usr/sbin/dirvish-expire --quiet && /usr/sbin/dirvish-runall --quiet
rc=$?
if [ $MNT ] ; then
umount $DIR || rc=$?
fi
exit $rc
debian-lan-config-0.13/fai/config/files/etc/gosa/ 0000755 0000000 0000000 00000000000 12176652571 016406 5 ustar debian-lan-config-0.13/fai/config/files/etc/gosa/gosa.conf/ 0000755 0000000 0000000 00000000000 12176652571 020263 5 ustar debian-lan-config-0.13/fai/config/files/etc/gosa/gosa.conf/GOSA 0000644 0000000 0000000 00000034066 12176652571 020750 0 ustar
debian-lan-config-0.13/fai/config/files/etc/nbd-server/ 0000755 0000000 0000000 00000000000 12176652571 017524 5 ustar debian-lan-config-0.13/fai/config/files/etc/nbd-server/conf.d/ 0000755 0000000 0000000 00000000000 12176652571 020673 5 ustar debian-lan-config-0.13/fai/config/files/etc/nbd-server/conf.d/swap.conf/ 0000755 0000000 0000000 00000000000 12176652571 022571 5 ustar debian-lan-config-0.13/fai/config/files/etc/nbd-server/conf.d/swap.conf/DISKLESS_SERVER 0000644 0000000 0000000 00000000135 12176652571 025022 0 ustar [swap]
exportname = /tmp/nbd-swap/%s
prerun = /usr/local/sbin/nbdswapd %s
postrun = rm -f %s
debian-lan-config-0.13/fai/config/files/etc/krb5kdc/ 0000755 0000000 0000000 00000000000 12176652571 017002 5 ustar debian-lan-config-0.13/fai/config/files/etc/krb5kdc/kadm5.acl/ 0000755 0000000 0000000 00000000000 12176652571 020541 5 ustar debian-lan-config-0.13/fai/config/files/etc/krb5kdc/kadm5.acl/KERBEROS_KDC 0000644 0000000 0000000 00000000126 12176652571 022360 0 ustar ## access controls for the Kerberos KDC
root/admin@INTERN *
*@INTERN cil
*/*@INTERN i
debian-lan-config-0.13/fai/config/files/etc/krb5kdc/kdc.conf/ 0000755 0000000 0000000 00000000000 12176652571 020467 5 ustar debian-lan-config-0.13/fai/config/files/etc/krb5kdc/kdc.conf/KDC_LDAP 0000644 0000000 0000000 00000001046 12176652571 021614 0 ustar [kdcdefaults]
kdc_ports = 750,88
[realms]
INTERN = {
admin_keytab = FILE:/etc/krb5kdc/kadm5.keytab
acl_file = /etc/krb5kdc/kadm5.acl
key_stash_file = /etc/krb5kdc/stash
kdc_ports = 750,88
max_life = 10h 0m 0s
max_renewable_life = 7d 0h 0m 0s
master_key_type = des3-hmac-sha1
supported_enctypes = aes256-cts:normal arcfour-hmac:normal des3-hmac-sha1:normal des-cbc-crc:normal des:normal des:v4 des:norealm des:onlyrealm des:afs3
default_principal_flags = +preauth
}
debian-lan-config-0.13/fai/config/files/etc/fai/ 0000755 0000000 0000000 00000000000 12176652571 016214 5 ustar debian-lan-config-0.13/fai/config/files/etc/fai/nfsroot.conf/ 0000755 0000000 0000000 00000000000 12176652571 020632 5 ustar debian-lan-config-0.13/fai/config/files/etc/fai/nfsroot.conf/SERVER_A 0000644 0000000 0000000 00000000532 12176652571 022023 0 ustar # For a detailed description see nfsroot.conf(5)
FAI_ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
NFSROOT=/srv/fai/nfsroot
TFTPROOT=/srv/tftp/fai
NFSROOT_HOOKS=/etc/fai/nfsroot-hooks/
FAI_DEBOOTSTRAP_OPTS="--exclude=info"
# Configuration space
FAI_CONFIGDIR=/srv/fai/config
FAI_DEBOOTSTRAP="wheezy http://aptcache:3142/http.debian.net/debian"
debian-lan-config-0.13/fai/config/files/etc/fai/nfsroot.conf/FAISERVER 0000644 0000000 0000000 00000000570 12176652571 022105 0 ustar # For a detailed description see nfsroot.conf(5)
FAI_ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
NFSROOT=/srv/fai/nfsroot
TFTPROOT=/srv/tftp/fai
NFSROOT_HOOKS=/etc/fai/nfsroot-hooks/
FAI_DEBOOTSTRAP_OPTS="--exclude=info"
# Configuration space
FAI_CONFIGDIR=/srv/fai/config
NFSROOT_ETC_HOSTS="192.168.33.250 faiserver"
FAI_DEBOOTSTRAP="wheezy http://faiserver:9999/debian"
debian-lan-config-0.13/fai/config/files/etc/fai/grub.cfg/ 0000755 0000000 0000000 00000000000 12176652571 017711 5 ustar debian-lan-config-0.13/fai/config/files/etc/fai/grub.cfg/SERVER_A 0000644 0000000 0000000 00000003627 12176652571 021112 0 ustar ## grub2 configuration
set default=" Boot OS of first partition on first disk"
set timeout=20
if loadfont /boot/grub/ascii.pf2 ; then
insmod png
set gfxmode=640x480
insmod gfxterm
insmod vbe
terminal_output gfxterm
fi
if background_image /boot/grub/fai.png ; then
set color_normal=black/black
set color_highlight=red/black
set menu_color_normal=black/black
set menu_color_highlight=black/yellow
else
set menu_color_normal=white/black
set menu_color_highlight=black/yellow
fi
# make sure we can access partitions
insmod part_msdos
insmod part_gpt
if [ ${iso_path} ] ; then
set loopback="findiso=${iso_path}"
fi
menuentry "" {
set gfxpayload=1024x768
linux /boot/vmlinuz boot=live
}
menuentry " FAI-CD (c) Thomas Lange, lange@debian.org" {
set gfxpayload=1024x768
linux /boot/vmlinuz boot=live
}
menuentry " _VERSIONSTRING_ " {
set gfxpayload=1024x768
linux /boot/vmlinuz boot=live
}
menuentry "" {
set gfxpayload=1024x768
linux /boot/vmlinuz boot=live
}
menuentry "" {
set gfxpayload=1024x768
linux /boot/vmlinuz boot=live
}
menuentry " Fully Automatic Installation - Debian-LAN: mainserver" {
set gfxpayload=1024x768
set root=(cd)
linux /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=install hostname=mainserver
initrd /boot/initrd.img
}
menuentry " Fully Automatic Installation - Debian-LAN: gateway" {
set gfxpayload=1024x768
set root=(cd)
linux /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=install hostname=gateway
initrd /boot/initrd.img
}
menuentry " FAI - System Information" {
set gfxpayload=1024x768
set root=(cd)
linux /boot/vmlinuz boot=live FAI_FLAGS="verbose,createvt" FAI_ACTION=sysinfo hostname=mainserver
initrd /boot/initrd.img
}
menuentry " Boot OS of first partition on first disk" {
set root=(hd0,1)
chainloader +1
}
debian-lan-config-0.13/fai/config/files/etc/fai/apt/ 0000755 0000000 0000000 00000000000 12176652571 017000 5 ustar debian-lan-config-0.13/fai/config/files/etc/fai/apt/sources.list/ 0000755 0000000 0000000 00000000000 12176652571 021435 5 ustar debian-lan-config-0.13/fai/config/files/etc/fai/apt/sources.list/SERVER_A 0000644 0000000 0000000 00000000501 12176652571 022622 0 ustar deb http://aptcache.intern:3142/http.debian.net/debian/ wheezy main
deb http://aptcache.intern:3142/security.debian.org/ stable/updates main
deb http://aptcache.intern:3142/http.debian.net/debian/ wheezy-updates main
## Backports repository:
deb http://aptcache.intern:3142/http.debian.net/debian/ wheezy-backports main
debian-lan-config-0.13/fai/config/files/etc/fai/NFSROOT/ 0000755 0000000 0000000 00000000000 12176652571 017346 5 ustar debian-lan-config-0.13/fai/config/files/etc/fai/NFSROOT/FAISERVER 0000644 0000000 0000000 00000001630 12176652571 020617 0 ustar # package list for creating the NFSROOT
PACKAGES aptitude
nfs-common fai-nfsroot module-init-tools ssh rdate lshw rpcbind
rsync lftp less dump reiserfsprogs e2fsprogs usbutils
hwinfo psmisc pciutils hdparm smartmontools parted mdadm lvm2
dnsutils ntpdate dosfstools xfsprogs xfsdump
procinfo numactl dialog
console-tools console-common
iproute udev subversion
xz-utils
cupt
grub-pc
cfengine2
# we need mkpasswd:
whois
# some network cards needs firmware
firmware-bnx2 firmware-bnx2x firmware-realtek
# dracut can replace live-boot
#dracut-network live-boot- live-boot-initramfs-tools-
# squeeze also needs initramfs-tools, even with dracut
#initramfs-tools
# choose if you like live-boot or dracut inside the nfsroot
live-boot
# you should not edit the lines below
# architecture dependend list of packages that are installed
PACKAGES aptitude I386
linux-image-686-pae
PACKAGES aptitude AMD64
linux-image-amd64
debian-lan-config-0.13/fai/config/files/etc/fai/fai.conf/ 0000755 0000000 0000000 00000000000 12176652571 017677 5 ustar debian-lan-config-0.13/fai/config/files/etc/fai/fai.conf/DEBIAN 0000644 0000000 0000000 00000000302 12176652571 020537 0 ustar # See fai.conf(5) for detailed information.
# Account for saving log files and calling fai-chboot.
LOGUSER=
# URL to access the fai config space.
FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config
debian-lan-config-0.13/fai/config/files/etc/resolv.conf/ 0000755 0000000 0000000 00000000000 12176652571 017713 5 ustar debian-lan-config-0.13/fai/config/files/etc/resolv.conf/DISKLESS_CLIENT 0000644 0000000 0000000 00000000044 12176652571 022113 0 ustar nameserver NAMESERVER
search intern
debian-lan-config-0.13/fai/config/files/etc/motd/ 0000755 0000000 0000000 00000000000 12176652571 016420 5 ustar debian-lan-config-0.13/fai/config/files/etc/motd/SERVER_A 0000644 0000000 0000000 00000000737 12176652571 017620 0 ustar
Debian-LAN -- Debian Local Area Network SERVER_A
===================================================
Realized by FAI:
Plan your installation, and FAI installs your plan.
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
debian-lan-config-0.13/fai/config/files/etc/motd/CLIENT_A 0000644 0000000 0000000 00000000737 12176652571 017570 0 ustar
Debian-LAN -- Debian Local Area Network CLIENT_A
===================================================
Realized by FAI:
Plan your installation, and FAI installs your plan.
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
debian-lan-config-0.13/fai/config/files/etc/motd/GATEWAY_A 0000644 0000000 0000000 00000000741 12176652571 017706 0 ustar
Debian-LAN -- Debian Local Area Network GATEWAY_A
====================================================
Realized by FAI:
Plan your installation, and FAI installs your plan.
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
debian-lan-config-0.13/fai/config/files/etc/motd/FAIBASE 0000644 0000000 0000000 00000000067 12176652571 017400 0 ustar
Plan your installation, and FAI installs your plan.
debian-lan-config-0.13/fai/config/files/etc/ldap/ 0000755 0000000 0000000 00000000000 12176652571 016375 5 ustar debian-lan-config-0.13/fai/config/files/etc/ldap/slapd.conf/ 0000755 0000000 0000000 00000000000 12176652571 020424 5 ustar debian-lan-config-0.13/fai/config/files/etc/ldap/slapd.conf/SERVER_A 0000644 0000000 0000000 00000007054 12176652571 021623 0 ustar #######################################################################
# Global Directives:
# Schema and objectClass definitions
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/nis.schema
include /etc/ldap/schema/inetorgperson.schema
include /etc/ldap/schema/kerberos.schema
include /etc/ldap/schema/autofs.schema
# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile /var/run/slapd/slapd.pid
# List of arguments that were passed to the server
argsfile /var/run/slapd/slapd.args
# Read slapd.conf(5) for possible values
loglevel none
# TLS/SSL
TLSCACertificateFile /etc/ldap/slapd.crt
TLSCertificateKeyFile /etc/ldap/slapd.key
TLSCertificateFile /etc/ldap/slapd.crt
TLSVerifyClient try
modulepath /usr/lib/ldap
moduleload back_hdb
# The maximum number of entries that is returned for a search operation
sizelimit 500
# The tool-threads parameter sets the actual amount of cpu's that is used
# for indexing.
tool-threads 1
defaultsearchbase "dc=intern"
security update_ssf=128 simple_bind=128
# Access via ldapi/unix socket is assumed to have 128 bit encryption.
# This is required to allow the Kerberos KDC to connect:
localssf 128
backend hdb
#######################################################################
#######################################################################
database hdb
# First database
suffix "dc=intern"
rootdn "cn=admin,dc=intern"
# Where the database file are physically stored
directory "/var/lib/ldap"
# The dbconfig settings are used to generate a DB_CONFIG file the first
# time slapd starts. They do NOT override existing an existing DB_CONFIG
# file. You should therefore change these settings in DB_CONFIG directly
# or remove DB_CONFIG and restart slapd for changes to take effect.
# For the Debian package we use 2MB as default but be sure to update this
# value if you have plenty of RAM
dbconfig set_cachesize 0 2097152 0
# Number of objects that can be locked at the same time.
dbconfig set_lk_max_objects 1500
# Number of locks (both requested and granted)
dbconfig set_lk_max_locks 1500
# Number of lockers
dbconfig set_lk_max_lockers 1500
# Indices to maintain
index default eq
index objectClass
index ou
index uidNumber
index gidNumber
index memberUid
index uniqueMember
index krbPwdPolicyReference
index krbPrincipalName pres,sub,eq
index cn pres,sub,eq
index uid pres,sub,eq
# Save the time that the entry gets modified, for database #1
lastmod on
# Checkpoint the BerkeleyDB database periodically in case of system
# failure and to speed slapd shutdown.
checkpoint 512 30
## map authentication via gssapi on user dn:
authz-regexp "uid=([^,]*),cn=gssapi,cn=auth"
"ldap:///dc=intern??sub?(uid=$1)"
access to attrs=userPassword
by anonymous auth
by self write
by * none
################# Kerberos-KDC access ##################
access to dn.subtree="cn=kerberos,dc=intern"
by dn.exact="cn=kdc,cn=kerberos,dc=intern" read
by dn.exact="cn=kadmin,cn=kerberos,dc=intern" write
by * none
access to attrs=krbPrincipalName,krbLastPwdChange,krbPrincipalKey,krbExtraData
by dn.exact="cn=kdc,cn=kerberos,dc=intern" read
by dn.exact="cn=kadmin,cn=kerberos,dc=intern" write
by self read
by * auth
## Default access; kadmin needs full access:
access to *
by dn.exact="cn=kadmin,cn=kerberos,dc=intern" write
by * read
debian-lan-config-0.13/fai/config/files/etc/ldap/slapd.conf/GOSA 0000644 0000000 0000000 00000010701 12176652571 021077 0 ustar #######################################################################
# Global Directives:
# Schema and objectClass definitions
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/nis.schema
include /etc/ldap/schema/inetorgperson.schema
include /etc/ldap/schema/kerberos.schema
include /etc/ldap/schema/autofs.schema
# These should be present for GOsa:
include /etc/ldap/schema/gosa/samba3.schema
include /etc/ldap/schema/gosa/gosystem.schema
include /etc/ldap/schema/gosa/gofon.schema
include /etc/ldap/schema/gosa/gofax.schema
include /etc/ldap/schema/gosa/goto.schema
include /etc/ldap/schema/gosa/goserver.schema
include /etc/ldap/schema/gosa/gosa-samba3.schema
include /etc/ldap/schema/gosa/trust.schema
include /etc/ldap/schema/gosa/sudo.schema
# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile /var/run/slapd/slapd.pid
# List of arguments that were passed to the server
argsfile /var/run/slapd/slapd.args
# Read slapd.conf(5) for possible values
loglevel none
# TLS/SSL
TLSCACertificateFile /etc/ldap/slapd.crt
TLSCertificateKeyFile /etc/ldap/slapd.key
TLSCertificateFile /etc/ldap/slapd.crt
TLSVerifyClient try
modulepath /usr/lib/ldap
moduleload back_hdb
# The maximum number of entries that is returned for a search operation
sizelimit 500
# The tool-threads parameter sets the actual amount of cpu's that is used
# for indexing.
tool-threads 1
defaultsearchbase "dc=intern"
security update_ssf=128 simple_bind=128
# Access via ldapi/unix socket is assumed to have 128 bit encryption.
# This is required to allow the Kerberos KDC to connect:
localssf 128
backend hdb
#######################################################################
# FIXME
#database config
#rootdn cn=config
#rootpw @LDAP_PW@
#######################################################################
database hdb
# First database
suffix "dc=intern"
rootdn "cn=admin,dc=intern"
# Where the database file are physically stored
directory "/var/lib/ldap"
# The dbconfig settings are used to generate a DB_CONFIG file the first
# time slapd starts. They do NOT override existing an existing DB_CONFIG
# file. You should therefore change these settings in DB_CONFIG directly
# or remove DB_CONFIG and restart slapd for changes to take effect.
# For the Debian package we use 2MB as default but be sure to update this
# value if you have plenty of RAM
dbconfig set_cachesize 0 2097152 0
# Number of objects that can be locked at the same time.
dbconfig set_lk_max_objects 1500
# Number of locks (both requested and granted)
dbconfig set_lk_max_locks 1500
# Number of lockers
dbconfig set_lk_max_lockers 1500
# Indices to maintain
index default eq
index objectClass
index ou
index uidNumber
index gidNumber
index memberUid
index uniqueMember
index krbPwdPolicyReference
index krbPrincipalName pres,sub,eq
index cn pres,sub,eq
index uid pres,sub,eq
index sudoUser eq,sub
# Save the time that the entry gets modified, for database #1
lastmod on
# Checkpoint the BerkeleyDB database periodically in case of system
# failure and to speed slapd shutdown.
checkpoint 512 30
## map authentication via gssapi on user dn:
authz-regexp "uid=([^,]*),cn=gssapi,cn=auth"
"ldap:///dc=intern??sub?(uid=$1)"
## map authentication via sasl on user dn:
#authz-regexp "uid=([^,]*),cn=intern,cn=gssapi,cn=auth"
# "ldap:///dc=intern??sub?(uid=$1)"
################# GOsa access ###################
access to dn.subtree="ou=gosa,dc=intern"
by dn.exact="cn=gosa,ou=gosa,dc=intern" manage
by * break
access to attrs=userPassword
by anonymous auth
by self write
by * none
################# Kerberos-KDC access ##################
access to dn.subtree="cn=kerberos,dc=intern"
by dn.exact="cn=kdc,cn=kerberos,dc=intern" read
by dn.exact="cn=kadmin,cn=kerberos,dc=intern" write
by * none
access to attrs=krbPrincipalName,krbLastPwdChange,krbPrincipalKey,krbExtraData
by dn.exact="cn=kdc,cn=kerberos,dc=intern" read
by dn.exact="cn=kadmin,cn=kerberos,dc=intern" write
by self read
by * auth
## Default access; kadmin needs full access:
access to *
by dn.exact="cn=kadmin,cn=kerberos,dc=intern" write
by * read
debian-lan-config-0.13/fai/config/files/etc/ldap/autofs.ldif/ 0000755 0000000 0000000 00000000000 12176652571 020613 5 ustar debian-lan-config-0.13/fai/config/files/etc/ldap/autofs.ldif/SERVER_A 0000644 0000000 0000000 00000002147 12176652571 022010 0 ustar ################## Autofs ###########################
## base dn for autofs is 'ou=automount,dc=intern'
dn: ou=automount,dc=intern
objectClass: top
objectClass: organizationalUnit
ou: automount
##
dn: ou=auto.master,ou=automount,dc=intern
objectClass: top
objectClass: automountMap
ou: auto.master
## reference to indirect automounts:
dn: cn=/lan,ou=auto.master,ou=automount,dc=intern
objectClass: automount
cn: /lan
automountInformation: ldap:ou=auto.lan,ou=automount,dc=intern
## indirect mounts:
dn: ou=auto.lan,ou=automount,dc=intern
objectClass: top
objectClass: automountMap
ou: auto.lan
## the /lan/mainserver submount
dn: cn=mainserver,ou=auto.lan,ou=automount,dc=intern
objectClass: automount
cn: mainserver
automountInformation: -fstype=autofs --timeout=60 ldap:ou=auto.mainserver,ou=automount,dc=intern
dn: ou=auto.mainserver,ou=automount,dc=intern
objectClass: top
objectClass: automountMap
ou: auto.mainserver
## the /lan/mainserver/* mount points
dn: cn=/,ou=auto.mainserver,ou=automount,dc=intern
objectClass: automount
cn: /
automountInformation: -fstype=nfs4,sec=krb5i,nodev,nosuid mainserver.intern:/&
debian-lan-config-0.13/fai/config/files/etc/ldap/krb5.ldif/ 0000755 0000000 0000000 00000000000 12176652571 020155 5 ustar debian-lan-config-0.13/fai/config/files/etc/ldap/krb5.ldif/SERVER_A 0000644 0000000 0000000 00000000634 12176652571 021351 0 ustar ################### Kerberos #######################
dn: cn=kerberos,dc=intern
objectClass: krbContainer
cn: kerberos
dn: cn=kdc,cn=kerberos,dc=intern
objectClass: organizationalRole
objectClass: simpleSecurityObject
cn: kdc
userPassword: @KDC_SERVICE_PW_HASH@
dn: cn=kadmin,cn=kerberos,dc=intern
objectClass: organizationalRole
objectClass: simpleSecurityObject
cn: kadmin
userPassword: @KDC_SERVICE_PW_HASH@
debian-lan-config-0.13/fai/config/files/etc/ldap/root.ldif/ 0000755 0000000 0000000 00000000000 12176652571 020275 5 ustar debian-lan-config-0.13/fai/config/files/etc/ldap/root.ldif/SERVER_A 0000644 0000000 0000000 00000001121 12176652571 021461 0 ustar ############### Root of tree and admin ##############
dn: dc=intern
objectClass: top
objectClass: dcObject
objectClass: labeledURIObject
ObjectClass: organization
description: Debian-LAN
dc: intern
o: Debian-LAN
labeledURI: http://www/ LDAP for Debian-LAN
dn: cn=admin,dc=intern
objectClass: organizationalRole
objectClass: simpleSecurityObject
cn: admin
description: LDAP Administrator
userPassword: @LDAP_ADMIN_PW_HASH@
dn: ou=people,dc=intern
objectClass: top
objectClass: organizationalUnit
ou: people
dn: ou=groups,dc=intern
objectClass: top
objectClass: organizationalUnit
ou: groups
debian-lan-config-0.13/fai/config/files/etc/ldap/gosa.ldif/ 0000755 0000000 0000000 00000000000 12176652571 020243 5 ustar debian-lan-config-0.13/fai/config/files/etc/ldap/gosa.ldif/GOSA 0000644 0000000 0000000 00000006643 12176652571 020730 0 ustar ## GOsa ou, full access for the GOsa admin:
dn: ou=gosa,dc=intern
objectClass: top
objectClass: organizationalUnit
objectClass: gosaAcl
objectClass: gosaDepartment
description: Debian-LAN
ou: gosa
gosaAclEntry: 0:psub:dWlkPWFkbWluLG91PXBlb3BsZSxvdT1nb3NhLGRjPWludGVybg==:all/all;cmdrw
gosaAclEntry: 1:psub:Kg==:users/user;s#sn;r#givenName;r#uid;r#gosaUserDefinedFilter;r#personalTitle;w#academicTitle;w#dateOfBirth;w#gender;w#preferredLanguage;w#base;r#userPicture;w#gosaLoginRestriction;r#o;r#ou;r#departmentNumber;r#manager;r#employeeNumber;r#employeeType;r#roomNumber;w#telephoneNumber;w#pager;w#mobile;w#facsimileTelephoneNumber;w#st;r#l;r#postalAddress;r#homePostalAddress;w#homePhone;w#labeledURI;w#userPassword;r#Certificate;r,users/posixAccount;sr,users/password;sw
## GOsa access to LDAP:
dn: cn=gosa,ou=gosa,dc=intern
objectClass: organizationalRole
objectClass: simpleSecurityObject
description: GOsa access to LDAP ou=gosa
cn: gosa
userPassword: @LDAP_ADMIN_PW_HASH@
## people and groups:
dn: ou=people,ou=gosa,dc=intern
objectClass: top
objectClass: organizationalUnit
ou: people
dn: ou=groups,ou=gosa,dc=intern
objectClass: top
objectClass: organizationalUnit
ou: groups
## First user 'admin':
dn: uid=admin,ou=people,ou=gosa,dc=intern
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: gosaAccount
objectClass: posixAccount
objectClass: shadowAccount
sn: Administrator
givenName: System
cn: System Administrator
gecos: System Administrator
uid: admin
homeDirectory: /lan/mainserver/home0/admin
loginShell: /bin/bash
uidNumber: 10000
gidNumber: 10000
userPassword: @ADMIN_PW_HASH@
dn: cn=admin,ou=groups,ou=gosa,dc=intern
cn: admin
description: Group of user admin
gidNumber: 10000
objectClass: top
objectClass: posixGroup
## User template:
dn: uid=default_user,ou=people,ou=gosa,dc=intern
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: gosaAccount
objectClass: gosaUserTemplate
objectClass: posixAccount
objectClass: shadowAccount
sn: default_user
givenName: default_user
uid: default_user
cn: default_user default_user
userPassword: {ssha}N0T$3T4N0W
homeDirectory: /lan/mainserver/home0/%uid
loginShell: /bin/bash
uidNumber: 9999
gidNumber: 2147483647
## sudo-ldap (allow www-data to run /usr/sbin/gosa-*)
dn: ou=sudoers,ou=gosa,dc=intern
objectClass: top
objectClass: organizationalUnit
ou: sudoers
dn: cn=defaults,ou=sudoers,ou=gosa,dc=intern
objectClass: top
objectClass: sudoRole
description: default sudo options
cn: defaults
sudoOption: env_reset
dn: cn=DebianLAN,ou=sudoers,ou=gosa,dc=intern
objectClass: top
objectClass: sudoRole
description: propagate GOsa's changes to the system
cn: DebianLAN
sudoOption: !authenticate
sudoOption: !syslog
sudoOption: env_keep=USERPASSWORD
sudoHost: mainserver
sudoRunAs: ALL
sudoCommand: /usr/local/sbin/gosa-sync
sudoCommand: /usr/local/sbin/gosa-remove
sudoCommand: /usr/local/sbin/gosa-create
sudoUser: www-data
## some admin roles: give admin(s) sudo access
dn: cn=Admins,ou=sudoers,ou=gosa,dc=intern
objectClass: top
objectClass: sudoRole
description: sudo access all machines
cn: Admins
sudoHost: ALL
sudoRunAs: ALL
sudoCommand: ALL
sudoUser: admin
dn: cn=ClientAdmins,ou=sudoers,ou=gosa,dc=intern
objectClass: top
objectClass: sudoRole
description: sudo access all clients
cn: ClientAdmins
sudoHost: workstation*
sudoHost: diskless*
sudoRunAs: ALL
sudoCommand: ALL
sudoUser: admin
debian-lan-config-0.13/fai/config/files/etc/rc.local/ 0000755 0000000 0000000 00000000000 12176652571 017152 5 ustar debian-lan-config-0.13/fai/config/files/etc/rc.local/FAISERVER 0000755 0000000 0000000 00000013073 12176652571 020432 0 ustar #! /bin/bash
## Setup script run at boot time.
set -e
umask 0022
############################
TIMEOUT=120
URL="http.debian.net"
INSTALLER="/usr/lib/debian-installer/images/*/*/text/debian-installer/"
DLROOT="/opt/live"
. /etc/fai/fai.conf
. /etc/fai/nfsroot.conf
##########
check_network () {
## Check if package repository is accessible:
if ! wget --quiet --output-document=/tmp/fai-setup $URL ; then
echo "Error accessing '$URL', check network and internet access."
exit 1
fi
}
setup_nfsroot () {
echo "Creating the nfsroot for FAI."
trap "rc=$?; rm -rf $NFSROOT; exit $rc" ERR SIGHUP SIGINT SIGTERM
fai-setup -e -v -l
trap - ERR SIGHUP SIGINT SIGTERM
## Create pxelinux boot configuration for workstationXX.
## The seq range is sed from the corresponding variable
## when fcopy'd:
echo -n "Creating pxelinux boot configurations: "
NUM=0
for IPADDR in `seq WS_RANGE` ; do
fai-chboot -IFvu $FAI_CONFIG_SRC PREFIX.$IPADDR &>> /var/log/fai/fai-chboot.log
echo -n "."
NUM=$(($NUM+1))
done
echo -e " Done.\nCreated $NUM workstation configurations."
if [ -d $DLROOT ] ; then
fai-chboot -vc diskless.tmpl default &>> /var/log/fai/fai-chboot.log
else
## create default configuration (sysinfo):
fai-chboot -Svu $FAI_CONFIG_SRC default &>> /var/log/fai/fai-chboot.log
sed -i "s/fai-generated/FAI System Information/g" $TFTPROOT/pxelinux.cfg/default
fi
}
setup_diskless () {
export LC_ALL=C
trap "rc=$?; rm -rf $DLROOT; exit $rc" ERR SIGHUP SIGINT SIGTERM
fai -vNu diskless dirinstall $DLROOT/filesystem.dir/
trap - ERR SIGHUP SIGINT SIGTERM
TEMPLATE=$TFTPROOT/pxelinux.cfg/diskless.tmpl
if [ ! -e $TEMPLATE ]; then
KERNEL=`basename $(ls $TFTPROOT/vmlinuz*)`
INITRD=`basename $(ls $TFTPROOT/initrd.img*)`
echo "Creating template with $KERNEL and $INITRD."
cat > $TEMPLATE <> /var/log/fai/fai-chboot.log
echo -n "."
NUM=$(($NUM+1))
done
echo -e " Done.\nCreated $NUM diskless machine configurations."
## Boot unknown machines as diskless:
fai-chboot -vc diskless.tmpl default &>> /var/log/fai/fai-chboot.log
}
setup_PXEinstaller () {
## Add Debian PXE Installer.
## Copy stuff, symlinks do not work (chroot environment):
cp -ru $INSTALLER $TFTPROOT
if [ -d $TFTPROOT/debian-installer/i386 ] ; then
KERNEL=`basename $(ls $TFTPROOT/vmlinuz*)`
INITRD=`basename $(ls $TFTPROOT/initrd.img*)`
## add installer menu
cat >> $TFTPROOT/pxelinux.cfg/default </dev/null | sh && sed -i "s%\(^munin-node-configure\)%\#\1%" $0
## Setup nfsroot for FAI:
if [ ! -d $NFSROOT ] ; then
cat <