From 5af2c41871e8175e2323616d27941dda0f2ffdd3 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Fri, 14 May 2021 12:58:33 +0200 Subject: [PATCH 01/21] added option for no ssl --- .github/workflows/main.yml | 17 ++++++++++++----- VirtualMachineService/VirtualMachineServer.py | 10 ++++++++-- VirtualMachineService/config/config.yml | 3 ++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b67f12f0..7e96bf2a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,8 @@ on: push: branches: - 'staging' + - 'dev' + - 'dev-no-ssl' jobs: build: runs-on: ubuntu-latest @@ -12,11 +14,16 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/checkout@master + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@master with: - name: denbicloud/cloud-portal-client - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - dockerfile: Dockerfile - tags: "staging" + name: denbicloud/cloud-portal-webapp + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: Dockerfile + tags: ${{ steps.extract_branch.outputs.branch }} diff --git a/VirtualMachineService/VirtualMachineServer.py b/VirtualMachineService/VirtualMachineServer.py index 00d0d916..1eb9020d 100644 --- a/VirtualMachineService/VirtualMachineServer.py +++ b/VirtualMachineService/VirtualMachineServer.py @@ -12,7 +12,7 @@ print(e) from VirtualMachineHandler import VirtualMachineHandler -from thrift.transport import TSSLSocket +from thrift.transport import TSSLSocket, TSocket from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol from thrift.server import TServer @@ -62,10 +62,16 @@ def catch_shutdown(signal, frame): PORT = cfg["openstack_connection"]["port"] CERTFILE = cfg["openstack_connection"]["certfile"] THREADS = cfg["openstack_connection"]["threads"] + USE_SSL = cfg["openstack_connection"].get("use_ssl", True) click.echo("Server is running on port {}".format(PORT)) handler = VirtualMachineHandler(CONFIG_FILE) processor = Processor(handler) - transport = TSSLSocket.TSSLServerSocket(host=HOST, port=PORT, certfile=CERTFILE) + if USE_SSL: + click.echo("Use SSL") + transport = TSSLSocket.TSSLServerSocket(host=HOST, port=PORT, certfile=CERTFILE) + else: + click.echo("Does not use SSL") + transport = TSocket.TServerSocket(host=HOST, port=PORT) tfactory = TTransport.TBufferedTransportFactory() pfactory = TBinaryProtocol.TBinaryProtocolFactory() server = TServer.TThreadPoolServer( diff --git a/VirtualMachineService/config/config.yml b/VirtualMachineService/config/config.yml index d5e2213b..88ae68be 100644 --- a/VirtualMachineService/config/config.yml +++ b/VirtualMachineService/config/config.yml @@ -24,6 +24,7 @@ openstack_connection: availability_zone: default # If you use docker-compose this path needs to be the path you mount the server.pem into certfile: /code/VirtualMachineService/keys/server.pem + use_ssl: False # Used for gateway port calculation , x is always the last octet of the fixed ip (example : (x + 3) *3 ) ) ssh_port_calc_formular: 30000 + x @@ -43,4 +44,4 @@ forc: forc_api_key: github_playbooks_repo: -cloud_site: bielefeld \ No newline at end of file +cloud_site: bielefeld From dcb28da8b0691e90ce3e7750bbe5adca679ba6ce Mon Sep 17 00:00:00 2001 From: dweinholz Date: Mon, 17 May 2021 17:57:19 +0200 Subject: [PATCH 02/21] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e96bf2a..f8eb7267 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@master with: - name: denbicloud/cloud-portal-webapp + name: denbicloud/cloud-portal-client username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} dockerfile: Dockerfile From c8a866fba64c11d6e3a8977e272a0161f682d874 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Mon, 17 May 2021 21:09:02 +0200 Subject: [PATCH 03/21] added redis as config params --- VirtualMachineService/VirtualMachineHandler.py | 8 +++++--- VirtualMachineService/config/config.yml | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index ac61eaa4..6ef54804 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -151,9 +151,7 @@ def __init__(self, config): Read all config variables and creates a connection to OpenStack. """ - # connection to redis. Uses a pool with 10 connections. - self.pool = redis.ConnectionPool(host="redis", port=6379) - self.redis = redis.Redis(connection_pool=self.pool, charset="utf-8") + self.USERNAME = os.environ["OS_USERNAME"] self.PASSWORD = os.environ["OS_PASSWORD"] @@ -174,6 +172,10 @@ def __init__(self, config): self.AVAIALABILITY_ZONE = cfg["openstack_connection"]["availability_zone"] self.PRODUCTION = cfg["openstack_connection"]["production"] self.CLOUD_SITE = cfg["cloud_site"] + # connection to redis. Uses a pool with 10 connections. + self.pool = redis.ConnectionPool(host=cfg["redis"]["host"], port=cfg["redis"]["port"]) + + self.redis = redis.Redis(connection_pool=self.pool, charset="utf-8") # try to initialize forc connection try: self.SUB_NETWORK = cfg["bibigrid"]["sub_network"] diff --git a/VirtualMachineService/config/config.yml b/VirtualMachineService/config/config.yml index 88ae68be..5ada9c1e 100644 --- a/VirtualMachineService/config/config.yml +++ b/VirtualMachineService/config/config.yml @@ -1,3 +1,7 @@ +redis: + host: redis + port: 6379 + openstack_connection: threads: 30 host: 0.0.0.0 From 7be3f8e01647d315697cf2dae9dfa5fadf3d5085 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Mon, 17 May 2021 21:19:58 +0200 Subject: [PATCH 04/21] add check if redis is connected --- VirtualMachineService/VirtualMachineHandler.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index 6ef54804..a93af1b7 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -3,6 +3,7 @@ Which can be used for the PortalClient. """ +import sys from uuid import uuid4 try: @@ -176,6 +177,12 @@ def __init__(self, config): self.pool = redis.ConnectionPool(host=cfg["redis"]["host"], port=cfg["redis"]["port"]) self.redis = redis.Redis(connection_pool=self.pool, charset="utf-8") + try: + self.redis.ping() + except redis.ConnectionError as r_con_error: + LOG.exception("Could not connect to redis!") + sys.exit(1) + # try to initialize forc connection try: self.SUB_NETWORK = cfg["bibigrid"]["sub_network"] From 3bc5b8eddd32aeb107767f58982790ab36faee84 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Mon, 17 May 2021 21:22:49 +0200 Subject: [PATCH 05/21] add passwort param --- VirtualMachineService/VirtualMachineHandler.py | 2 +- VirtualMachineService/config/config.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index a93af1b7..076362d8 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -176,7 +176,7 @@ def __init__(self, config): # connection to redis. Uses a pool with 10 connections. self.pool = redis.ConnectionPool(host=cfg["redis"]["host"], port=cfg["redis"]["port"]) - self.redis = redis.Redis(connection_pool=self.pool, charset="utf-8") + self.redis = redis.Redis(connection_pool=self.pool, charset="utf-8",password=cfg["redis"]["password"]) try: self.redis.ping() except redis.ConnectionError as r_con_error: diff --git a/VirtualMachineService/config/config.yml b/VirtualMachineService/config/config.yml index 5ada9c1e..e32d5ba7 100644 --- a/VirtualMachineService/config/config.yml +++ b/VirtualMachineService/config/config.yml @@ -1,6 +1,7 @@ redis: host: redis port: 6379 + password: "" openstack_connection: threads: 30 From ee7eb2b9d763b62bb5efd3baabcd2705d7261e82 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Mon, 17 May 2021 21:41:46 +0200 Subject: [PATCH 06/21] set password --- VirtualMachineService/VirtualMachineHandler.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index 076362d8..bdda60d5 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -174,13 +174,18 @@ def __init__(self, config): self.PRODUCTION = cfg["openstack_connection"]["production"] self.CLOUD_SITE = cfg["cloud_site"] # connection to redis. Uses a pool with 10 connections. - self.pool = redis.ConnectionPool(host=cfg["redis"]["host"], port=cfg["redis"]["port"]) + self.REDIS_HOST=cfg["redis"]["host"] + self.REDIS_PORT=cfg["redis"]["port"] + self.REDIS_PASSWORD=cfg["redis"]["password"] + LOG.info(f"Connecting to Redis at {self.REDIS_HOST}:{self.REDIS_PORT}..") + self.pool = redis.ConnectionPool(host=self.REDIS_HOST, port=self.REDIS_PORT,password=self.REDIS_PASSWORD) - self.redis = redis.Redis(connection_pool=self.pool, charset="utf-8",password=cfg["redis"]["password"]) + self.redis = redis.Redis(connection_pool=self.pool, charset="utf-8") try: self.redis.ping() - except redis.ConnectionError as r_con_error: - LOG.exception("Could not connect to redis!") + LOG.info("Connected to Redis!") + except redis.ConnectionError: + LOG.exception("Could not connect to Redis!") sys.exit(1) # try to initialize forc connection From ffca0858cdfffc562a307d9c8990fbfccdb46072 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 May 2021 19:43:07 +0000 Subject: [PATCH 07/21] fix(Linting):blacked code --- VirtualMachineService/VirtualMachineHandler.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index bdda60d5..5d83b365 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -152,8 +152,6 @@ def __init__(self, config): Read all config variables and creates a connection to OpenStack. """ - - self.USERNAME = os.environ["OS_USERNAME"] self.PASSWORD = os.environ["OS_PASSWORD"] self.PROJECT_NAME = os.environ["OS_PROJECT_NAME"] @@ -174,11 +172,13 @@ def __init__(self, config): self.PRODUCTION = cfg["openstack_connection"]["production"] self.CLOUD_SITE = cfg["cloud_site"] # connection to redis. Uses a pool with 10 connections. - self.REDIS_HOST=cfg["redis"]["host"] - self.REDIS_PORT=cfg["redis"]["port"] - self.REDIS_PASSWORD=cfg["redis"]["password"] + self.REDIS_HOST = cfg["redis"]["host"] + self.REDIS_PORT = cfg["redis"]["port"] + self.REDIS_PASSWORD = cfg["redis"]["password"] LOG.info(f"Connecting to Redis at {self.REDIS_HOST}:{self.REDIS_PORT}..") - self.pool = redis.ConnectionPool(host=self.REDIS_HOST, port=self.REDIS_PORT,password=self.REDIS_PASSWORD) + self.pool = redis.ConnectionPool( + host=self.REDIS_HOST, port=self.REDIS_PORT, password=self.REDIS_PASSWORD + ) self.redis = redis.Redis(connection_pool=self.pool, charset="utf-8") try: From 2f3850b64dca7db477769524923a415023c8f17f Mon Sep 17 00:00:00 2001 From: dweinholz Date: Tue, 18 May 2021 16:33:57 +0200 Subject: [PATCH 08/21] updated ansible.cfg --- ansible.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible.cfg b/ansible.cfg index 4c66924d..21be49d6 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,8 +1,10 @@ [defaults] host_key_checking = False +record_host_key = False roles_path = ~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/code/VirtualMachineService/ancon/playbooks/roles [paramiko_connection] host_key_checking = False +record_host_key = False env:ANSIBLE_PARAMIKO_HOST_KEY_CHECKING var: ansible_paramiko_host_key_checking From 3b4b8d1098e8fe4fb43d27aeaf1793d7dc89337e Mon Sep 17 00:00:00 2001 From: dweinholz Date: Tue, 18 May 2021 18:22:48 +0200 Subject: [PATCH 09/21] more verbose --- VirtualMachineService/ancon/Playbook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VirtualMachineService/ancon/Playbook.py b/VirtualMachineService/ancon/Playbook.py index 6f902d1f..4eb104b5 100644 --- a/VirtualMachineService/ancon/Playbook.py +++ b/VirtualMachineService/ancon/Playbook.py @@ -228,9 +228,10 @@ def add_always_tasks_only(self, playbook_name): ) def run_it(self): - command_string = "/usr/local/bin/ansible-playbook -v -i {0} {1}/{2}".format( + command_string = "/usr/local/bin/ansible-playbook -vvvv -i {0} {1}/{2}".format( self.inventory.name, self.directory.name, self.playbook_exec_name ) + LOG.info(f"Run Playbook with command {command_string}") command_string = shlex.split(command_string) self.process = subprocess.Popen( command_string, From b67d26651f1b25335d197624bc1c868690b1fdd7 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Tue, 18 May 2021 19:46:11 +0200 Subject: [PATCH 10/21] skip cleanup for now --- VirtualMachineService/VirtualMachineHandler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index 5d83b365..90245c12 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -1652,7 +1652,7 @@ def get_playbook_logs(self, openstack_id): status, stdout, stderr = playbook.get_logs() LOG.info(f" Playbook logs{openstack_id} stattus: {status}") - playbook.cleanup(openstack_id) + # playbook.cleanup(openstack_id) self.delete_keypair(key_name=key_name) return PlaybookResult(status=status, stdout=stdout, stderr=stderr) else: From 19d7b0fb628727178c896da10b7b5a4ff2f58edf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 May 2021 17:47:29 +0000 Subject: [PATCH 11/21] fix(Linting):blacked code --- VirtualMachineService/VirtualMachineHandler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index 90245c12..f87b9564 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -1652,7 +1652,7 @@ def get_playbook_logs(self, openstack_id): status, stdout, stderr = playbook.get_logs() LOG.info(f" Playbook logs{openstack_id} stattus: {status}") - # playbook.cleanup(openstack_id) + # playbook.cleanup(openstack_id) self.delete_keypair(key_name=key_name) return PlaybookResult(status=status, stdout=stdout, stderr=stderr) else: From 600ad114f788fa6e3d02e4cb48c4e48ec4a5d2f0 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Wed, 19 May 2021 08:59:31 +0200 Subject: [PATCH 12/21] test sleeping --- VirtualMachineService/VirtualMachineHandler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index f87b9564..b8e5b4e6 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -1278,6 +1278,10 @@ def create_and_deploy_playbook( cloud_site=self.CLOUD_SITE, ) self.redis.hset(openstack_id, "status", self.BUILD_PLAYBOOK) + LOG.info("Start Sleeping for testing") + time.sleep(20) + LOG.info("Sleeped 20 s") + playbook.run_it() active_playbooks[openstack_id] = playbook return 0 From 03a701a09d95bd93d503d8dffa560be1572eeb61 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Wed, 19 May 2021 09:14:12 +0200 Subject: [PATCH 13/21] add timeout to palybook --- VirtualMachineService/VirtualMachineHandler.py | 4 ---- VirtualMachineService/ancon/Playbook.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index b8e5b4e6..f87b9564 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -1278,10 +1278,6 @@ def create_and_deploy_playbook( cloud_site=self.CLOUD_SITE, ) self.redis.hset(openstack_id, "status", self.BUILD_PLAYBOOK) - LOG.info("Start Sleeping for testing") - time.sleep(20) - LOG.info("Sleeped 20 s") - playbook.run_it() active_playbooks[openstack_id] = playbook return 0 diff --git a/VirtualMachineService/ancon/Playbook.py b/VirtualMachineService/ancon/Playbook.py index 4eb104b5..0be1269d 100644 --- a/VirtualMachineService/ancon/Playbook.py +++ b/VirtualMachineService/ancon/Playbook.py @@ -228,7 +228,7 @@ def add_always_tasks_only(self, playbook_name): ) def run_it(self): - command_string = "/usr/local/bin/ansible-playbook -vvvv -i {0} {1}/{2}".format( + command_string = "/usr/local/bin/ansible-playbook -t 30 -vvvv -i {0} {1}/{2}".format( self.inventory.name, self.directory.name, self.playbook_exec_name ) LOG.info(f"Run Playbook with command {command_string}") From 6d4f0419d866d573526fb7cfdd834d846ec48a8c Mon Sep 17 00:00:00 2001 From: dweinholz Date: Wed, 19 May 2021 09:35:34 +0200 Subject: [PATCH 14/21] dont cleant --- VirtualMachineService/ancon/Playbook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VirtualMachineService/ancon/Playbook.py b/VirtualMachineService/ancon/Playbook.py index 0be1269d..896456c0 100644 --- a/VirtualMachineService/ancon/Playbook.py +++ b/VirtualMachineService/ancon/Playbook.py @@ -274,7 +274,7 @@ def get_logs(self): return self.returncode, self.stdout, self.stderr def cleanup(self, openstack_id): - self.directory.cleanup() + #self.directory.cleanup() self.redis.delete(openstack_id) def stop(self, openstack_id): From cbb67f55bee2c140f06315ff3659a3d5b906538d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 May 2021 07:40:34 +0000 Subject: [PATCH 15/21] fix(Linting):blacked code --- VirtualMachineService/VirtualMachineHandler.py | 17 ++++++++--------- VirtualMachineService/ancon/Playbook.py | 8 +++++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index c2bd6a4c..6a726c4e 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -1921,16 +1921,15 @@ def add_udp_security_group(self, server_id): server.name + "_udp" ) ) - server_security_groups=self.conn.list_server_security_groups(server) + server_security_groups = self.conn.list_server_security_groups(server) for sg in server_security_groups: - if sg["name"] == server.name + "_udp": - LOG.info( - "UDP Security group with name {} already added to server.".format( - server.name + "_udp" - ) - ) - return True - + if sg["name"] == server.name + "_udp": + LOG.info( + "UDP Security group with name {} already added to server.".format( + server.name + "_udp" + ) + ) + return True self.conn.compute.add_security_group_to_server( server=server_id, security_group=sec diff --git a/VirtualMachineService/ancon/Playbook.py b/VirtualMachineService/ancon/Playbook.py index 896456c0..b301eaac 100644 --- a/VirtualMachineService/ancon/Playbook.py +++ b/VirtualMachineService/ancon/Playbook.py @@ -228,8 +228,10 @@ def add_always_tasks_only(self, playbook_name): ) def run_it(self): - command_string = "/usr/local/bin/ansible-playbook -t 30 -vvvv -i {0} {1}/{2}".format( - self.inventory.name, self.directory.name, self.playbook_exec_name + command_string = ( + "/usr/local/bin/ansible-playbook -t 30 -vvvv -i {0} {1}/{2}".format( + self.inventory.name, self.directory.name, self.playbook_exec_name + ) ) LOG.info(f"Run Playbook with command {command_string}") command_string = shlex.split(command_string) @@ -274,7 +276,7 @@ def get_logs(self): return self.returncode, self.stdout, self.stderr def cleanup(self, openstack_id): - #self.directory.cleanup() + # self.directory.cleanup() self.redis.delete(openstack_id) def stop(self, openstack_id): From eacda8a8aca13384a9bb78c97cd28aeffc7b1654 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Wed, 26 May 2021 14:10:05 +0200 Subject: [PATCH 16/21] Update config.yml --- VirtualMachineService/config/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VirtualMachineService/config/config.yml b/VirtualMachineService/config/config.yml index e32d5ba7..8f43eb19 100644 --- a/VirtualMachineService/config/config.yml +++ b/VirtualMachineService/config/config.yml @@ -29,7 +29,7 @@ openstack_connection: availability_zone: default # If you use docker-compose this path needs to be the path you mount the server.pem into certfile: /code/VirtualMachineService/keys/server.pem - use_ssl: False + use_ssl: True # Used for gateway port calculation , x is always the last octet of the fixed ip (example : (x + 3) *3 ) ) ssh_port_calc_formular: 30000 + x From 341fd0737b1bf7fd7ac2757978b648d91230af22 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Wed, 26 May 2021 14:11:03 +0200 Subject: [PATCH 17/21] Update VirtualMachineHandler.py --- VirtualMachineService/VirtualMachineHandler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index 6a726c4e..d86c15d1 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -1652,7 +1652,7 @@ def get_playbook_logs(self, openstack_id): status, stdout, stderr = playbook.get_logs() LOG.info(f" Playbook logs{openstack_id} stattus: {status}") - # playbook.cleanup(openstack_id) + playbook.cleanup(openstack_id) self.delete_keypair(key_name=key_name) return PlaybookResult(status=status, stdout=stdout, stderr=stderr) else: From 150904f88c74f359f70bc48043c17d58ebf73351 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Wed, 26 May 2021 14:14:30 +0200 Subject: [PATCH 18/21] Update .env.in --- .env.in | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.in b/.env.in index 828238a6..c2fa8f8f 100644 --- a/.env.in +++ b/.env.in @@ -10,6 +10,7 @@ OS_USERNAME= OS_USER_DOMAIN_NAME= OS_PROJECT_DOMAIN_ID= OS_PASSWORD= +REDIS_PASSWORD="" # Filebeat FILEBEAT_TAG=7.12.1 From a1b913c130a7a516997681061fc1ce9afc0f1386 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Wed, 26 May 2021 14:15:31 +0200 Subject: [PATCH 19/21] Update .env.in --- .env.in | 1 - 1 file changed, 1 deletion(-) diff --git a/.env.in b/.env.in index c2fa8f8f..828238a6 100644 --- a/.env.in +++ b/.env.in @@ -10,7 +10,6 @@ OS_USERNAME= OS_USER_DOMAIN_NAME= OS_PROJECT_DOMAIN_ID= OS_PASSWORD= -REDIS_PASSWORD="" # Filebeat FILEBEAT_TAG=7.12.1 From 296eadf7936df7c2ebc8e6210765efdd4a305489 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Wed, 26 May 2021 14:18:34 +0200 Subject: [PATCH 20/21] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8eb7267..2aea28ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,9 +2,9 @@ name: Publish Docker on: push: branches: + - 'master' - 'staging' - 'dev' - - 'dev-no-ssl' jobs: build: runs-on: ubuntu-latest From 1c16c45f0ceb16c08e49519a5eef99dbb033a708 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Wed, 26 May 2021 14:19:25 +0200 Subject: [PATCH 21/21] Update Playbook.py --- VirtualMachineService/ancon/Playbook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VirtualMachineService/ancon/Playbook.py b/VirtualMachineService/ancon/Playbook.py index b301eaac..8741ca6d 100644 --- a/VirtualMachineService/ancon/Playbook.py +++ b/VirtualMachineService/ancon/Playbook.py @@ -276,7 +276,7 @@ def get_logs(self): return self.returncode, self.stdout, self.stderr def cleanup(self, openstack_id): - # self.directory.cleanup() + self.directory.cleanup() self.redis.delete(openstack_id) def stop(self, openstack_id):