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

<creole>

    <files>
        <!-- apache -->
        <file name='/etc/apache2/sites-available/workstation.conf' source='workstation.apache.conf' rm='True' filelist='workstation_apache' />
        <service method='apache' servicelist='workstation_apache'>workstation</service>
        <!-- nginx -->
		<service_access service='apache_nginx'>
			<port>80</port>
		</service_access>
    </files>
    <containers>
        <container name="domaine">
            <file name='/etc/nginx/sites-enabled/workstation_apache.conf' source='workstation.apache_nginx.conf' rm='True' filelist='workstation_nginx' />
            <file name='/etc/nginx/http.d/workstation.conf' source='workstation.nginx.conf' rm='True' mkdir='True' filelist='workstation_nginx' />
        </container>
    </containers>

    <variables>
        <family name='services'>
            <variable name='workstation_http_server' type='string' description='Détermine le serveur HTTP à utiliser'/>
        </family>
    </variables>

    <constraints>
        <auto name='calc_multi_condition' target='workstation_http_server'>
            <param>['non', 'oui']</param>
            <param type='eole' name='condition_1'>mode_conteneur_actif</param>
            <!-- activer_apache should be defined (cf. workaround in 29_genconfig.xml) -->
            <param type='eole' name='condition_2'>activer_apache</param>
            <param name='match'>apache</param>
            <param name='mismatch'>nginx</param>
        </auto>
        <condition name='disabled_if_not_in' source='workstation_http_server'>
            <param>apache</param>
            <target type='filelist'>workstation_apache</target>
            <target type='servicelist'>workstation_apache</target>
        </condition>
        <condition name='disabled_if_not_in' source='workstation_http_server'>
            <param>nginx</param>
            <target type='filelist'>workstation_nginx</target>
        </condition>
    </constraints>

    <help>
    </help>

</creole>

