-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaybook.yml
More file actions
363 lines (313 loc) · 9.95 KB
/
playbook.yml
File metadata and controls
363 lines (313 loc) · 9.95 KB
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
---
- name: Schulsystem Installation & Konfiguration
hosts: computers
become: yes
vars:
admin_user: "linuxadmin"
kiosk_user: "user0"
template_dir: "/home/{{ admin_user }}/TEMPLATE"
# Hashes werden vom install.sh übergeben.
# --- BASIS PAKET LISTE ---
packages_system:
- xubuntu-desktop
- lightdm
- vim
- git
- rsync
- htop
- tree
- gparted
- usb-creator-gtk
- net-tools
- unrar
- python3-pip
- nodejs
- npm
- apt-transport-https
# ISO Tools
- xorriso
- isolinux
- syslinux-utils
- squashfs-tools
# Java
- default-jdk
- default-jre
- openjdk-8-jre
- openjdk-8-jdk
# Multimedia & Grafik
- vlc
- gimp
- feh
- simplescreenrecorder
- qrencode
# Netzwerk & Fernwartung
- openssh-server
- veyon-service
- tigervnc-viewer
# Flatpak
- flatpak
- gnome-software-plugin-flatpak
# Office
- libreoffice
- libreoffice-l10n-de
- libreoffice-help-de
# Wine
- wine
- winetricks
# Spiele
- ballerburg
packages_edu:
- geogebra
- scratch
- xournal
- stellarium
- umbrello
- bobdude
tasks:
# =========================================================================
# 1. VORBEREITUNG (KRITISCHE SYSTEM-TOOLS)
# =========================================================================
- name: System-Tools für Repositories installieren
apt:
name:
- software-properties-common
- gnupg
- gnupg2
- dirmngr
- ca-certificates
- curl
state: present
update_cache: yes
- name: Universe und Multiverse Repositories aktivieren
apt_repository:
repo: "{{ item }}"
state: present
loop:
- "deb http://archive.ubuntu.com/ubuntu {{ ansible_distribution_release }} universe"
- "deb http://archive.ubuntu.com/ubuntu {{ ansible_distribution_release }} multiverse"
# =========================================================================
# 2. SOFTWARE INSTALLATION (APT)
# =========================================================================
- name: Basis-Software installieren
apt:
name: "{{ packages_system }}"
state: present
- name: Edu-Software installieren
apt:
name: "{{ packages_edu }}"
state: present
ignore_errors: yes
# =========================================================================
# 3. EXTERNE DEB PAKETE
# =========================================================================
# Chrome
- name: Google Chrome herunterladen
get_url:
url: https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dest: /tmp/google-chrome.deb
- name: Google Chrome installieren
apt:
deb: /tmp/google-chrome.deb
ignore_errors: yes
# Greenfoot
- name: Greenfoot herunterladen
get_url:
url: https://www.greenfoot.org/download/files/Greenfoot-linux-x64-390.deb
dest: /tmp/greenfoot.deb
ignore_errors: yes
- name: Greenfoot installieren
apt:
deb: /tmp/greenfoot.deb
ignore_errors: yes
# Filius
- name: Filius herunterladen
get_url:
url: https://www.lernsoftware-filius.de/downloads/Setup/filius_2.9.4_all.deb
dest: /tmp/filius.deb
ignore_errors: yes
- name: Filius installieren
apt:
deb: /tmp/filius.deb
ignore_errors: yes
# --- VIRTUALBOX ---
- name: VirtualBox Lizenz akzeptieren
debconf:
name: virtualbox-ext-pack
question: virtualbox-ext-pack/license
vtype: select
value: 'true'
- name: VirtualBox installieren
apt:
name: [virtualbox, virtualbox-ext-pack, virtualbox-qt, virtualbox-dkms]
state: present
ignore_errors: yes
# =========================================================================
# 4. SNAP & FLATPAK
# =========================================================================
- name: Snap Pakete installieren
community.general.snap:
name: "{{ item.name }}"
classic: "{{ item.classic | default(false) }}"
loop:
- { name: netbeans, classic: yes }
- { name: intellij-idea-community, classic: yes }
- { name: eclipse, classic: yes }
- { name: blender, classic: yes }
- { name: cura-slicer }
- { name: bluej }
- { name: arduino }
ignore_errors: yes
- name: Flathub aktivieren
community.general.flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo
ignore_errors: yes
# =========================================================================
# 5. ISO CREATOR (FRESH EGGS)
# =========================================================================
- name: fresh-eggs Repository klonen
ansible.builtin.git:
repo: "https://github.com/pieroproietti/fresh-eggs.git"
dest: "/opt/fresh-eggs"
clone: yes
update: yes
- name: fresh-eggs Installationsskript ausführen (Enter simulieren)
ansible.builtin.shell: "yes '' | ./fresh-eggs.sh"
args:
chdir: "/opt/fresh-eggs"
become: yes
register: result
changed_when: result.rc == 0
ignore_errors: yes
# =========================================================================
# 6. USER & GRUPPEN SETUP
# =========================================================================
- name: Admin User anlegen
user:
name: "{{ admin_user }}"
password: "{{ admin_password_hash }}"
update_password: on_create
shell: /bin/bash
groups: sudo,plugdev,users
append: yes
- name: Kiosk User anlegen
user:
name: "{{ kiosk_user }}"
password: "{{ kiosk_password_hash }}"
shell: /bin/bash
groups: audio,video,plugdev,users
append: yes
# =========================================================================
# 7. AUTO-LOGIN (LightDM)
# =========================================================================
- name: LightDM Konfigurationsordner prüfen
file:
path: /etc/lightdm/lightdm.conf.d
state: directory
mode: '0755'
- name: Autologin für Kiosk User setzen
copy:
dest: /etc/lightdm/lightdm.conf.d/12-autologin.conf
content: |
[Seat:*]
autologin-user={{ kiosk_user }}
autologin-user-timeout=0
owner: root
group: root
mode: '0644'
# =========================================================================
# 8. KONFIGURATION & DATEIEN
# =========================================================================
- name: Veyon Gruppe anlegen
group:
name: veyon-student
state: present
- name: User zu Veyon Gruppe hinzufügen
user:
name: "{{ kiosk_user }}"
groups: veyon-student
append: yes
- name: Veyon Config importieren
command: veyon-cli config import files/veyon-config.json
args:
removes: files/veyon-config.json
ignore_errors: yes
- name: Winetricks Update (falls möglich)
command: winetricks --self-update
failed_when: false
ignore_errors: yes
- name: Software Verzeichnis kopieren
copy:
src: software/
dest: /tmp/software/
mode: '0777'
- name: Wallpaper setzen
copy:
src: files/logo.png
dest: /usr/share/backgrounds/logo.png
mode: '0755'
ignore_errors: yes
- name: ISO Download Ordner erstellen
file:
path: /isos
state: directory
mode: '0755'
- name: Xubuntu ISO herunterladen
get_url:
url: http://ftp.uni-kl.de/pub/linux/ubuntu-dvd/xubuntu/releases/24.04.3/release/xubuntu-24.04.3-desktop-amd64.iso
dest: /isos/xubuntu-24.04.3-desktop-amd64.iso
mode: '0644'
ignore_errors: yes
# =========================================================================
# 9. KIOSK MECHANIK
# =========================================================================
- name: Template Verzeichnis anlegen
file:
path: "{{ template_dir }}"
state: directory
owner: "{{ admin_user }}"
group: "{{ admin_user }}"
mode: '0755'
- name: Reset-Skripte installieren
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: '0755'
loop:
- { src: 'reset-kiosk.sh', dest: '/usr/local/bin/reset-kiosk.sh' }
- { src: 'create-iso.sh', dest: '/usr/local/bin/create-iso.sh' }
- name: Systemd Reset Service installieren
copy:
src: files/kiosk-reset.service
dest: /etc/systemd/system/kiosk-reset.service
mode: '0644'
notify: restart_kiosk_service
- name: Template initial befüllen (nur wenn leer)
shell: |
if [ -z "$(ls -A {{ template_dir }})" ]; then
rsync -a /etc/skel/ {{ template_dir }}/
chown -R {{ kiosk_user }}:{{ kiosk_user }} {{ template_dir }}
fi
register: template_init
changed_when: template_init.stdout != ""
# =========================================================================
# 10. DIENSTE STARTEN
# =========================================================================
- name: Dienste aktivieren
systemd:
name: "{{ item }}"
enabled: yes
state: started
daemon_reload: yes
loop:
- kiosk-reset.service
- ssh
- veyon.service
ignore_errors: yes
handlers:
- name: restart_kiosk_service
systemd:
name: kiosk-reset.service
state: restarted
daemon_reload: yes