summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-glusterfs
diff options
context:
space:
mode:
authorJose A. Rivera <jarrpa@redhat.com>2017-04-17 17:46:14 -0500
committerJose A. Rivera <jarrpa@redhat.com>2017-05-04 11:44:54 +0200
commit483870112d3a079709b231f1128b979fc5e60c52 (patch)
treefb1f428a0f19623321d9d2176428be903963f072 /playbooks/common/openshift-glusterfs
parent1328328522f11db02d526f72df66c424f3dfbfa3 (diff)
downloadopenshift-483870112d3a079709b231f1128b979fc5e60c52.tar.gz
openshift-483870112d3a079709b231f1128b979fc5e60c52.tar.bz2
openshift-483870112d3a079709b231f1128b979fc5e60c52.tar.xz
openshift-483870112d3a079709b231f1128b979fc5e60c52.zip
GlusterFS: Allow swapping an existing registry's backend storage
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Diffstat (limited to 'playbooks/common/openshift-glusterfs')
-rw-r--r--playbooks/common/openshift-glusterfs/registry.yml47
1 files changed, 46 insertions, 1 deletions
diff --git a/playbooks/common/openshift-glusterfs/registry.yml b/playbooks/common/openshift-glusterfs/registry.yml
index caae79f0f..80cf7529e 100644
--- a/playbooks/common/openshift-glusterfs/registry.yml
+++ b/playbooks/common/openshift-glusterfs/registry.yml
@@ -1,4 +1,49 @@
---
- include: config.yml
-- include: ../openshift-cluster/openshift_hosted.yml
+- name: Initialize GlusterFS registry PV and PVC vars
+ hosts: oo_first_master
+ tags: hosted
+ tasks:
+ - set_fact:
+ glusterfs_pv: []
+ glusterfs_pvc: []
+
+ - set_fact:
+ glusterfs_pv:
+ - name: "{{ openshift.hosted.registry.storage.volume.name }}-glusterfs-volume"
+ capacity: "{{ openshift.hosted.registry.storage.volume.size }}"
+ access_modes: "{{ openshift.hosted.registry.storage.access.modes }}"
+ storage:
+ glusterfs:
+ endpoints: "{{ openshift.hosted.registry.storage.glusterfs.endpoints }}"
+ path: "{{ openshift.hosted.registry.storage.glusterfs.path }}"
+ readOnly: "{{ openshift.hosted.registry.storage.glusterfs.readOnly }}"
+ glusterfs_pvc:
+ - name: "{{ openshift.hosted.registry.storage.volume.name }}-glusterfs-claim"
+ capacity: "{{ openshift.hosted.registry.storage.volume.size }}"
+ access_modes: "{{ openshift.hosted.registry.storage.access.modes }}"
+ when: openshift.hosted.registry.storage.glusterfs.swap
+
+- name: Create persistent volumes
+ hosts: oo_first_master
+ tags:
+ - hosted
+ vars:
+ persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups, glusterfs_pv) }}"
+ persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims(glusterfs_pvc) }}"
+ roles:
+ - role: openshift_persistent_volumes
+ when: persistent_volumes | union(glusterfs_pv) | length > 0 or persistent_volume_claims | union(glusterfs_pvc) | length > 0
+
+- name: Create Hosted Resources
+ hosts: oo_first_master
+ tags:
+ - hosted
+ pre_tasks:
+ - set_fact:
+ openshift_hosted_router_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}"
+ openshift_hosted_registry_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}"
+ when: "'master' in hostvars[groups.oo_first_master.0].openshift and 'registry_url' in hostvars[groups.oo_first_master.0].openshift.master"
+ roles:
+ - role: openshift_hosted