Page MenuHomeDevCentral

D3312.diff
No OneTemporary

D3312.diff

diff --git a/pillar/devserver/datacubes.sls b/pillar/devserver/datacubes.sls
--- a/pillar/devserver/datacubes.sls
+++ b/pillar/devserver/datacubes.sls
@@ -32,6 +32,11 @@
zfs_user: xcombelle
zfs_auto_snapshot: True
+ nextcloud:
+ user_from_pillar: "nextcloud:user"
+ zfs_user_from_pillar: "nextcloud:user"
+ zfs_auto_snapshot: True
+
# -------------------------------------------------------------
# Other directories needed by development work
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
@@ -36,6 +36,11 @@
file.directory:
- mode: 711
- user: {{ args["user"] }}
+{% elif "user_from_pillar" in args %}
+/datacube/{{ subdir }}:
+ file.directory:
+ - mode: 711
+ - user: {{ salt["pillar.get"](args["user_from_pillar"]) }}
{% endif %}
{{ datacube_dataset }}:
@@ -48,15 +53,25 @@
{% endif %}
{% if "zfs_user" in args %}
+ {% set zfs_user = args["zfs_user"] %}
+ {% set with_zfs_user = True %}
+{% elif "zfs_user_from_pillar" in args %}
+ {% set zfs_user = salt["pillar.get"](args["zfs_user_from_pillar"]) %}
+ {% set with_zfs_user = True %}
+{% else %}
+ {% set with_zfs_user = False %}
+{% endif %}
+
+{% if with_zfs_user %}
zfs_permissions_datacube_{{ subdir }}:
cmd.run:
- - name: zfs allow -lu {{ args["zfs_user"] }} @local {{ datacube_dataset }}
+ - name: zfs allow -lu {{ 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 }}
+ - name: zfs allow -du {{ zfs_user }} @descendent {{ datacube_dataset }}
- onchanges:
- zfs: {{ datacube_dataset }}
{% endif %}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 05:28 (2 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2306067
Default Alt Text
D3312.diff (1 KB)

Event Timeline