From 2edf4d2e8654263335a6293f7da00997b0428a5d Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 31 Jul 2023 18:50:05 +0200 Subject: [PATCH] better tls zone calculation --- src/risotto/machine.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/risotto/machine.py b/src/risotto/machine.py index 84fa5e7..4e915f9 100644 --- a/src/risotto/machine.py +++ b/src/risotto/machine.py @@ -334,7 +334,7 @@ class Loader: def add_tls(self): dns_module_name = None for host in self.servers_json['hosts'].values(): - zones = [self.servers_json['zones']['external_zone']] + zones = [self.servers_json['zones']['external_zone'], None] for server_name, datas in host['servers'].items(): if not 'applicationservice' in datas: raise Exception(f'cannot find applicationservice for "{server_name}"') @@ -345,8 +345,8 @@ class Loader: if dns_module_name: break zones[1] = datas['provider_zone'] - if zones[0] == zones[1]: - zones = [zones[0]] + if zones[0] == zones[1] or not zones[1]: + zones.pop(1) host['servers']['tls'] = {'applicationservice': 'tls', 'zones_name': zones, }