summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/templates/00-gfs-volumes.yml.j2
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-03-01 21:15:50 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-03-01 21:15:50 +0100
commit69adb23c59e991ddcabf5cfce415fd8b638dbc1a (patch)
tree8693e708f751923f6f7f9dd48004303bebb4e126 /roles/ands_kaas/templates/00-gfs-volumes.yml.j2
parent1f3e2a9f59e83dc3f0fcbecf096a7e7b40d36ed7 (diff)
downloadands-69adb23c59e991ddcabf5cfce415fd8b638dbc1a.tar.gz
ands-69adb23c59e991ddcabf5cfce415fd8b638dbc1a.tar.bz2
ands-69adb23c59e991ddcabf5cfce415fd8b638dbc1a.tar.xz
ands-69adb23c59e991ddcabf5cfce415fd8b638dbc1a.zip
Improve handling of filesystem permissions and other fixes
Diffstat (limited to 'roles/ands_kaas/templates/00-gfs-volumes.yml.j2')
-rw-r--r--roles/ands_kaas/templates/00-gfs-volumes.yml.j213
1 files changed, 9 insertions, 4 deletions
diff --git a/roles/ands_kaas/templates/00-gfs-volumes.yml.j2 b/roles/ands_kaas/templates/00-gfs-volumes.yml.j2
index c9341ed..a69942d 100644
--- a/roles/ands_kaas/templates/00-gfs-volumes.yml.j2
+++ b/roles/ands_kaas/templates/00-gfs-volumes.yml.j2
@@ -2,18 +2,23 @@
apiVersion: v1
kind: Template
metadata:
- name:
+ name: {{ kaas_project }}-gfs-volumes
annotations:
- descriptions: "KATRIN Volumes"
+ descriptions: "{{ kaas_project }} glusterfs volumes"
objects:
{% for name, vol in kaas_project_volumes.iteritems() %}
{% set oc_name = vol.name | default(name) | regex_replace('_','-') %}
{% set cfgpath = vol.path | default("") %}
{% set path = cfgpath if cfgpath[:1] == "/" else "/" + kaas_project + "/" + cfgpath %}
+{% if oc_name | regex_search("^" + kaas_project) %}
+{% set pvname = oc_name %}
+{% else %}
+{% set pvname = (kaas_project + "-" + oc_name) | regex_replace('_','-') %}
+{% endif %}
- apiVersion: v1
kind: PersistentVolume
metadata:
- name: {{ oc_name }}
+ name: {{ pvname }}
spec:
persistentVolumeReclaimPolicy: Retain
glusterfs:
@@ -32,7 +37,7 @@ objects:
metadata:
name: {{ oc_name }}
spec:
- volumeName: {{ oc_name }}
+ volumeName: {{ pvname }}
accessModes:
- {{ vol.access | default('ReadWriteMany') }}
resources: