Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11726360
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/pillar/devserver/datacubes.sls b/pillar/devserver/datacubes.sls
index c0755e1..dcb4d5d 100644
--- a/pillar/devserver/datacubes.sls
+++ b/pillar/devserver/datacubes.sls
@@ -1,64 +1,69 @@
# -------------------------------------------------------------
# Salt configuration for Nasqueron servers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# Datacubes
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
datacubes:
bak: &default {}
git: *default
t: *default
dereckson_bak: &dck
user: dereckson
zfs_user: dereckson
zfs_auto_snapshot: True
docs: *default
docs/dereckson:
user: dereckson
zfs_user: dereckson
zfs_auto_snapshot: True
docs/xcombelle:
user: xcombelle
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
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
devserver_directories:
/var/dataroot:
user: root
group: ops
mode: 775
/var/dataroot/mediawiki.dereckson.be:
user: web-be-dereckson-mw
group: dereckson
mode: 771
# Staging area for Zed
/var/dataroot/zed:
user: dereckson
mode: 711
/var/dataroot/zed/cache:
user: web-be-dereckson-zed51
group: dereckson
mode: 771
/var/dataroot/zed/content:
user: web-be-dereckson-zed51
group: dereckson
mode: 771
diff --git a/roles/devserver/datacube/init.sls b/roles/devserver/datacube/init.sls
index b2ccb62..93c0d10 100644
--- a/roles/devserver/datacube/init.sls
+++ b/roles/devserver/datacube/init.sls
@@ -1,82 +1,97 @@
# -------------------------------------------------------------
# Salt — Provision dev software
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# Directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/datacube:
file.directory:
- mode: 711
# -------------------------------------------------------------
# ZFS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% if salt['node.has']('zfs:pool') %}
{% set tank = salt['node.get']("zfs:pool") %}
{{ tank }}/datacube:
zfs.filesystem_present:
- properties:
mountpoint: /datacube
compression: zstd
{% for subdir, args in pillar.get("datacubes", {}).items() %}
{% set datacube_dataset = tank + "/datacube/" + subdir %}
{% if "user" in args %}
/datacube/{{ subdir }}:
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 }}:
zfs.filesystem_present:
- properties:
mountpoint: /datacube/{{ subdir }}
compression: zstd
{% if "zfs_auto_snapshot" in args %}
"com.sun:auto-snapshot": "true"
{% 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 %}
{% endfor %}
{% endif %}
# -------------------------------------------------------------
# Misc directories
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% for dir, args in pillar.get("devserver_directories", {}).items() %}
{{ dir }}:
file.directory:
- makedirs: True
{% for key in ["user", "group", "mode"] %}
{% if key in args %}
- {{ key }}: {{ args[key] }}
{% endif %}
{% endfor %}
{% endfor %}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Sep 19, 03:03 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2992114
Default Alt Text
(4 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment