Pārlūkot izejas kodu

Secure router only when openshift.hosted.router.certificate.contents exists.

Andrew Butcher 8 gadi atpakaļ
vecāks
revīzija
6b0e66f285
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      roles/openshift_hosted/tasks/router/router.yml

+ 2 - 2
roles/openshift_hosted/tasks/router/router.yml

@@ -32,7 +32,7 @@
     content: "{{ openshift.hosted.router.certificate.contents }}"
     content: "{{ openshift.hosted.router.certificate.contents }}"
     dest: "{{ openshift_master_config_dir }}/openshift-router.pem"
     dest: "{{ openshift_master_config_dir }}/openshift-router.pem"
     mode: 0600
     mode: 0600
-  when: openshift.hosted.router.certificate | default(none) is not none
+  when: "'certificate' in openshift.hosted.router and 'contents' in openshift.hosted.router.certificate"
 
 
 - name: Retrieve list of openshift nodes matching router selector
 - name: Retrieve list of openshift nodes matching router selector
   command: >
   command: >
@@ -53,7 +53,7 @@
     {% if replicas > 1 -%}
     {% if replicas > 1 -%}
     --replicas={{ replicas }}
     --replicas={{ replicas }}
     {% endif -%}
     {% endif -%}
-    {% if openshift.hosted.router.certificate | default(none) is not none -%}
+    {% if 'certificate' in openshift.hosted.router and 'contents' in openshift.hosted.router.certificate -%}
     --default-cert={{ openshift_master_config_dir }}/openshift-router.pem
     --default-cert={{ openshift_master_config_dir }}/openshift-router.pem
     {% endif -%}
     {% endif -%}
     --namespace={{ openshift.hosted.router.namespace | default('default') }}
     --namespace={{ openshift.hosted.router.namespace | default('default') }}