.. -*- mode: rst -*-

=========================
 Basic Cheetah Templates
=========================

This simple example demonstrates basic usage of Cheetah templates.

``/var/lib/bcfg2/Cfg/foo/foo.cheetah``

.. code-block:: none

    Hostname is $self.metadata.hostname
    Filename is $self.path
    Template is $self.source_path
    Groups:
    #for $group in $self.metadata.groups:
     * $group
    #end for
    Categories:
    #for $category in $self.metadata.categories:
     * $category -- $self.metadata.categories[$category]
    #end for

    Probes:
    #for $probe in $self.metadata.Probes:
     * $probe -- $self.metadata.Probes[$probe]
    #end for

Output
======

.. code-block:: xml

    <Path type="file" name="/foo" owner="root" mode="0644" group="root">
    Hostname is topaz.mcs.anl.gov
    Filename is /foo
    Template is /var/lib/bcfg2/Cfg/foo/foo.cheetah
    Groups:
     * desktop
     * mcs-base
     * ypbound
     * workstation
     * xserver
     * debian-sarge
     * debian
     * a
    Categories:
     * test -- a

    Probes:
     * os -- debian
    </Path>
