<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.10">
  <variables>
    <variable name="var_size" type="number" description="Variable directory size" hidden="True">
      <value>1024</value>
    </variable>
    <variable name="add_tmp" type="boolean" description="Add a temporary directory" hidden="True"/>
    <variable name="var_tmp_size" type="number" description="Temporary directory size" hidden="True">
      <value>1024</value>
    </variable>
    <variable name="add_srv" type="boolean" description="Add a persistent directory" hidden="True"/>
    <variable name="srv_size" type="number" description="Persistent directory size" hidden="True">
      <value>1024</value>
    </variable>
    <variable name="add_swap" type="boolean" description="Add a SWAP partition" hidden="True"/>
    <variable name="swap_size" type="number" description="SWAP size" hidden="True">
      <value>512</value>
    </variable>
  </variables>
  <constraints>
    <condition name='disabled_if_in' source='machine.add_tmp'>
        <param>False</param>
        <target>machine.var_tmp_size</target>
        <target type="servicelist">add_tmp</target>
    </condition>
    <condition name='disabled_if_in' source='machine.add_srv'>
        <param>False</param>
        <target>machine.srv_size</target>
        <target type="servicelist">add_srv</target>
    </condition>
    <condition name='disabled_if_in' source='machine.add_swap'>
        <param>False</param>
        <target>machine.swap_size</target>
        <target type="servicelist">add_swap</target>
    </condition>
    <fill name="calc_value">
      <param type="variable">machine.var_size</param>
      <param type="variable" propertyerror="False">machine.var_tmp_size</param>
      <param type="variable" propertyerror="False">machine.srv_size</param>
      <param type="variable" propertyerror="False">machine.swap_size</param>
      <param type="number">16</param>
      <param name="operator">add</param>
      <target>machine.data_disk_size</target>
    </fill>
  </constraints>
</rougail>

