This is an automated email from the ASF dual-hosted git repository. lfrolov pushed a commit to branch DLAB-2003 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 94d43b2c2414be096fd028f193b25b7cedcaebe6 Author: leonidfrolov <frolovl...@gmail.com> AuthorDate: Thu Aug 20 18:04:17 2020 +0300 [DLAB-2003]: fixed failure when stopping nginx --- .../src/general/lib/os/debian/common_lib.py | 12 +++++++++--- .../src/general/lib/os/debian/edge_lib.py | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py index 296d9ab..414516f 100644 --- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py +++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py @@ -185,7 +185,10 @@ def install_certbot(os_family): def run_certbot(domain_name, node, email=''): try: print('Running Certbot') - sudo('service nginx stop') + if node == 'ssn': + sudo('service nginx stop') + else: + sudo('service openresty stop') if email != '': sudo('certbot certonly --standalone -n -d {}.{} -m {}'.format(node, domain_name, email)) else: @@ -205,12 +208,15 @@ def configure_nginx_LE(domain_name, node): if node == 'ssn': nginx_config_path = '/etc/nginx/conf.d/nginx_proxy.conf' else: - nginx_config_path = '/etc/nginx/conf.d/proxy.conf' + nginx_config_path = '/usr/local/openresty/nginx/conf/conf.d/proxy.conf' sudo('sed -i "s|.* server_name .*|{}|" {}'.format(server_name_line, nginx_config_path)) sudo('sed -i "s|.* ssl_certificate .*|{}|" {}'.format(cert_path_line, nginx_config_path)) sudo('sed -i "s|.* ssl_certificate_key .*|{}|" {}'.format(cert_key_line, nginx_config_path)) sudo('sed -i "s|.*ExecStart.*|{}|" {}'.format(certbot_service, certbot_service_path)) - sudo('systemctl restart nginx') + if node == 'ssn': + sudo('systemctl restart nginx') + else: + sudo('systemctl restart openresty') except Exception as err: traceback.print_exc() print('Failed to run Certbot: ' + str(err)) diff --git a/infrastructure-provisioning/src/general/lib/os/debian/edge_lib.py b/infrastructure-provisioning/src/general/lib/os/debian/edge_lib.py index 836fd64..bead225 100644 --- a/infrastructure-provisioning/src/general/lib/os/debian/edge_lib.py +++ b/infrastructure-provisioning/src/general/lib/os/debian/edge_lib.py @@ -156,9 +156,9 @@ def install_nginx_lua(edge_ip, nginx_version, keycloak_auth_server_url, keycloak print("Configuring letsencrypt certificates.") install_certbot(os.environ['conf_os_family']) if 'conf_letsencrypt_email' in os.environ: - run_certbot(os.environ['conf_letsencrypt_domain_name'], os.environ['project_name'], os.environ['conf_letsencrypt_email']) + run_certbot(os.environ['conf_letsencrypt_domain_name'], os.environ['project_name'].lower(), os.environ['conf_letsencrypt_email']) else: - run_certbot(os.environ['conf_letsencrypt_domain_name'], os.environ['project_name']) + run_certbot(os.environ['conf_letsencrypt_domain_name'], os.environ['project_name'].lower()) configure_nginx_LE(os.environ['conf_letsencrypt_domain_name'], os.environ['project_name']) except Exception as err: print("Failed install nginx with ldap: " + str(err)) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org