diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2016-02-03 13:09:59 -0500 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2016-02-03 13:09:59 -0500 |
commit | b40b5a26bb1a731dce16f3d0ba381a52ecd5dc8a (patch) | |
tree | 0bd81b49530746ed57609bc5770458ecdec08d7c /roles/openshift_registry | |
parent | fda67ef2addee2cb4cb982c8b9e0eb13bcf9ff7e (diff) | |
parent | 5ff53c80f23744bb5f40d60e2b7da504440f450f (diff) | |
download | openshift-b40b5a26bb1a731dce16f3d0ba381a52ecd5dc8a.tar.gz openshift-b40b5a26bb1a731dce16f3d0ba381a52ecd5dc8a.tar.bz2 openshift-b40b5a26bb1a731dce16f3d0ba381a52ecd5dc8a.tar.xz openshift-b40b5a26bb1a731dce16f3d0ba381a52ecd5dc8a.zip |
Merge pull request #1173 from abutcher/nfs-group
Refactor storage options
Diffstat (limited to 'roles/openshift_registry')
-rw-r--r-- | roles/openshift_registry/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/openshift_registry/tasks/main.yml | 28 | ||||
-rw-r--r-- | roles/openshift_registry/vars/main.yml | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/roles/openshift_registry/defaults/main.yml b/roles/openshift_registry/defaults/main.yml new file mode 100644 index 000000000..17a0d5301 --- /dev/null +++ b/roles/openshift_registry/defaults/main.yml @@ -0,0 +1,2 @@ +--- +registry_volume_claim: 'registry-claim' diff --git a/roles/openshift_registry/tasks/main.yml b/roles/openshift_registry/tasks/main.yml index 2804e8f2e..1eeec2fbb 100644 --- a/roles/openshift_registry/tasks/main.yml +++ b/roles/openshift_registry/tasks/main.yml @@ -1,28 +1,24 @@ --- -- set_fact: _oreg_images="--images='{{ openshift.master.registry_url }}'" - -- set_fact: _oreg_selector="--selector='{{ openshift.master.registry_selector }}'" - - name: Deploy OpenShift Registry command: > {{ openshift.common.admin_binary }} registry - --create --service-account=registry {{ _oreg_selector }} - --credentials={{ openshift_master_config_dir }}/openshift-registry.kubeconfig {{ _oreg_images }} - register: _oreg_results - changed_when: "'service exists' not in _oreg_results.stdout" + --create --replicas={{ openshift.master.infra_nodes | length }} + --service-account=registry {{ oreg_selector }} + --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 +- 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\\}\\}" + changed_when: false 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 + volume_attached: "{{ registry_volume_claim in registry_volumes_output.stdout }}" -- name: Add nfs volume to dc/docker-registry +- name: Add 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 + --add --overwrite -t persistentVolumeClaim --claim-name={{ registry_volume_claim }} + --name=registry-storage + when: not volume_attached | bool diff --git a/roles/openshift_registry/vars/main.yml b/roles/openshift_registry/vars/main.yml index 9967e26f4..306350a5a 100644 --- a/roles/openshift_registry/vars/main.yml +++ b/roles/openshift_registry/vars/main.yml @@ -1,2 +1,4 @@ --- openshift_master_config_dir: "{{ openshift.common.config_base }}/master" +oreg_images: "--images='{{ openshift.master.registry_url }}'" +oreg_selector: "--selector='{{ openshift.master.registry_selector }}'" |