summaryrefslogtreecommitdiffstats
path: root/roles/openshift_hosted/tasks/registry/storage/persistent_volume.yml
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@afrolegs.com>2016-07-08 10:11:04 -0400
committerGitHub <noreply@github.com>2016-07-08 10:11:04 -0400
commit69b47af2aa3986ac18d5fdddf5dc6ed478fe08c4 (patch)
tree0419cfc12d414a95c987f7667f6618fba923c522 /roles/openshift_hosted/tasks/registry/storage/persistent_volume.yml
parent8a0c9b6b6a9820b38694cb23979ffc7a8c358588 (diff)
parent57dfae185d3d0e02ebe515263c54867bee37b45e (diff)
downloadopenshift-69b47af2aa3986ac18d5fdddf5dc6ed478fe08c4.tar.gz
openshift-69b47af2aa3986ac18d5fdddf5dc6ed478fe08c4.tar.bz2
openshift-69b47af2aa3986ac18d5fdddf5dc6ed478fe08c4.tar.xz
openshift-69b47af2aa3986ac18d5fdddf5dc6ed478fe08c4.zip
Merge pull request #2023 from abutcher/openshift-hosted
Various hosted component improvements
Diffstat (limited to 'roles/openshift_hosted/tasks/registry/storage/persistent_volume.yml')
-rw-r--r--roles/openshift_hosted/tasks/registry/storage/persistent_volume.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/openshift_hosted/tasks/registry/storage/persistent_volume.yml b/roles/openshift_hosted/tasks/registry/storage/persistent_volume.yml
new file mode 100644
index 000000000..6bf859e82
--- /dev/null
+++ b/roles/openshift_hosted/tasks/registry/storage/persistent_volume.yml
@@ -0,0 +1,18 @@
+---
+- set_fact:
+ registry_volume_claim: "{{ openshift.hosted.registry.storage.volume.name }}-claim"
+
+- name: Determine if volume is already attached to dc/docker-registry
+ command: "{{ openshift.common.client_binary }} get -o template dc/docker-registry --template=\\{\\{.spec.template.spec.volumes\\}\\} --output-version=v1"
+ changed_when: false
+ register: registry_volumes_output
+
+- set_fact:
+ volume_attached: "{{ registry_volume_claim in registry_volumes_output.stdout }}"
+
+- name: Add volume to dc/docker-registry
+ command: >
+ {{ openshift.common.client_binary }} volume dc/docker-registry
+ --add --overwrite -t persistentVolumeClaim --claim-name={{ registry_volume_claim }}
+ --name=registry-storage
+ when: not volume_attached | bool