Rename instead of delete outdated exam-user directories on localhome-clients

Exam mode don't collect home-directories on localhome clients.
Deleting home of exam-users will result in potential data loss. But keeping
the home under the same name will prevent new exam at the next day.

Solution: Rename home (and /lmn/media/) of user after 12h and delete after 10d.
This commit is contained in:
Raphael Dannecker 2025-01-22 09:40:27 +01:00
parent 727922f152
commit 39da308ff7
3 changed files with 27 additions and 4 deletions

View file

@ -34,8 +34,15 @@
content: |
[[ "${UID}" -gt 10000 ]] && ! findmnt "/lmn/media/${USER}/home" > /dev/null && exit 0
- name: Provide rmexam script
ansible.builtin.copy:
src: rmexam
dest: /usr/local/sbin/
mode: 0755
when: "'teacherlaptop' not in group_names"
- name: Provide rmexam services and timers for some scripts
copy:
ansible.builtin.copy:
src: "{{ item }}"
dest: "/etc/systemd/system/{{ item }}"
mode: 0644
@ -45,7 +52,7 @@
when: "'teacherlaptop' not in group_names"
- name: Enable rmexam.timer
systemd:
ansible.builtin.systemd:
name: rmexam.timer
enabled: true
when: "'teacherlaptop' not in group_names"