summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/tasks/sync.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/sync.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/sync.yml')
-rw-r--r--roles/ands_kaas/tasks/sync.yml22
1 files changed, 20 insertions, 2 deletions
diff --git a/roles/ands_kaas/tasks/sync.yml b/roles/ands_kaas/tasks/sync.yml
index 07764ca..a4febe7 100644
--- a/roles/ands_kaas/tasks/sync.yml
+++ b/roles/ands_kaas/tasks/sync.yml
@@ -4,5 +4,23 @@
register: result
- name: "Sync '{{ item_name }}'"
- local_action: synchronize src="{{ item_src }}" dest="{{ remote_path }}/" archive=yes
- when: (result.stat.exists == False) or (kaas_resync | default(false))
+ local_action: synchronize src="{{ item_src }}" dest="{{ remote_path }}/" archive=yes delete=yes
+ register: sync
+ when: (result.stat.exists == False) or (kaas_resync | default(false)) or (kaas_project_config.resync | default(false))
+
+- name: "Ensure the data is writeable by project pods"
+ vars:
+ grp: "{{ kaas_project_config.sync_set_gid }}"
+ gid: "{{ ((kaas_project_config.gids | default(kaas_openshift_gids))[grp] is defined) | ternary((kaas_project_config.gids | default(kaas_openshift_gids))[grp].id, grp) }}"
+ file:
+ path: "{{ remote_path }}"
+ state: "directory"
+ recurse: "yes"
+ mode: "g+w"
+ owner: "{{ kaas_project_config.sync_set_uid | default('root') }}"
+ group: "{{ gid }}"
+ register: chmod
+ when:
+ - sync | changed
+ - kaas_openshift_gid_ranges[kaas_project] is defined
+ - kaas_project_config.sync_set_gid | default(false)