Explorar o código

Refactor template_service_broker_image

This commit adds new variable template_service_broker_image_name
which utilizes oreg_url, if specified, to be uniform with other
components.
Michael Gugino %!s(int64=6) %!d(string=hai) anos
pai
achega
aefbb27a72

+ 1 - 13
roles/template_service_broker/defaults/main.yml

@@ -8,16 +8,4 @@ __tsb_config_file: "apiserver-config.yaml"
 __tsb_rbac_file: "rbac-template.yaml"
 __tsb_broker_file: "template-service-broker-registration.yaml"
 
-l_tsb_image_dict:
-  origin:
-    prefix: "docker.io/openshift/origin-"
-    version: "{{ openshift_image_tag }}"
-    image_name: "template-service-broker"
-  openshift-enterprise:
-    prefix: "registry.access.redhat.com/openshift3/ose-"
-    version: "{{ openshift_image_tag }}"
-    image_name: "template-service-broker"
-
-template_service_broker_prefix: "{{ l_tsb_image_dict[openshift_deployment_type]['prefix'] }}"
-template_service_broker_version: "{{ l_tsb_image_dict[openshift_deployment_type]['version'] }}"
-template_service_broker_image_name: "{{ l_tsb_image_dict[openshift_deployment_type]['image_name'] }}"
+template_service_broker_image: "{{ l_os_registry_url | regex_replace('${component}' | regex_escape, 'template-service-broker') }}"

+ 1 - 1
roles/template_service_broker/tasks/deploy.yml

@@ -38,7 +38,7 @@
     {{ openshift_client_binary }} process --config={{ mktemp.stdout }}/admin.kubeconfig
     -f "{{ mktemp.stdout }}/{{ __tsb_template_file }}" -n openshift-template-service-broker
     --param API_SERVER_CONFIG="{{ config['content'] | b64decode }}"
-    --param IMAGE="{{ template_service_broker_prefix }}{{ template_service_broker_image_name }}:{{ template_service_broker_version }}"
+    --param IMAGE="{{ template_service_broker_image }}"
     --param NODE_SELECTOR={{ {'node-role.kubernetes.io/master':'true'} | to_json | quote }}
     | {{ openshift_client_binary }} apply --config={{ mktemp.stdout }}/admin.kubeconfig -f -