diff options
author | Scott Dodson <sdodson@redhat.com> | 2017-11-07 16:32:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-07 16:32:57 -0500 |
commit | c42ef6a6963cd4337f858bf25187d0b94018e927 (patch) | |
tree | 41ebd1f4652525b9ba613f2404eb896ac4f3fcf9 /roles | |
parent | 80fdf0d5a4215ad57388dfec9634685502d581af (diff) | |
parent | bfbafebc2e4268088536bbfed2c62bf5855719d0 (diff) | |
download | openshift-c42ef6a6963cd4337f858bf25187d0b94018e927.tar.gz openshift-c42ef6a6963cd4337f858bf25187d0b94018e927.tar.bz2 openshift-c42ef6a6963cd4337f858bf25187d0b94018e927.tar.xz openshift-c42ef6a6963cd4337f858bf25187d0b94018e927.zip |
Merge pull request #6040 from kwoodson/router_shard_custom_cert_fix
[Bug 1509354] Check if routers have certificates and use them
Diffstat (limited to 'roles')
-rw-r--r-- | roles/openshift_hosted/tasks/router.yml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/roles/openshift_hosted/tasks/router.yml b/roles/openshift_hosted/tasks/router.yml index 2aceef9e4..dd7053656 100644 --- a/roles/openshift_hosted/tasks/router.yml +++ b/roles/openshift_hosted/tasks/router.yml @@ -29,7 +29,9 @@ src: "{{ item }}" with_items: "{{ openshift_hosted_routers | oo_collect(attribute='certificate') | oo_select_keys_from_list(['keyfile', 'certfile', 'cafile']) }}" - when: ( not openshift_hosted_router_create_certificate | bool ) or openshift_hosted_router_certificate != {} + when: ( not openshift_hosted_router_create_certificate | bool ) or openshift_hosted_router_certificate != {} or + ( openshift_hosted_routers | oo_collect(attribute='certificate') | oo_select_keys_from_list(['keyfile', 'certfile', 'cafile'])|length > 0 ) + # This is for when we desire a cluster signed cert # The certificate is generated and placed in master_config_dir/ @@ -42,8 +44,8 @@ hostnames: - "{{ openshift_master_default_subdomain | default('router.default.svc.cluster.local') }}" - "*.{{ openshift_master_default_subdomain | default('router.default.svc.cluster.local') }}" - cert: "{{ ('/etc/origin/master/' ~ (item.certificate.certfile | basename)) if 'certfile' in item.certificate else ((openshift_master_config_dir) ~ '/openshift-router.crt') }}" - key: "{{ ('/etc/origin/master/' ~ (item.certificate.keyfile | basename)) if 'keyfile' in item.certificate else ((openshift_master_config_dir) ~ '/openshift-router.key') }}" + cert: "{{ openshift_master_config_dir ~ '/openshift-router.crt' }}" + key: "{{ openshift_master_config_dir ~ '/openshift-router.key' }}" with_items: "{{ openshift_hosted_routers }}" - name: set the openshift_hosted_router_certificate @@ -55,6 +57,7 @@ when: - openshift_hosted_router_create_certificate | bool - openshift_hosted_router_certificate == {} + - openshift_hosted_routers | oo_collect(attribute='certificate') | oo_select_keys_from_list(['keyfile', 'certfile', 'cafile'])|length == 0 - name: Create the router service account(s) oc_serviceaccount: |