<?xml version="1.0" encoding="utf-8"?>
<creole>
    <files>
        <!--<file filelist='onenode' name='/etc/onenode/qemu.conf' rm='True' mkdir='True'/-->
        <service servicelist="hapy-master">onenode</service>
        <service servicelist="hapy-node">onenodestart</service>
        <service servicelist="hapy-node">onenodestop</service>
    </files>
    <variables>
        <family name='general'>
            <variable name='nombre_interfaces' redefine='True'/>
        </family>

        <family name='Services'>
            <variable name='activer_onenode' type='oui/non' description="Activer l'hyperviseur" mode='expert'>
                <value>oui</value>
            </variable>
            <variable name='test_local_orchestrator' type='oui/non' description="L'orchestrateur est local"/>
        </family>
        <family name='Virtualisation' icon='cloud'>
            <variable name='one_node_name' type='hostname' description="Nom du nœud OpenNebula" mode='expert'/>
            <variable name='one_master' type='hostname_strict' description="Nom de l'orchestrateur" mandatory='True' mode='basic'/>
            <variable name='one_master_ip' type='ip' description="Adresse IP de l'orchestrateur" mandatory='True' mode='basic'/>
        </family>
        <separators>
            <separator name='one_master'>Configuration de l'hyperviseur</separator>
        </separators>
    </variables>

    <constraints>
        <check name="valid_enum" target="nombre_interfaces">
            <param>['2','3','4','5']</param>
        </check>
        <condition name='disabled_if_in' source='activer_onenode'>
            <param>non</param>
            <target type='variable'>one_master</target>
            <target type='variable'>one_master_ip</target>
        </condition>
        <condition name='disabled_if_in' source='test_local_orchestrator'>
            <param>non</param>
            <target type='servicelist'>hapy-master</target>
        </condition>
        <condition name='disabled_if_in' source='test_local_orchestrator'>
            <param>oui</param>
            <target type='servicelist'>hapy-node</target>
        </condition>
        <condition name='frozen_if_in' source='test_local_orchestrator'>
            <param>oui</param>
            <target type='variable'>one_master</target>
            <target type='variable'>one_master_ip</target>
        </condition>
        <auto name='calc_multi_condition' target='test_local_orchestrator'>
            <param>oui</param>
            <param type='eole' name='condition_1' optional='True'>activer_oned</param>
            <param name='condition_2'>non</param>
            <param name="operator">OR</param>
        </auto>
        <fill name='calc_multi_condition' target='one_master'>
            <param>oui</param>
            <param type='eole' name='condition_1'>test_local_orchestrator</param>
            <param type='eole' name='match'>nom_machine</param>
            <param name='mismatch'>None</param>
            <param name='eval_mismatch'>True</param>
        </fill>
        <fill name='calc_multi_condition' target='one_master_ip'>
            <param>oui</param>
            <param type='eole' name='condition_1'>test_local_orchestrator</param>
            <param type='eole' name='match'>adresse_ip_eth0</param>
            <param name='default_match'>None</param>
            <param name='mismatch'>None</param>
            <param name='eval_mismatch'>True</param>
        </fill>
        <fill name='calc_val' target='one_node_name'>
            <param type='eole'>nom_machine</param>
        </fill>
    </constraints>
    <help>
    </help>
</creole>
