2025-06-26-13-33-49: Cronjob
This commit is contained in:
commit
29049c8da1
127 changed files with 7089 additions and 0 deletions
3
roles/lmn_localhome/defaults/main.yml
Normal file
3
roles/lmn_localhome/defaults/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
localhome: false
|
||||
localhome_logout_missing_serverhome: true
|
||||
29
roles/lmn_localhome/files/lmn-create-unisonconfig.sh
Normal file
29
roles/lmn_localhome/files/lmn-create-unisonconfig.sh
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/bash
|
||||
#
|
||||
# create ~/.unison/SyncHome.prf if not exists
|
||||
#
|
||||
set -eu
|
||||
|
||||
[[ -f ~/.unison/SyncHome.prf ]] && exit 0
|
||||
|
||||
mkdir -p ~/.unison
|
||||
|
||||
if id | grep teachers; then
|
||||
NETHOME="$(find /srv/samba/schools/default-school/teachers/ -maxdepth 1 -type d -name "${USER}")"
|
||||
else
|
||||
NETHOME="$(find /srv/samba/schools/default-school/students/ -maxdepth 2 -type d -name "${USER}")"
|
||||
fi
|
||||
|
||||
if [[ ! -f ~/.unison/SyncHome.prf ]]; then
|
||||
echo "# Unison preferences
|
||||
label = Sync Home on Server
|
||||
path = Bilder
|
||||
path = Dokumente
|
||||
path = Musik
|
||||
path = Videos
|
||||
root = $HOME
|
||||
root = $NETHOME
|
||||
dontchmod = true
|
||||
perms = 0" > ~/.unison/SyncHome.prf
|
||||
fi
|
||||
|
||||
39
roles/lmn_localhome/tasks/main.yml
Normal file
39
roles/lmn_localhome/tasks/main.yml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
- name: Enable pam_mkhomedir.so
|
||||
ansible.builtin.lineinfile:
|
||||
dest: /etc/pam.d/common-session
|
||||
line: "session optional pam_mkhomedir.so umask=0077"
|
||||
insertbefore: '^session\s*optional\s*pam_mount.so'
|
||||
|
||||
- name: Patch sddm login screen to inform about localhome
|
||||
ansible.builtin.blockinfile:
|
||||
path: /usr/share/sddm/themes/debian-breeze/Main.qml
|
||||
marker: // {mark} ANSIBLE MANAGED BLOCK localhome
|
||||
insertbefore: '^}$'
|
||||
block: |
|
||||
Text {
|
||||
id: localhome
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.topMargin: 10
|
||||
anchors.leftMargin: 15
|
||||
color: "#ffffff"
|
||||
text: "Lokale Anmeldung!\nHome-Verzeichnis liegt nicht im Netz!"
|
||||
font.pointSize: config.fontSize
|
||||
}
|
||||
|
||||
- name: Copy unison-createconfig scripts
|
||||
ansible.builtin.copy:
|
||||
src: lmn-create-unisonconfig.sh
|
||||
dest: /usr/local/bin/
|
||||
mode: '0755'
|
||||
|
||||
- name: Install auto-logout-script for first login in /etc/profile.d/
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/profile.d/lmn-logout.sh
|
||||
mode: '0755'
|
||||
content: |
|
||||
[[ "${UID}" -gt 10000 ]] && ! findmnt "/lmn/media/${USER}/home" > /dev/null && exit 0
|
||||
{% if localhome_logout_missing_serverhome %}
|
||||
[[ "${UID}" -gt 10000 ]] && ! findmnt /srv/samba/schools/default-school > /dev/null && exit 0
|
||||
{% endif %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue