diff options
author | Cullum Smith <cullum@sacredheartsc.com> | 2024-10-31 21:36:39 -0400 |
---|---|---|
committer | Cullum Smith <cullum@sacredheartsc.com> | 2024-10-31 21:36:39 -0400 |
commit | 2c9845db4bc00221bc3c2343a020208f7f532166 (patch) | |
tree | 843bc24a1bbf2cad33c4bdc8a17c3d0d838fceb4 /scripts/hostname/nfs1 | |
parent | 7eb111136453d0e8d8451d7dd85ba9892318f294 (diff) | |
download | infrastructure-2c9845db4bc00221bc3c2343a020208f7f532166.tar.gz |
many fixes
Diffstat (limited to 'scripts/hostname/nfs1')
-rw-r--r-- | scripts/hostname/nfs1/10-homedirs | 6 | ||||
-rw-r--r-- | scripts/hostname/nfs1/20-shares | 34 | ||||
-rw-r--r-- | scripts/hostname/nfs1/30-autofs | 10 |
3 files changed, 31 insertions, 19 deletions
diff --git a/scripts/hostname/nfs1/10-homedirs b/scripts/hostname/nfs1/10-homedirs index 3a6d923..db0c1e0 100644 --- a/scripts/hostname/nfs1/10-homedirs +++ b/scripts/hostname/nfs1/10-homedirs @@ -1,8 +1,12 @@ #!/bin/sh -default_priv_quota=250G +default_priv_quota=50G default_pub_quota=10G +# Format: username:privquota:pubquota. For example: +# nfs_homedirs='joe:250G:10G jane:250G' +# nfs_groupdirs='sysadmins:250G doefamily:100G:10G' + # Create user home directories. for userquota in ${nfs_homedirs:-}; do user=$(echo "$userquota" | awk -F: '{print $1}') diff --git a/scripts/hostname/nfs1/20-shares b/scripts/hostname/nfs1/20-shares index beb3b11..0dd6ddb 100644 --- a/scripts/hostname/nfs1/20-shares +++ b/scripts/hostname/nfs1/20-shares @@ -1,16 +1,22 @@ #!/bin/sh -# media/music -create_dataset -p "${nfs_dataset}/media/music" -zfs set \ - compression=off \ - com.sun:auto-snapshot:daily=true \ - com.sun:auto-snapshot:weekly=true \ - "${nfs_dataset}/media/music" -chgrp media-admin "${nfs_root}/media/music" -chmod 2770 "${nfs_root}/media/music" -set_facl "${nfs_root}/media/music" \ - group:media-admin:rwpDdaARWcs:fd:allow \ - group:media-admin:x:d:allow \ - group:media-access:raRcs:fd:allow \ - group:media-access:x:d:allow +media_access_group='media-access' +media_admin_group='media-admin' +media_shares='music shows movies audiobooks roms books scores isos' + +# media shares +for share in $media_shares; do + create_dataset -p "${nfs_dataset}/media/${share}" + zfs set \ + compression=off \ + com.sun:auto-snapshot:daily=true \ + com.sun:auto-snapshot:weekly=true \ + "${nfs_dataset}/media/${share}" + chgrp "$media_admin_group" "${nfs_root}/media/${share}" + chmod 2770 "${nfs_root}/media/${share}" + set_facl "${nfs_root}/media/${share}" \ + "group:${media_admin_group}:rwpDdaARWcs:fd:allow" \ + "group:${media_admin_group}:x:d:allow" \ + "group:${media_access_group}:raRcs:fd:allow" \ + "group:${media_access_group}:x:d:allow" +done diff --git a/scripts/hostname/nfs1/30-autofs b/scripts/hostname/nfs1/30-autofs index fe3a468..a7153d4 100644 --- a/scripts/hostname/nfs1/30-autofs +++ b/scripts/hostname/nfs1/30-autofs @@ -72,9 +72,11 @@ automountKey: /nfs/media automountInformation: auto_media ${nfs_mount_opts} EOF -# auto_media: music -ldap_add "automountKey=music,automountMapName=auto_media,${automount_basedn}" <<EOF +# auto_media: music, movies, etc +for share in $media_shares; do + ldap_add "automountKey=${share},automountMapName=auto_media,${automount_basedn}" <<EOF objectClass: automount -automountKey: music -automountInformation: ${fqdn}:/media/music +automountKey: ${share} +automountInformation: ${fqdn}:/media/${share} EOF +done |