Page MenuHomeDevCentral

D3088.diff
No OneTemporary

D3088.diff

diff --git a/pillar/devserver/datacubes.sls b/pillar/devserver/datacubes.sls
--- a/pillar/devserver/datacubes.sls
+++ b/pillar/devserver/datacubes.sls
@@ -14,3 +14,8 @@
bak: &default {}
git: *default
t: *default
+
+ xcombelle:
+ user: xcombelle
+ zfs_user: xcombelle
+ zfs_auto_snapshot: True
diff --git a/roles/devserver/datacube/init.sls b/roles/devserver/datacube/init.sls
--- a/roles/devserver/datacube/init.sls
+++ b/roles/devserver/datacube/init.sls
@@ -28,11 +28,38 @@
compression: zstd
{% for subdir, args in pillar.get("datacubes", {}).items() %}
-{{ tank }}/datacube/{{ subdir }}:
+
+{% set datacube_dataset = tank + "/datacube/" + subdir %}
+
+{% if "user" in args %}
+/datacube/{{ subdir }}:
+ file.directory:
+ - mode: 711
+ - user: {{ args["user"] }}
+{% endif %}
+
+{{ datacube_dataset }}:
zfs.filesystem_present:
- properties:
mountpoint: /datacube/{{ subdir }}
compression: zstd
-{% endfor %}
+ {% if "zfs_auto_snapshot" in args %}
+ "com.sun:auto-snapshot": "true"
+ {% endif %}
+
+{% if "zfs_user" in args %}
+zfs_permissions_datacube_{{ subdir }}:
+ cmd.run:
+ - name: zfs allow -lu {{ args["zfs_user"] }} @local {{ datacube_dataset }}
+ - onchanges:
+ - zfs: {{ datacube_dataset }}
+zfs_permissions_datacube_descendent_{{ subdir }}:
+ cmd.run:
+ - name: zfs allow -du {{ args["zfs_user"] }} @descendent {{ datacube_dataset }}
+ - onchanges:
+ - zfs: {{ datacube_dataset }}
+{% endif %}
+
+{% endfor %}
{% endif %}

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 5, 09:06 (8 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2541793
Default Alt Text
D3088.diff (1 KB)

Event Timeline