Use bash for xvm-iscsi-config init script for gen-config.sh
[invirt/packages/xvm-iscsi-config.git] / debian / transform_iscsid.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/^node.startup = manual/node.startup = automatic/m;
11 # mako just generally doesn't deal well with lines that start with
12 # hashes, so we'll strip them
13 #
14 # And empty lines too, just for cleanliness
15 s/^#.*$//m;
16 print unless /^$/;
17
18 END {
19   print <<'EOF';
20 node.session.auth.authmethod = CHAP
21 node.session.auth.username = ${cfg.iscsi.username}
22 node.session.auth.password = ${cfg.iscsi.password}
23
24 discovery.sendtargets.auth.authmethod = CHAP
25 discovery.sendtargets.auth.username = ${cfg.iscsi.username}
26 discovery.sendtargets.auth.password = ${cfg.iscsi.password}
27 EOF
28 }