From b0db3b94774fb1f46d84f0455c0f129f39793095 Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Thu, 14 Aug 2008 15:11:14 -0400 Subject: [PATCH 1/1] generate config files using mako svn path=/trunk/packages/sipb-xen-console/; revision=888 --- debian/changelog | 6 ++++++ debian/sipb-xen-console.init | 28 +++++++--------------------- files/etc/conserver/invirt-hosts.cf.mako | 4 ++++ files/etc/issue.net.no_tkt.mako | 4 ++++ files/etc/remctl/acl/invirt-console | 4 ++++ 5 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 files/etc/conserver/invirt-hosts.cf.mako create mode 100644 files/etc/issue.net.no_tkt.mako diff --git a/debian/changelog b/debian/changelog index 9619a52..ea65b94 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sipb-xen-console (7.8) unstable; urgency=low + + * generate config files using mako + + -- Yang Zhang Thu, 14 Aug 2008 15:10:50 -0400 + sipb-xen-console (7.7) unstable; urgency=low * sipb_xen_database -> invirt.database diff --git a/debian/sipb-xen-console.init b/debian/sipb-xen-console.init index 3986a84..026eb1e 100755 --- a/debian/sipb-xen-console.init +++ b/debian/sipb-xen-console.init @@ -37,27 +37,13 @@ SCRIPTNAME=/etc/init.d/$NAME gen_config() { - { - for i in $(invirt-getconf --ls hosts); do - local hostname=$(invirt-getconf hosts.$i.hostname) - echo "#include /etc/conserver/conf.d/$hostname" - done - } > /etc/conserver/invirt-hosts.cf - local realm=$(invirt-getconf authn.0.realm) - { - for i in $(invirt-getconf --ls hosts); do - local hostname=$(invirt-getconf hosts.$i.hostname) - echo "host/$hostname@$realm" - done - } > /etc/remctl/acl/invirt-console - - mako-render /etc/nss-pgsql.conf.mako > /etc/nss-pgsql.conf - - fmt > /etc/issue.net.no_tkt << EOF -You must login to the $(invirt-getconf console.hostname) console server using -Kerberos tickets, but your ssh client did not pass a valid ticket to the -console server. -EOF + for i in /etc/conserver/invirt-hosts.cf \ + /etc/remctl/acl/invirt-console \ + /etc/issue.net.no_tkt \ + /etc/nss-pgsql.conf \ + ; do + mako-render $i.mako > $i + done } # diff --git a/files/etc/conserver/invirt-hosts.cf.mako b/files/etc/conserver/invirt-hosts.cf.mako new file mode 100644 index 0000000..3ffe807 --- /dev/null +++ b/files/etc/conserver/invirt-hosts.cf.mako @@ -0,0 +1,4 @@ +<% from invirt.config import structs as cfg %>\ +% for h in cfg.hosts: +#include /etc/conserver/conf.d/${h.hostname} +% endfor diff --git a/files/etc/issue.net.no_tkt.mako b/files/etc/issue.net.no_tkt.mako new file mode 100644 index 0000000..054a32d --- /dev/null +++ b/files/etc/issue.net.no_tkt.mako @@ -0,0 +1,4 @@ +<% from invirt.config import structs as cfg %>\ +You must login to the ${cfg.console.hostname} console server using +Kerberos tickets, but your ssh client did not pass a valid ticket to the +console server. diff --git a/files/etc/remctl/acl/invirt-console b/files/etc/remctl/acl/invirt-console index e69de29..f2fffe3 100644 --- a/files/etc/remctl/acl/invirt-console +++ b/files/etc/remctl/acl/invirt-console @@ -0,0 +1,4 @@ +<% from invirt.config import structs as cfg %>\ +% for h in cfg.hosts: +host/${h.hostname}@${cfg.authn[0].realm} +% endfor -- 1.7.9.5