Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3917358
D1980.id4999.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D1980.id4999.diff
View Options
diff --git a/roles/core/users/init.sls b/roles/core/users/init.sls
--- a/roles/core/users/init.sls
+++ b/roles/core/users/init.sls
@@ -20,6 +20,7 @@
# -------------------------------------------------------------
{% from "map.jinja" import shells with context %}
+{% set zfs_tank = salt['node.get']("zfs:pool") %}
# -------------------------------------------------------------
# Disabled accounts
@@ -30,6 +31,43 @@
user.absent
{% endfor %}
+# -------------------------------------------------------------
+# ZFS datasets
+#
+# Where ZFS is available, home directories are created as separate
+# datasets. That has several benefits, like allowing users to create
+# snapshots, create and
+# -------------------------------------------------------------
+
+{% if zfs_tank %}
+zfs_home_permissions_sets:
+ cmd.run:
+ - name: |
+ zfs allow -s @local allow,clone,create,diff,hold,mount,promote,receive,release,rollback,snapshot,send arcology/usr/home
+ zfs allow -s @descendent allow,clone,create,diff,destroy,hold,mount,promote,receive,release,rename,rollback,snapshot,send arcology/usr/home
+ touch /usr/home/.zfs-permissions-set
+ - creates: /usr/home/.zfs-permissions-set
+
+{% for username, user in salt['forest.get_users']().items() %}
+
+{{ zfs_tank }}/usr/home/{{ username }}:
+ zfs.filesystem_present
+
+zfs_permissions_home_local_{{ username }}:
+ cmd.run:
+ - name: zfs allow -lu {{ username }} @local {{ zfs_tank }}/usr/home/{{ username }}
+ - require:
+ - zfs: {{ zfs_tank }}/usr/home/{{ username }}
+
+zfs_permissions_home_descendant_{{ username }}:
+ cmd.run:
+ - name: zfs allow -du {{ username }} @descendent {{ zfs_tank }}/usr/home/{{ username }}
+ - require:
+ - zfs: {{ zfs_tank }}/usr/home/{{ username }}
+
+{% endfor %}
+{% endif %}
+
# -------------------------------------------------------------
# Active accounts
# -------------------------------------------------------------
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 03:50 (17 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2308854
Default Alt Text
D1980.id4999.diff (1 KB)
Attached To
Mode
D1980: Create home directories as ZFS filesystems
Attached
Detach File
Event Timeline
Log In to Comment