Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3768290
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/pillar/devserver/datacubes.sls b/pillar/devserver/datacubes.sls
index 20ef84f..7439b3a 100644
--- a/pillar/devserver/datacubes.sls
+++ b/pillar/devserver/datacubes.sls
@@ -1,75 +1,84 @@
# -------------------------------------------------------------
# Salt configuration for Nasqueron servers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# Datacubes
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x_datacube_permissions:
default: &default {}
dereckson: &dck
user: dereckson
zfs_user: dereckson
zfs_auto_snapshot: True
datacube_zfs_pool: greenway
datacubes:
ascii-sandbox: *dck
bak: *default
git: *default
t: *default
dereckson_bak: *dck
docs: *default
docs/dereckson: *dck
docs/xcombelle:
user: xcombelle
zfs_user: xcombelle
zfs_auto_snapshot: True
documentation: *default
nextcloud:
user_from_pillar: "nextcloud:user"
zfs_user_from_pillar: "nextcloud:user"
zfs_auto_snapshot: True
+# -------------------------------------------------------------
+# Symbolic links needed by development work
+# <path to the link to create>: <target file>
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+devserver_symlinks:
+ # Renamed 2024-09-39, keep old filename for transition
+ /datacube/doc: /datacube/documentation
+
# -------------------------------------------------------------
# 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 47021f6..d9504ae 100644
--- a/roles/devserver/datacube/init.sls
+++ b/roles/devserver/datacube/init.sls
@@ -1,102 +1,112 @@
# -------------------------------------------------------------
# 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') %}
{% if "datacube_zfs_pool" in pillar %}
{% set tank = pillar["datacube_zfs_pool"] %}
{% else %}
{% set tank = salt["node.get"]("zfs:pool") %}
{% endif %}
{{ tank }}/datacube:
zfs.filesystem_present:
- properties:
mountpoint: /datacube
compression: zstd
{% for subdir, args in pillar.get("datacubes", {}).items() %}
{% set datacube_dataset = tank + "/datacube/" + subdir %}
{% set mountpoint = args.get("mounting_point", "/datacube/" + subdir) %}
{% if "user" in args %}
{{ mountpoint }}:
file.directory:
- mode: 711
- user: {{ args["user"] }}
{% elif "user_from_pillar" in args %}
{{ mountpoint }}:
file.directory:
- mode: 711
- user: {{ salt["pillar.get"](args["user_from_pillar"]) }}
{% endif %}
{{ datacube_dataset }}:
zfs.filesystem_present:
- properties:
mountpoint: {{ mountpoint }}
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 {{ zfs_user }} @local {{ datacube_dataset }}
- onchanges:
- zfs: {{ datacube_dataset }}
zfs_permissions_datacube_descendent_{{ subdir }}:
cmd.run:
- name: zfs allow -du {{ zfs_user }} @descendent {{ datacube_dataset }}
- onchanges:
- zfs: {{ datacube_dataset }}
{% endif %}
{% endfor %}
{% endif %}
+# -------------------------------------------------------------
+# Symbolic links
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% for link_path, link_points_to in pillar.get("devserver_symlinks", {}).items() %}
+{{ link_path }}:
+ file.symlink:
+ - target: {{ link_points_to }}
+{% endfor %}
+
# -------------------------------------------------------------
# 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
Mon, Nov 25, 07:23 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2257334
Default Alt Text
(5 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment