add provider for different server

This commit is contained in:
Emmanuel Garette 2022-06-25 08:11:37 +02:00
parent 0cab627154
commit 9dd32d022d
22 changed files with 77 additions and 2 deletions

View file

@ -24,6 +24,11 @@
</family> </family>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>LocalDNS</param>
<target>dns_client_address</target>
</fill>
<fill name="set_linked"> <fill name="set_linked">
<param name="linked_server" type="variable">dns_client_address</param> <param name="linked_server" type="variable">dns_client_address</param>
<param name="linked_provider">dns</param> <param name="linked_provider">dns</param>

View file

@ -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 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__)) _HERE = _dirname(_abspath(__main__.__file__))
@ -111,3 +111,11 @@ def get_ip(server_name: str,
host_name, domain_name = server_name.split('.', 1) host_name, domain_name = server_name.split('.', 1)
domain = DOMAINS[domain_name] domain = DOMAINS[domain_name]
return domain[1][domain[0].index(host_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]

View file

@ -38,6 +38,11 @@
<check name='valid_base_dn'> <check name='valid_base_dn'>
<target>ldapclient_base_dn</target> <target>ldapclient_base_dn</target>
</check> </check>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>LDAP</param>
<target>ldap_server_address</target>
</fill>
<fill name="calc_value"> <fill name="calc_value">
<param type="variable">tls_ca_directory</param> <param type="variable">tls_ca_directory</param>
<param>ca_LDAP.crt</param> <param>ca_LDAP.crt</param>

View file

@ -6,3 +6,4 @@ depends:
- reverse-proxy-client - reverse-proxy-client
- relay-mail-client - relay-mail-client
- nginx-common - nginx-common
provider: OAuth2

View file

@ -12,6 +12,11 @@
</family> </family>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>MariaDB</param>
<target>mariadb_client_server_domainname</target>
</fill>
<fill name="set_linked"> <fill name="set_linked">
<param name="linked_server" type="variable">mariadb_client_server_domainname</param> <param name="linked_server" type="variable">mariadb_client_server_domainname</param>
<param name="linked_provider">clients</param> <param name="linked_provider">clients</param>

View file

@ -3,3 +3,4 @@ description: Mariadb
depends: depends:
- server - server
- base-fedora-35 - base-fedora-35
provider: MariaDB

View file

@ -3,3 +3,4 @@ description: Nginx as reverse proxy
depends: depends:
- base-fedora-35 - base-fedora-35
- nginx-common - nginx-common
provider: ReverseProxy

View file

@ -3,3 +3,4 @@ description: Configuration du serveur faisant autorité NSD
service: true service: true
depends: depends:
- base-fedora-35 - base-fedora-35
provider: LocalDNS

View file

@ -41,6 +41,11 @@
<variable name="nsd_reverse_filenames_signed" type="filename" description="Nom des fichiers de zone reverse signé" multi="True" hidden="True"/> <variable name="nsd_reverse_filenames_signed" type="filename" description="Nom des fichiers de zone reverse signé" multi="True" hidden="True"/>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>ExternalDNS</param>
<target>nsd_resolver</target>
</fill>
<fill name="nsd_concat_lists"> <fill name="nsd_concat_lists">
<param type="variable">ip_eth</param> <param type="variable">ip_eth</param>
<param type="variable">nsd_allowed_client</param> <param type="variable">nsd_allowed_client</param>

View file

@ -32,6 +32,11 @@
</family> </family>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>OAuth2</param>
<target>oauth2_client_server_domainname</target>
</fill>
<fill name="set_linked"> <fill name="set_linked">
<param name="linked_server" type="variable">oauth2_client_server_domainname</param> <param name="linked_server" type="variable">oauth2_client_server_domainname</param>
<param name="linked_provider">oauth2</param> <param name="linked_provider">oauth2</param>

View file

@ -3,3 +3,4 @@ description: OpenLDAP server
depends: depends:
- ldap-client-fedora - ldap-client-fedora
- base-fedora-35 - base-fedora-35
provider: LDAP

View file

@ -11,6 +11,9 @@
</service> </service>
</services> </services>
<variables> <variables>
<family name="network">
<variable name="dns_client_address" redefine="True"/>
</family>
<family name="peertube"> <family name="peertube">
<variable name="peertube_admin_email" type="mail" description="Adresse courriel de l'administrateur Peertube" mandatory="True"/> <variable name="peertube_admin_email" type="mail" description="Adresse courriel de l'administrateur Peertube" mandatory="True"/>
<variable name="peertube_short_description" type="string" description="Description courte de l'instance"> <variable name="peertube_short_description" type="string" description="Description courte de l'instance">
@ -52,6 +55,11 @@
</family> </family>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>ExternalDNS</param>
<target>dns_client_address</target>
</fill>
<fill name="calc_oauth2_client_external"> <fill name="calc_oauth2_client_external">
<param type="variable">revprox_client_external_domainnames</param> <param type="variable">revprox_client_external_domainnames</param>
<param type="variable">revprox_client_location</param> <param type="variable">revprox_client_location</param>

View file

@ -2,3 +2,4 @@ format: '0.1'
description: Postfix has relay description: Postfix has relay
depends: depends:
- base-fedora-35 - base-fedora-35
provider: SMTP

View file

@ -33,6 +33,7 @@
</services> </services>
<variables> <variables>
<family name="network"> <family name="network">
<variable name="dns_client_address" redefine="True"/>
<variable name="external_ports" redefine="True"> <variable name="external_ports" redefine="True">
<value>25</value> <value>25</value>
</variable> </variable>
@ -52,6 +53,11 @@
</family> </family>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>ExternalDNS</param>
<target>dns_client_address</target>
</fill>
<fill name="calc_value"> <fill name="calc_value">
<param>/etc/opendkim/keys/</param> <param>/etc/opendkim/keys/</param>
<param type="variable">postfix_relay_domains</param> <param type="variable">postfix_relay_domains</param>

View file

@ -20,6 +20,11 @@
</family> </family>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>Postgresql</param>
<target>pg_client_server_domainname</target>
</fill>
<fill name="set_linked"> <fill name="set_linked">
<param name="linked_server" type="variable">pg_client_server_domainname</param> <param name="linked_server" type="variable">pg_client_server_domainname</param>
<param name="linked_provider">clients</param> <param name="linked_provider">clients</param>

View file

@ -3,3 +3,4 @@ description: Postgresql
depends: depends:
- server - server
- base-fedora-35 - base-fedora-35
provider: Postgresql

View file

@ -1,5 +1,4 @@
format: '0.1' format: '0.1'
description: Information for Systemd Machined description: Information for Systemd Machined
provider: true
depends: depends:
- systemd - systemd

View file

@ -19,6 +19,11 @@
</family> </family>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>Redis</param>
<target>redis_client_server_domainname</target>
</fill>
<fill name="set_linked"> <fill name="set_linked">
<param name="linked_server" type="variable">redis_client_server_domainname</param> <param name="linked_server" type="variable">redis_client_server_domainname</param>
<param name="linked_provider">redis_client</param> <param name="linked_provider">redis_client</param>

View file

@ -2,3 +2,4 @@ format: '0.1'
description: Redis description: Redis
depends: depends:
- base-fedora-35 - base-fedora-35
provider: Redis

View file

@ -13,6 +13,11 @@
</family> </family>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>SMTP</param>
<target>smtp_relay_address</target>
</fill>
<fill name="set_linked"> <fill name="set_linked">
<param name="linked_server" type="variable">smtp_relay_address</param> <param name="linked_server" type="variable">smtp_relay_address</param>
<param name="linked_provider">mail</param> <param name="linked_provider">mail</param>

View file

@ -37,6 +37,11 @@
</family> </family>
</variables> </variables>
<constraints> <constraints>
<fill name="get_provider_name">
<param type="variable">zone_name_eth0</param>
<param>ReverseProxy</param>
<target>revprox_client_server_domainname</target>
</fill>
<fill name="get_first_value"> <fill name="get_first_value">
<param type="variable">revprox_client_external_domainnames</param> <param type="variable">revprox_client_external_domainnames</param>
<target>revprox_client_external_domainname</target> <target>revprox_client_external_domainname</target>

View file

@ -3,3 +3,4 @@ description: Configuration du serveur DNS unbound
service: true service: true
depends: depends:
- base-fedora-35 - base-fedora-35
provider: ExternalDNS