<?xml version="1.0" encoding="utf-8"?>

<creole>

    <files>
        <file filelist='ad_local' name='/var/lib/lxc/addc/rootfs/etc/samba/smb.conf' source='smb-addc.conf'/>
        <file filelist='ad_local' name='/var/lib/lxc/addc/rootfs/etc/eole/samba4-vars.conf' source='samba4-vars-addc.conf'/>
        <!-- copie du template fourni par eole-lxc-controller -->
        <file filelist='ad_local' name='/usr/share/eole/bastion/data/90-lxc_rules' mode='0755'/>
        <file filelist='ad_local' name="/var/lib/lxc/addc/config" source="addc.lxc.config"/>
        <file filelist='ad_local' name="/var/lib/lxc/addc/rootfs/etc/resolv.conf" source="addc.resolv.conf"/>
        <service servicelist='ad_local' method="restartonly">lxc-net</service>
        <file filelist='ad_local' name='/var/lib/lxc/addc/rootfs/etc/netplan/10-lxc.yaml' source='addc.10-lxc.yaml'/>
        <service servicelist='ad_local' method="restartonly">lxc</service>
    </files>

    <variables>
        <family name='openldap'>
            <variable name='ldap_sasl_auth_delegation' redefine='True'>
                <value>oui</value>
            </variable>
        </family>
	<family name='saslauthd'>
	    <variable name='sasl_ldap_reader' redefine='True'/>
        </family>
        <family name='EoleAD'>
            <variable name='ad_local_default_bridge_via_internal_ip' type='oui/non' mode='expert' description='Configurer la passerelle par défaut du conteneur addc via son ip interne'>
                <value>non</value>
            </variable>
        </family>
    </variables>

    <constraints>

        <condition name='disabled_if_in' source='ad_local'>
             <param>non</param>
             <target type='filelist'>ad_local</target>
             <target type='servicelist'>ad_local</target>
             <target>ad_local_default_bridge_via_internal_ip</target>
        </condition>

        <condition name='frozen_if_in' source='ad_local'>
            <param>oui</param>
            <target type='variable'>ad_server</target>
            <target type='variable'>ad_domain</target>
            <target type='variable'>ad_address</target>
            <target type='variable'>ad_rescue</target>
            <target type='variable'>ad_user</target>
            <target type='variable'>ad_container</target>
            <target type='variable'>ad_ldaps</target>
            <target type='variable'>sasl_ldap_reader</target>
        </condition>
        <fill name='calc_multi_condition' target='ad_server'>
            <param>oui</param>
            <param type='eole' name='condition_1'>ad_local</param>
            <param name='match'>addc</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='ad_address'>
            <param>oui</param>
            <param type='eole' name='condition_1'>ad_local</param>
            <param name='match'>192.0.2.2</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='ad_user'>
            <param>oui</param>
            <param type='eole' name='condition_1'>ad_local</param>
            <param name='match'>Administrator</param>
            <param name='default_mismatch'>Administrateur</param>
        </fill>

        <condition name='frozen_if_in' source='ad_local'>
            <param>non</param>
            <target type='variable'>activer_gpo_script</target>
            <target type='variable'>activer_workstation_manager</target>
        </condition>
        <fill name='auto_copy_val' target='activer_gpo_script'>
            <param type='eole'>ad_local</param>
        </fill>
        <fill name='auto_copy_val' target='activer_workstation_manager'>
            <param type='eole'>ad_local</param>
        </fill>

        <condition name='frozen_if_in' source='ad_local'>
            <param>oui</param>
            <target type='variable'>activer_ajout_hosts</target>
            <target type='variable'>adresse_ip_hosts</target>
            <target type='variable'>nom_long_hosts</target>
            <target type='variable'>nom_court_hosts</target>
        </condition>
        <fill name='auto_copy_val' target='activer_ajout_hosts'>
            <param type='eole'>ad_local</param>
        </fill>
        <fill name='calc_multi_condition' target='adresse_ip_hosts'>
            <param>oui</param>
            <param type='eole' name='condition_1'>ad_local</param>
            <param name='match' type='eole'>ad_address</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='nom_long_hosts'>
            <param>oui</param>
            <param type='eole' name='condition_1'>ad_local</param>
            <param name='match' type='eole'>ad_server_fullname</param>
            <param name='default_match'>None</param>
            <param name='default_mismatch'>None</param>
        </fill>
        <fill name='calc_multi_condition' target='nom_court_hosts'>
            <param>oui</param>
            <param type='eole' name='condition_1'>ad_local</param>
            <param name='match' type='eole'>ad_server</param>
            <param name='default_mismatch'>None</param>
        </fill>

        <auto name='auto_copy_val' target='sasl_ldap_auth_local'>
            <param type='eole'>ad_local</param>
        </auto>
        <fill name='calc_multi_condition' target='sasl_ldap_reader'>
            <param>oui</param>
            <param type='eole' name='condition_1'>ad_local</param>
            <param name='match'>eole-sasl</param>
	    <param name='mismatch' type='eole'>ad_user</param>
        </fill>

    </constraints>

    <help>
        <variable name='ad_local_default_bridge_via_internal_ip'>La passerelle par défaut doit passer par l'ip interne du conteneur ou bien l'ip publique du conteneur</variable>
    </help>

</creole>
<!-- vim: ts=4 sw=4 expandtab
-->
