blob: fd6048e843bf39b6cab2e2fbcdc6d7ea293be711 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
.. -*- 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" perms="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>
|