Implement VM configuration and deploy the images.
This commit is contained in:
parent
396a91fb40
commit
18928f2818
14 changed files with 315 additions and 9 deletions
15
roles/lmn_vm/files/mounthome.sh
Executable file
15
roles/lmn_vm/files/mounthome.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/bash
|
||||
set -eu
|
||||
|
||||
share="$(getent passwd "$SUDO_UID" | cut -d : -f 6 | sed 's/.*default-school//')"
|
||||
|
||||
if [ "$#" -gt 0 ] && [ "$1" = '-u' ]; then
|
||||
umount "/media/${SUDO_USER}/home" && rmdir "/media/${SUDO_USER}/home"
|
||||
else
|
||||
chgrp 1010 "/media/${SUDO_USER}"
|
||||
chmod 0770 "/media/${SUDO_USER}"
|
||||
mkdir -p "/media/${SUDO_USER}/home"
|
||||
mount -t cifs -o "sec=krb5i,cruid=${SUDO_UID},username=${SUDO_USER},uid=${SUDO_UID},\
|
||||
gid=1010,file_mode=0770,dir_mode=0770,forceuid,forcegid,user=${SUDO_USER}" \
|
||||
"//server/default-school/${share}" "/media/${SUDO_USER}/home"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue