summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/volume.yml
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-02-28 23:46:55 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-02-28 23:46:55 +0100
commit1f3e2a9f59e83dc3f0fcbecf096a7e7b40d36ed7 (patch)
treec75d04456ab3593442734bec3d84c90e4b973f27 /roles/ands_kaas/tasks/volume.yml
parentfe4622305efa55e6bec8221efe8fc4bdd5462136 (diff)
downloadands-1f3e2a9f59e83dc3f0fcbecf096a7e7b40d36ed7.tar.gz
ands-1f3e2a9f59e83dc3f0fcbecf096a7e7b40d36ed7.tar.bz2
ands-1f3e2a9f59e83dc3f0fcbecf096a7e7b40d36ed7.tar.xz
ands-1f3e2a9f59e83dc3f0fcbecf096a7e7b40d36ed7.zip
First running prototype
Diffstat (limited to 'roles/ands_kaas/tasks/volume.yml')
-rw-r--r--roles/ands_kaas/tasks/volume.yml34
1 files changed, 34 insertions, 0 deletions
diff --git a/roles/ands_kaas/tasks/volume.yml b/roles/ands_kaas/tasks/volume.yml
index b82e55f..ff51fb0 100644
--- a/roles/ands_kaas/tasks/volume.yml
+++ b/roles/ands_kaas/tasks/volume.yml
@@ -6,6 +6,40 @@
file:
path: "{{ path }}"
state: "directory"
+ recurse: "no"
+ register: mkdir
+
+- name: "Ensure the {{ path }} is writeable by project pods"
+ vars:
+ default_group: "{{ kaas_openshift_gid_ranges[kaas_project] | default('') | regex_replace('^([0-9]+)[^0-9]*.*$', '\\1') }}"
+ file:
+ path: "{{ path }}"
+ state: "directory"
+ recurse: "no"
+ mode: "{{ volume.mode | default(0775) }}"
+ owner: "{{ volume.owner | default(kaas_project_config.file_owner) | default(kaas_default_file_owner) }}"
+ group: "{{ volume.group | default(kaas_project_config.file_group) | default(default_group) }}"
+ register: chmod
+ when:
+ - mkdir | changed
+ - kaas_openshift_gid_ranges[kaas_project] is defined
+ - osvpath[:1] != "/"
+
+# There is no other way to write for users. There will be just two osv's one writeable and one not.
+# We may create a dir with the wrong one and have permissions not set
+# - volume.write | default(false)
+
+- name: "Setting default permissions for non standard locations"
+ file:
+ path: "{{ path }}"
+ state: "directory"
+ recurse: "no"
mode: "{{ volume.mode | default(0755) }}"
owner: "{{ volume.owner | default(kaas_project_config.file_owner) | default(kaas_default_file_owner) }}"
group: "{{ volume.group | default(kaas_project_config.file_group) | default(kaas_default_file_group) }}"
+ when:
+ - mkdir | changed
+ - chmod | skipped
+
+
+