summaryrefslogtreecommitdiffstats
path: root/roles/openshift_registry/tasks
diff options
context:
space:
mode:
authorWesley Hearn <wesley.s.hearn@gmail.com>2016-01-04 09:42:43 -0500
committerWesley Hearn <wesley.s.hearn@gmail.com>2016-01-04 09:42:43 -0500
commitf1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9 (patch)
tree1c304d5daebfb1780ca26973319b4427e2a40b54 /roles/openshift_registry/tasks
parentfb1b9ff7d3293c821a8569ae95dcc8a98dfbf967 (diff)
parent0c18c742c60e5c4acd609d682caae7f7ce8840cd (diff)
downloadopenshift-f1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9.tar.gz
openshift-f1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9.tar.bz2
openshift-f1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9.tar.xz
openshift-f1951b2ca60536e81c9ff26a30b1cfbaf5ca12e9.zip
Merge pull request #951 from abutcher/nfs
NFS for registry storage
Diffstat (limited to 'roles/openshift_registry/tasks')
-rw-r--r--roles/openshift_registry/tasks/main.yml18
1 files changed, 16 insertions, 2 deletions
diff --git a/roles/openshift_registry/tasks/main.yml b/roles/openshift_registry/tasks/main.yml
index 749eea5c0..2804e8f2e 100644
--- a/roles/openshift_registry/tasks/main.yml
+++ b/roles/openshift_registry/tasks/main.yml
@@ -1,6 +1,4 @@
---
-# This role is unused until we add options for configuring the backend storage
-
- set_fact: _oreg_images="--images='{{ openshift.master.registry_url }}'"
- set_fact: _oreg_selector="--selector='{{ openshift.master.registry_selector }}'"
@@ -12,3 +10,19 @@
--credentials={{ openshift_master_config_dir }}/openshift-registry.kubeconfig {{ _oreg_images }}
register: _oreg_results
changed_when: "'service exists' not in _oreg_results.stdout"
+
+- name: Determine if nfs volume is already attached
+ command: "{{ openshift.common.client_binary }} get -o template dc/docker-registry --template=\\{\\{.spec.template.spec.volumes\\}\\}"
+ register: registry_volumes_output
+ when: attach_registry_volume | bool
+
+- set_fact:
+ volume_already_attached: "{{ 'server:' + nfs_host in registry_volumes_output.stdout and 'path:' + registry_volume_path in registry_volumes_output.stdout }}"
+ when: attach_registry_volume | bool
+
+- name: Add nfs volume to dc/docker-registry
+ command: >
+ {{ openshift.common.client_binary }} volume dc/docker-registry
+ --add --overwrite --name=registry-storage --mount-path=/registry
+ --source='{"nfs": {"server": "{{ nfs_host }}", "path": "{{ registry_volume_path }}"}}'
+ when: attach_registry_volume | bool and not volume_already_attached | bool