summaryrefslogtreecommitdiff
path: root/install-itzks-workstation
blob: af13ea560ef35553b26758a57f99d6b4bafbc6f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/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
        [Jj]* ) apt install libdvdcss2; break;;
        [Nn]* ) exit;;
        * ) echo "Bitte antworte mit Ja oder Nein.";;
    esac
done

# 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
   #NetworkManager
   #iface eth0 inet dhcp
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

###################

# 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

##################

# 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] 
'''
dpkg -l gnome-packagekit
while true; do
    read -p "Lies die Textausgabe des letzten Befehls. Ist das Paket aktiviert? [j/n] " yn
    case $yn in
        [Jj]* ) apt-get remove --purge gnome-packagekit; break;;
        [Nn]* ) exit;;
        * ) echo "Bitte antworte mit Ja oder Nein.";;
    esac
done

###################

# 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] '''

# Set hostname
read -p 'Wie lautet der Hostname (ohne Domain)? ' myhost
hostnamectl set-hostname $myhost

# 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
puppet agent --enable
read -p '''Nun mit ssh auf den tjener wechseln und dort
mit   puppet cert --list   die am Master angemeldeten
Clients auflisten.

Anschließend mit   puppet cert --sign <myhost>.intern
den Puppet-Agent des Clients authorisieren. [ENTER] '''
ssh tjener
echo '''!   FERTIG
Die Installation 
  - des Basissystems mit ITZKS-Anpassungen
  - der Umstellung auf systemd-networkd
  - des Puppet-Agents
ist abgeschlossen.'''