|
@@ -2613,8 +2613,11 @@ class Router(OpenShiftCLI):
|
|
|
|
|
|
def _prepare_router(self):
|
|
|
'''prepare router for instantiation'''
|
|
|
- # We need to create the pem file
|
|
|
- if self.config.config_options['default_cert']['value'] is None:
|
|
|
+ # if cacert, key, and cert were passed, combine them into a pem file
|
|
|
+ if (self.config.config_options['cacert_file']['value'] and
|
|
|
+ self.config.config_options['cert_file']['value'] and
|
|
|
+ self.config.config_options['key_file']['value']):
|
|
|
+
|
|
|
router_pem = '/tmp/router.pem'
|
|
|
with open(router_pem, 'w') as rfd:
|
|
|
rfd.write(open(self.config.config_options['cert_file']['value']).read())
|
|
@@ -2624,8 +2627,13 @@ class Router(OpenShiftCLI):
|
|
|
rfd.write(open(self.config.config_options['cacert_file']['value']).read())
|
|
|
|
|
|
atexit.register(Utils.cleanup, [router_pem])
|
|
|
+
|
|
|
self.config.config_options['default_cert']['value'] = router_pem
|
|
|
|
|
|
+ elif self.config.config_options['default_cert']['value'] is None:
|
|
|
+ # No certificate was passed to us. do not pass one to oc adm router
|
|
|
+ self.config.config_options['default_cert']['include'] = False
|
|
|
+
|
|
|
options = self.config.to_option_list()
|
|
|
|
|
|
cmd = ['router', self.config.name, '-n', self.config.namespace]
|
|
@@ -2937,6 +2945,7 @@ def main():
|
|
|
mutually_exclusive=[["router_type", "images"],
|
|
|
["key_file", "default_cert"],
|
|
|
["cert_file", "default_cert"],
|
|
|
+ ["cacert_file", "default_cert"],
|
|
|
],
|
|
|
|
|
|
supports_check_mode=True,
|