Added cleans for the generated mako templates
[invirt/packages/xvm-munin-config.git] / debian / transform_munin-node.conf.xvm.mako
1 #!/usr/bin/perl -n
2 BEGIN {
3   print <<'EOF';
4 <%
5 from invirt.config import structs as cfg
6 %>
7 EOF
8 }
9
10 s/^user root/user munin/m;
11 s/^group root/group munin/m;
12 s/^node.startup = manual/node.startup = automatic/m;
13 # mako just generally doesn't deal well with lines that start with
14 # hashes, so we'll strip them
15 #
16 # And empty lines too, just for cleanliness
17 s/^#.*$//m;
18 print unless /^$/;
19
20 END {
21   print <<'EOF';
22 % for host in cfg.monitoring:
23 allow ^${host.ip.replace('.', '\.')}$
24 % endfor
25 EOF
26 }