From 9dd32d022d845254c67c5e78a7b22b4c56523e58 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 25 Jun 2022 08:11:37 +0200 Subject: [PATCH] add provider for different server --- .../2022.03.08/base/dictionaries/12-base.xml | 5 +++++ seed/applicationservice/2022.03.08/base/funcs/funcs.py | 10 +++++++++- .../ldap-client/dictionaries/21_ldap-client.xml | 5 +++++ .../2022.03.08/lemonldap/applicationservice.yml | 1 + .../mariadb-client/dictionaries/20_mariadb.xml | 5 +++++ .../2022.03.08/mariadb/applicationservice.yml | 1 + .../nginx-reverse-proxy/applicationservice.yml | 1 + .../2022.03.08/nsd/applicationservice.yml | 1 + .../2022.03.08/nsd/dictionaries/20_nsd.xml | 5 +++++ .../oauth2-client/dictionaries/30_oauth2_client.xml | 5 +++++ .../2022.03.08/openldap/applicationservice.yml | 1 + .../2022.03.08/peertube/dictionaries/30_peertube.xml | 8 ++++++++ .../2022.03.08/postfix-relay/applicationservice.yml | 1 + .../postfix-relay/dictionaries/30_postfix.xml | 6 ++++++ .../postgresql-client/dictionaries/23_postgresql.xml | 5 +++++ .../2022.03.08/postgresql/applicationservice.yml | 1 + .../provider-systemd-machined/applicationservice.yml | 1 - .../2022.03.08/redis-client/dictionaries/23_redis.xml | 5 +++++ .../2022.03.08/redis/applicationservice.yml | 1 + .../relay-mail-client/dictionaries/20_smtp_client.xml | 5 +++++ .../dictionaries/21_nginx_client.xml | 5 +++++ .../2022.03.08/unbound/applicationservice.yml | 1 + 22 files changed, 77 insertions(+), 2 deletions(-) diff --git a/seed/applicationservice/2022.03.08/base/dictionaries/12-base.xml b/seed/applicationservice/2022.03.08/base/dictionaries/12-base.xml index ba360184..553c19a6 100644 --- a/seed/applicationservice/2022.03.08/base/dictionaries/12-base.xml +++ b/seed/applicationservice/2022.03.08/base/dictionaries/12-base.xml @@ -24,6 +24,11 @@ + + zone_name_eth0 + LocalDNS + dns_client_address + dns_client_address dns diff --git a/seed/applicationservice/2022.03.08/base/funcs/funcs.py b/seed/applicationservice/2022.03.08/base/funcs/funcs.py index c9deac13..bd0e6e26 100644 --- a/seed/applicationservice/2022.03.08/base/funcs/funcs.py +++ b/seed/applicationservice/2022.03.08/base/funcs/funcs.py @@ -7,7 +7,7 @@ from os.path import dirname as _dirname, abspath as _abspath, join as _join, isf from os import makedirs as _makedirs -from risotto.utils import load_domains, DOMAINS +from risotto.utils import load_domains, DOMAINS, ZONES_SERVER _HERE = _dirname(_abspath(__main__.__file__)) @@ -111,3 +111,11 @@ def get_ip(server_name: str, host_name, domain_name = server_name.split('.', 1) domain = DOMAINS[domain_name] return domain[1][domain[0].index(host_name)] + + +def get_provider_name(network_name: str, + provider: str, + ) -> str: + if network_name not in ZONES_SERVER['providers'] or provider not in ZONES_SERVER['providers'][network_name]: + return + return ZONES_SERVER['providers'][network_name][provider][0] diff --git a/seed/applicationservice/2022.03.08/ldap-client/dictionaries/21_ldap-client.xml b/seed/applicationservice/2022.03.08/ldap-client/dictionaries/21_ldap-client.xml index 53eeddca..362e6f9b 100644 --- a/seed/applicationservice/2022.03.08/ldap-client/dictionaries/21_ldap-client.xml +++ b/seed/applicationservice/2022.03.08/ldap-client/dictionaries/21_ldap-client.xml @@ -38,6 +38,11 @@ ldapclient_base_dn + + zone_name_eth0 + LDAP + ldap_server_address + tls_ca_directory ca_LDAP.crt diff --git a/seed/applicationservice/2022.03.08/lemonldap/applicationservice.yml b/seed/applicationservice/2022.03.08/lemonldap/applicationservice.yml index 723261ea..f715b6a0 100644 --- a/seed/applicationservice/2022.03.08/lemonldap/applicationservice.yml +++ b/seed/applicationservice/2022.03.08/lemonldap/applicationservice.yml @@ -6,3 +6,4 @@ depends: - reverse-proxy-client - relay-mail-client - nginx-common +provider: OAuth2 diff --git a/seed/applicationservice/2022.03.08/mariadb-client/dictionaries/20_mariadb.xml b/seed/applicationservice/2022.03.08/mariadb-client/dictionaries/20_mariadb.xml index baf56794..23fbd224 100644 --- a/seed/applicationservice/2022.03.08/mariadb-client/dictionaries/20_mariadb.xml +++ b/seed/applicationservice/2022.03.08/mariadb-client/dictionaries/20_mariadb.xml @@ -12,6 +12,11 @@ + + zone_name_eth0 + MariaDB + mariadb_client_server_domainname + mariadb_client_server_domainname clients diff --git a/seed/applicationservice/2022.03.08/mariadb/applicationservice.yml b/seed/applicationservice/2022.03.08/mariadb/applicationservice.yml index f168f314..ed6250a8 100644 --- a/seed/applicationservice/2022.03.08/mariadb/applicationservice.yml +++ b/seed/applicationservice/2022.03.08/mariadb/applicationservice.yml @@ -3,3 +3,4 @@ description: Mariadb depends: - server - base-fedora-35 +provider: MariaDB diff --git a/seed/applicationservice/2022.03.08/nginx-reverse-proxy/applicationservice.yml b/seed/applicationservice/2022.03.08/nginx-reverse-proxy/applicationservice.yml index 6ad1c196..e9807319 100644 --- a/seed/applicationservice/2022.03.08/nginx-reverse-proxy/applicationservice.yml +++ b/seed/applicationservice/2022.03.08/nginx-reverse-proxy/applicationservice.yml @@ -3,3 +3,4 @@ description: Nginx as reverse proxy depends: - base-fedora-35 - nginx-common +provider: ReverseProxy diff --git a/seed/applicationservice/2022.03.08/nsd/applicationservice.yml b/seed/applicationservice/2022.03.08/nsd/applicationservice.yml index ad102d8f..9e35bd6d 100644 --- a/seed/applicationservice/2022.03.08/nsd/applicationservice.yml +++ b/seed/applicationservice/2022.03.08/nsd/applicationservice.yml @@ -3,3 +3,4 @@ description: Configuration du serveur faisant autorité NSD service: true depends: - base-fedora-35 +provider: LocalDNS diff --git a/seed/applicationservice/2022.03.08/nsd/dictionaries/20_nsd.xml b/seed/applicationservice/2022.03.08/nsd/dictionaries/20_nsd.xml index cb5bbdf4..dd159d28 100644 --- a/seed/applicationservice/2022.03.08/nsd/dictionaries/20_nsd.xml +++ b/seed/applicationservice/2022.03.08/nsd/dictionaries/20_nsd.xml @@ -41,6 +41,11 @@