<!-- A demo configuration file for configuring a changeset -->

<config xmlns:xi="http://www.w3.org/2001/XInclude">

<!--
  A global change namespace, used to define commonly used items.
  You can use this to define variables that can be substituted in
  common places below. This provides a mechanism for templating changes.

  All values are strings. If you need to convert to a python number,
  do this in the python code, via int(), float() etc.
  
-->
<!-- include change templates I want to use -->
<xi:include href="netapp-create-volume.change-template.xml"/>

<!-- define my provisioner -->
<provisioner
  name='netapp_provisioner'
  type='MultiConnectingProvisioner'
  command_timeout='30'>

  <command>ssh -i /home/daedalus/.ssh/configulator -o BatchMode=yes -o ServerAliveInterval=0 root@%(device.ipaddress)s "%(command.send)s"</command>

<!--
  <command>/bin/bash -c "echo %(command.send)s >> /home/daedalus/testing_output"</command>
-->

</provisioner>

<!-- define some devices I want to provision to -->
<device name='wibble'>
  <ipaddress>10.232.8.71</ipaddress>
</device>

<device name='localhost'>
  <ipaddress>127.0.0.1</ipaddress>
</device>

<!-- Define iterators used by changes -->
<iterator name="primary_volumes">
  <dict>
    <entry name="volname">prim_root</entry>
    <entry name="volaggr">aggr01</entry>
    <entry name="volsize">25m</entry>
  </dict>

  <dict>
    <entry name="volname">prim_vol01</entry>
    <entry name="volaggr">aggr01</entry>
    <entry name="volsize">25m</entry>
  </dict>

</iterator>

<iterator name="secondary_volumes">
  <dict>
    <entry name="volname">sec_root</entry>
    <entry name="volaggr">aggr01</entry>
    <entry name="volsize">25m</entry>
  </dict>

  <dict>
    <entry name="volname">sec_vol01</entry>
    <entry name="volaggr">aggr01</entry>
    <entry name="volsize">25m</entry>
  </dict>

</iterator>

<!-- Set up the change list I want to apply -->
<change name="create_primary_volumes" template='create_netapp_volume' iterator='primary_volumes'>
  <target>wibble</target>
</change>

<change name="create_secondary_volumes" template='create_netapp_volume' iterator='secondary_volumes'>
  <target>wibble</target>
  <depends on='create_primary_volumes'/>
</change>

</config>