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