diff options
Diffstat (limited to 'install-itzks-workstation')
-rw-r--r-- | install-itzks-workstation | 189 |
1 files changed, 122 insertions, 67 deletions
diff --git a/install-itzks-workstation b/install-itzks-workstation index ed5b4f9..af13ea5 100644 --- a/install-itzks-workstation +++ b/install-itzks-workstation @@ -1,20 +1,38 @@ #!/bin/bash # Script zur Installation einer ITZKS-Workstation (z.B. Notebooks am Katharineum) + +# Add user locadm as "local adminstrator" and add this user to sudoer-group adduser --gecos "Local Administrator" locadm adduser locadm sudo + +# Enlarge root-fs lvextend -L 20G /dev/vg_system/root resize2fs /dev/vg_system/root + +# Retrieve LDAP CA certificate invoke-rc.d fetch-ldap-cert start + +# Add itzks-package repo touch /etc/apt/sources.list.d/itzks.list echo "deb http://packages.it-zukunft-schule.de/debian jessie main contrib non-free" >> /etc/apt/sources-list.d/itzks.list echo "deb http://packages.it-zukunft-schule.de/debian jessie-backports main contrib non-free" >> /etc/apt/sources-list.d/itzks.listapt-get update + +# Get update and add itzks-keyring and itzks-systems-common package apt-get update apt-get install itzks-keyring && apt-get update && apt-get install itzks-systems-common + +# Get update and install keyring packages apt-get update apt-get install x2go-keyring deb-multimedia-keyring && apt-get update + +# Install the itzks-systems-workstation package itzks-systems.do_preseed apt-get install itzks-systems-workstation + +# Make sure kdm is the selected display manager dpkg-reconfigure kdm + +# Install libdvdcss2 if needed while true; do read -p "Verfügt der Rechner über ein DVD-Laufwerk bzw. sollen DVDs abgespielt werden können? [j/n] " yn case $yn in @@ -23,9 +41,13 @@ while true; do * ) echo "Bitte antworte mit Ja oder Nein.";; esac done -apt-get install libnss-mdns + +# FIXME: Probably not needed - should be fixed in debian-edu config +#apt-get install libnss-mdns #################### + +# FIXME: this should be scripted; manage with puppet instead read -p '''! Änderung in Network-Interfaces Ändere die bestehenden Einträge für eth0 auf allow-hotplug eth0 @@ -34,28 +56,40 @@ read -p '''! Änderung in Network-Interfaces Starte nun den Editor mit [Enter] ''' editor /etc/network/interfaces + #################### + +# FIXME: this should be scripted; manage with puppet instead read -p '''! Änderung in NFS-Common Ändere die Datei /etc/default/nfs-common am Ende: NEED_GSSD= (leer lassen) Starte nun den Editor mit [Enter] ''' editor /etc/default/nfs-common + ################### -read -p '''! Aktivieren von jessie, jessie-updates, jessie-security -Parameter wie folgt setzen: - Unattended-Upgrade::MinimalSteps "true"; - Unattended-Upgrade::InstallOnShutdown "false"; - Unattended-Upgrade::Automatic-Reboot "false"; -Starte nun den Editor mit [Enter] -''' -editor /etc/apt/apt.conf.d/50unattended-upgrades + +# FIXME: remove soon; managed by puppet +#read -p '''! Aktivieren von jessie, jessie-updates, jessie-security +#Parameter wie folgt setzen: +# Unattended-Upgrade::MinimalSteps "true"; +# Unattended-Upgrade::InstallOnShutdown "false"; +# Unattended-Upgrade::Automatic-Reboot "false"; +#Starte nun den Editor mit [Enter] +#''' +#editor /etc/apt/apt.conf.d/50unattended-upgrades + ################## -echo '! Java installieren...' -apt-get install oracle-java8-bin oracle-java8-jre oracle-java8-plugin -update-java-alternatives --jre --set java-8-oracle -update-java-alternatives --plugin --set java-8-oracle + +# FIXME: remove soon; is managed by normal install of itzks-systems-workstation package +#echo '! Java installieren...' +#apt-get install oracle-java8-bin oracle-java8-jre oracle-java8-plugin +#update-java-alternatives --jre --set java-8-oracle +#update-java-alternatives --plugin --set java-8-oracle + ################### + +# FIXME: why not call apt-get remove --purge gnome-packagekit directly? read -p '''! Update-Benachrichtigungen deaktivieren Es wird nun geprüft, ob die Update-Benachrichtigungen aktiv sind. [ENTER] ''' @@ -68,78 +102,99 @@ while true; do * ) echo "Bitte antworte mit Ja oder Nein.";; esac done + ################### -echo '! Umstellung auf systemd-networkd' -WIFIDEV=wlan0 -export DEBIAN_FRONTEND=noninteractive -apt-get remove -q -y --purge resolvconf -systemctl disable NetworkManager -systemctl enable systemd-networkd.service -systemctl enable systemd-resolved.service -systemctl start systemd-resolved.service -rm /etc/resolv.conf -ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf -cat > /etc/systemd/network/20-dhcp.network << EOF -[Match] -Name=eth* - -[Network] -DHCP=yes -EOF - -cat > /etc/systemd/network/21-dhcp-wireless.network << EOF -[Match] -Name=$WIFIDEV - -[Network] -DHCP=yes -EOF - -cat > /etc/systemd/system/wpa_supplicant@.service << EOF -[Unit] -Description=WPA supplicant daemon (interface-specific version) -Requires=sys-subsystem-net-devices-%i.device -After=sys-subsystem-net-devices-%i.device -Before=network.target -Wants=network.target - -# NetworkManager users will probably want the dbus version instead. - -[Service] -Type=simple -ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I - -[Install] -Alias=multi-user.target.wants/wpa_supplicant@%i.service -EOF - -touch /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf -chmod go-rwx /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf - -systemctl enable wpa_supplicant@$WIFIDEV.service -systemctl disable networking -systemctl disable wpa_supplicant.service + +# switch to systemd-networkd with managed wlan0 interface +itzks-switch-to-systemd-networkd + +# FIXME: remove, as handled by itzks-switch-to-systemd-networkd +#echo '! Umstellung auf systemd-networkd' +#WIFIDEV=wlan0 +#export DEBIAN_FRONTEND=noninteractive +#apt-get remove -q -y --purge resolvconf +#systemctl disable NetworkManager +#systemctl enable systemd-networkd.service +#systemctl enable systemd-resolved.service +#systemctl start systemd-resolved.service +#rm /etc/resolv.conf +#ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf +#cat > /etc/systemd/network/20-dhcp.network << EOF +#[Match] +#Name=eth* +# +#[Network] +#DHCP=yes +#EOF +# +#cat > /etc/systemd/network/21-dhcp-wireless.network << EOF +#[Match] +#Name=$WIFIDEV +# +#[Network] +#DHCP=yes +#EOF +# +#cat > /etc/systemd/system/wpa_supplicant@.service << EOF +#[Unit] +#Description=WPA supplicant daemon (interface-specific version) +#Requires=sys-subsystem-net-devices-%i.device +#After=sys-subsystem-net-devices-%i.device +#Before=network.target +#Wants=network.target +# +## NetworkManager users will probably want the dbus version instead. +# +#[Service] +#Type=simple +#ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I +# +#[Install] +#Alias=multi-user.target.wants/wpa_supplicant@%i.service +#EOF +# +#touch /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf +#chmod go-rwx /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf +# +#systemctl enable wpa_supplicant@$WIFIDEV.service +#systemctl disable networking +#systemctl disable wpa_supplicant.service + +### REMOVE until here + #################### + +# Add system-wide WiFi-config echo '! WIFI-Netzwerk hinzufügen' read -p 'Wie lautet die SSID? ' ssid read -p 'Wie lautet das zugehörige Passwort? ' passw export WIFIDEV=wlan0 wpa_passphrase $ssid $passw >> /etc/wpa_supplicant/wpa_supplicant-$WIFIDEV.conf + #################### + +# Install puppet-agent echo '! Puppet-Agent installieren' read -p '''Bevor der Puppet-Agent installiert werden kann, muss der Hostname geändert werden. Es darf kein "lan" im Namen auftauchen, z.B. statt mw101-lan.intern muss es mw101.intern heißen. [ENTER] ''' + +# FIXME: Remove the following three lines #editor /etc/hostname #read -p '''Der Rechner wird jetzt neu gestartet. #Danach bitte install-itzks2.sh ausführen. [ENTER] ''' -# -# Folgendes ist eleganter + +# Set hostname read -p 'Wie lautet der Hostname (ohne Domain)? ' myhost hostnamectl set-hostname $myhost -# Hier muss ein Neustart vermieden werden. Welche Dienste sind neu zu starten? -# invode + +# To be sure restart the following services +invoke-rc.d rsyslog restart +invoke-rc.d cron restart +invoke-rc.d puppet restart + +# Install and enable puppet-agent on client echo '! Puppet-Agent wird installiert... ' apt-get install puppet puppet agent --test |