Mount default-school by pam_mount and create symlinks to home and share
This commit is contained in:
parent
fc410dcb2d
commit
68239b56cb
2 changed files with 18 additions and 0 deletions
4
roles/lmn_mount/files/lmn-linkhome.sh
Normal file
4
roles/lmn_mount/files/lmn-linkhome.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
if [[ "${UID}" -gt 60000 ]]; then
|
||||
[[ -L "/media/${USER}/share" ]] || ln -s .default-school/share "/media/${USER}/share"
|
||||
[[ -L "/media/${USER}/home" ]] || ln -s ".default-school/${HOME##/srv/samba/schools/default-school/}" "/media/${USER}/home"
|
||||
fi
|
|
@ -22,6 +22,14 @@
|
|||
options="sec=krb5i,cruid=%(USERUID),user=%(USER),file_mode=0700,dir_mode=0700,mfsymlinks,nobrl"
|
||||
><not><or><user>root</user><user>ansible</user><user>Debian-gdm</user><user>sddm</user><user>virti</user></or></not>
|
||||
</volume>
|
||||
<volume
|
||||
fstype="cifs"
|
||||
server="{{ smb_server }}"
|
||||
path="{{ smb_share }}"
|
||||
mountpoint="/media/%(USER)/.default-school"
|
||||
options="sec=krb5i,cruid=%(USERUID),user=%(USER),gid=1010,file_mode=0770,dir_mode=0770,mfsymlinks,nobrl"
|
||||
><not><or><user>root</user><user>ansible</user><user>Debian-gdm</user><user>sddm</user><user>virti</user></or></not>
|
||||
</volume>
|
||||
<volume
|
||||
fstype="davfs"
|
||||
path="https://nc.steinbeis.schule/remote.php/dav/files/%(USER)"
|
||||
|
@ -70,6 +78,12 @@
|
|||
line: KillUserProcesses=yes
|
||||
insertafter: '#KillUserProcesses=no'
|
||||
|
||||
- name: Deploy script to generate links in /media/$USER/
|
||||
copy:
|
||||
src: lmn-linkhome.sh
|
||||
dest: /etc/profile.d/
|
||||
mode: '0644'
|
||||
|
||||
- name: Mount NFSv4 home directory
|
||||
ansible.posix.mount:
|
||||
src: server:/default-school
|
||||
|
|
Loading…
Add table
Reference in a new issue