AD_REALM='%%ad_realm'
AD_DOMAIN='%%ad_domain'
AD_HOST_NAME='%%ad_server_netbios_name'
%if %%mode_conteneur_actif == 'oui'
AD_HOST_IP='%%adresse_ip_domaine_link'
%else
AD_HOST_IP='%%adresse_ip_eth0'
%end if
AD_HOST_NETMASK='%%adresse_netmask_eth0'
NOM_CARTE_NIC1='%%nom_zone_eth0'
AD_SERVER_ROLE='%%ad_server_role'
BASEDN="DC=%echo ',DC='.join(%%ad_realm.split('.')) + '"'

NTP_SERVERS='%%custom_join(%%serveur_ntp, " ")'

%if %%is_defined('ad_additional_dc_ip') and not %%is_empty(%%ad_additional_dc_ip)
# Sur les contrôleurs de domaine donner la liste des autres contrôleurs du même domaine
AD_ADDITIONAL_DC_IP='%slurp
    %for %%variable_iter in %%ad_additional_dc_ip
%%variable_iter %slurp
    %end for
'
%end if

# Only if role is domain controler
%if %%getVar('ad_force_domain_sid', 'non') == 'oui'
AD_DOMAIN_SID='%%getVar("ad_domain_sid")'
%else
AD_DOMAIN_SID=''
%end if
AD_ADDITIONAL_DC='%%getVar("ad_additional_dc", "non")'
%if %%getVar('ad_internal_dns_backend', 'oui') == 'oui'
AD_DNS_BACKEND='SAMBA_INTERNAL'
%else
AD_DNS_BACKEND='BIND9_DLZ'
%end if

# Only if role is domain controler and is additionnal DC
%if %%getVar('ad_additional_dc', 'non') == 'oui'
 %if %%getVar('ad_ro_dc', 'non') == 'oui'
AD_SERVER_MODE='RO'
 %else
unset AD_SERVER_MODE
 %end if
AD_ADDITIONAL_DC_FORCE_SITE='%%ad_additional_dc_force_site'
 %if %%ad_additional_dc_force_site == 'oui'
DC_SITE='%%ad_additional_dc_site'
 %else
DC_SITE='Default-First-Site-Name'
 %end if
# Pour les contrôleurs de domaine additionnels donner l'IP du contrôleur de référence
AD_DC_SYSVOL_REF='%%ad_dc_sysvol_ref'
AD_DC_SYSVOL_TYPE='%%ad_dc_sysvol_type'
 %if %%getVar('ad_dc_sysvol_type', 'seth') == 'samba'
AD_DC_SYSVOL_POST_JOIN_CMD='%%ad_dc_sysvol_post_join_cmd'
 %end if
%end if

AD_ADMIN='Administrator'
AD_ADMIN_PASSWORD_FILE='/var/lib/samba/.eole-ad-dc'
AD_HOST_KEYTAB_FILE='/var/lib/samba/eole-ad-dc.keytab'

%if %%getVar('activer_ad_zones', 'non') == 'oui'
ACTIVER_AD_ZONES='oui'
AD_ZONES_DEFAUT='%%ad_zones_defaut'
AD_ZONES='%slurp
    %for %%variable_iter in %%ad_zones
%%variable_iter %slurp
    %end for
'
%else
ACTIVER_AD_ZONES='non'
AD_ZONES_DEFAUT='non'
AD_ZONES=''
%end if

ACTIVER_AD_HOMES_SHARE='%%activer_ad_homes_share'
ACTIVER_AD_PROFILES_SHARE='%%activer_ad_profiles_share'
AD_HOMES_SHARE_HOST_NAME='%%getVar("ad_homes_share_host", "")'
AD_PROFILES_SHARE_HOST_NAME='%%getVar("ad_profiles_share_host", "")'
AD_HOME_SHARE_PATH='%%getVar("ad_home_share_path","/home/adhomes")'
AD_PROFILE_SHARE_PATH='%%getVar("ad_profile_share_path","/home/adprofiles")'

AD_INSTANCE_LOCK_FILE='/var/lib/samba/.instance_ok'

%if %%getVar("ad_server_role", 'non') == 'controleur de domaine'
AD_BACKEND_STORE='%%ad_backend_store'
AD_PLAINTEXT_SECRETS='%%ad_plaintext_secrets'
%end if
NOM_DOMAINE_MACHINE='%%nom_domaine_machine'
%if %%mode_conteneur_actif == 'oui'
AD_SERVER_FULLNAME='%%ad_calc_dc_domainname'
%else
AD_SERVER_FULLNAME='%%ad_realm'
%end if
AD_TYPE='seth'
