<p dir="ltr">On Nov 19, 2012 12:15 PM, "Zack Perry" <<a href="mailto:zack.perry@sbcglobal.net">zack.perry@sbcglobal.net</a>> wrote:<br>
><br>
> cobbler: 2.4.0 from epel-testing<br>
> server: SL 6.3 64bit<br>
> target: Ubuntu 12.04.1 LTS server<br>
><br>
> Out of curiosity, I tried to use the jinja2 for a template file in<br>
> /srv/cobbler/sources.j2 as follows:<br>
><br>
> #template=jinja2<br>
> #<br>
><br>
> # See <a href="http://help.ubuntu.com/community/UpgradeNotes">http://help.ubuntu.com/community/UpgradeNotes</a> for how to upgrade to<br>
> # newer versions of the distribution.<br>
> deb <a href="http://us.archive.ubuntu.com/ubuntu/">http://us.archive.ubuntu.com/ubuntu/</a> {{ os_version }} main restricted<br>
> deb-src <a href="http://us.archive.ubuntu.com/ubuntu/">http://us.archive.ubuntu.com/ubuntu/</a> {{ os_version }} main restricted<br>
> [...]<br>
><br>
> In the system object, I have:<br>
><br>
> Template Files : {'/srv/cobbler/sources.j2': '/etc/apt/sources.list'}<br>
><br>
> The intention is to replace all lines in the /etc/apt/sources.list<br>
> that have the local repo URL with the official ones. Note, this<br>
> is done just for experiment. At work, we always use our own repo<br>
> mirror.<br>
><br>
> But, even with python-jinja2 installed on the cobbler server,<br>
> I have been getting the following in the installed services.list:<br>
><br>
> # ERROR: JINJA2 NOT AVAILABLE. Maybe you need to install python-jinja2?<br>
><br>
> But, as evident from below, the cobbler host has it!<br>
><br>
> [root@cobbler ~]# rpm -qi python-jinja2<br>
> Name : python-jinja2 Relocations: (not relocatable)<br>
> Version : 2.2.1 Vendor: Dag Apt Repository, <a href="http://dag.wieers.com/apt/">http://dag.wieers.com/apt/</a><br>
> Release : 1.el6.rf Build Date: Fri 23 Mar 2012 05:33:19 AM PDT<br>
> Install Date: Mon 19 Nov 2012 09:34:01 AM PST Build Host: <a href="http://lisse.hasselt.wieers.com">lisse.hasselt.wieers.com</a><br>
> Group : Development/Languages Source RPM: python-jinja2-2.2.1-1.el6.rf.src.rpm<br>
> Size : 2379618 License: BSD<br>
> Signature : DSA/SHA1, Tue 03 Apr 2012 06:26:16 AM PDT, Key ID a20e52146b8d79e6<br>
> Packager : Dag Wieers <<a href="mailto:dag@wieers.com">dag@wieers.com</a>><br>
> URL : <a href="http://jinja.pocoo.org/">http://jinja.pocoo.org/</a><br>
> Summary : General purpose template engine<br>
> Description :<br>
> Jinja2 is a template engine written in pure Python. It provides a<br>
> Django inspired non-XML syntax but supports inline expressions and an<br>
> optional sandboxed environment.<br>
><br>
> If you have any exposure to other text-based template languages, such<br>
> as Smarty or Django, you should feel right at home with Jinja2. It's<br>
> both designer and developer friendly by sticking to Python's<br>
> principles and adding functionality useful for templating<br>
> environments.<br>
><br>
> Is it true that the jinja2 support is only available to snippets?<br>
> That's my impression from reading /etc/cobbler/settings so far.<br>
><br>
> Regards,<br>
><br>
> -- Zack</p>
<p dir="ltr">Have you bounced cobblerd since installing jinja2? Its presence is only checked for when the daemon starts.</p>