So now that I've upgraded to 1.4, I'm still having the same issue I was having back in 1.0 (though with better debugging output). I have the following lines:
#if $ip_address
network --bootproto static --ip $ip_address --netmask 255.255.0.0 --gateway 10.0.0.62 --nameserver 10.0.100.1 --onboot=true --noipv6 --device=eth0
#end if
which are very similar to some I've seen online (to see if ip_address is defined), so they should work, yet I get the following errors when I try to view the rendered kickstart (from the webUi):
# *** ERROR ***
#
# There is a templating error preventing this file from rendering correctly.
#
# This is most likely not due to a bug in Cobbler and is something you can fix.
#
# Look at the message below to see what things are causing problems.
#
# (1) Does the template file reference a $variable that is not defined?
# (2) is there a formatting error in a Cheetah directive?
# (3) Should dollar signs ($) be escaped that are not being escaped?
#
# Try fixing the problem and then investigate to see if this message goes
# away or changes.
#
#
# cannot find 'ip_address'
# File "/usr/lib/python2.5/site-packages/cobbler/templar.py", line 114, in render
# data_out = str(t)
#
# File "/usr/lib64/python2.5/site-packages/Cheetah/Template.py", line 982, in __str__
# def __str__(self): return getattr(self, mainMethName)()
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1231532768_64_25621.py", line 122, in respond
#
<pre>
MOD_PYTHON ERROR
ProcessId: 10225
Interpreter: 'linux-jared.militho.com'
ServerName: 'linux-jared.militho.com'
DocumentRoot: '/var/www/html'
URI: '/cblr/svc/op/ks/profile/Fedora10-x86_64'
Location: None
Directory: '/var/www/cobbler/svc/'
Filename: '/var/www/cobbler/svc/op'
PathInfo: '/ks/profile/Fedora10-x86_64'
Phase: 'PythonHandler'
Handler: 'services'
Traceback (most recent call last):
File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target
result = object(arg)
File "/var/www/cobbler/svc/services.py", line 98, in handler
return apache.HTTP_ERROR
AttributeError: 'module' object has no attribute 'HTTP_ERROR'
MODULE CACHE DETAILS
Accessed: Fri Jan 9 14:27:48 2009
Generation: 2
_mp_cb62af599b9ec7a553f07c92e369abb6 {
FileName: '/var/www/cobbler/svc/services.py'
Instance: 1
Generation: 1
Modified: Fri Dec 19 10:17:37 2008
Imported: Fri Jan 9 13:37:26 2009
}
</pre>
Sorry if this is a very simple syntax issue, but I'm new to cobbler (and never used cheetah). It seems to me though, that my install is broken. I had the same issues before I rebuilt 1.4 from srpms, so I don't think that's the issue. Thanks.
-Jared
Jared Hodge wrote:
So now that I’ve upgraded to 1.4, I’m still having the same issue I was having back in 1.0 (though with better debugging output). I have the following lines:
#if $ip_address
network --bootproto static --ip $ip_address --netmask 255.255.0.0 --gateway 10.0.0.62 --nameserver 10.0.100.1 --onboot=true --noipv6 --device=eth0
#end if
The new network configuration templates in 1.4 make this kind of configuration unneccessary. You can store the gateway and other information directly in Cobbler and it will template all of this out for you without you having to figure it out.
See /var/lib/cobbler/kickstarts/sample.ks for an example of how these snippets are used in a kickstart file, and you should be able to insert these directly into yours as they are used in the sample.
The static field is also storable in cobbler, so the whole thing has really become a lot easier.
With respect to the question of figuring out what variables are valid (suppose you don't want to do the above), this is also easier:
cobbler system dumpvars --name=foo
That will show you all the templating variables you can use in your kickstart.
For example, it looks like you want ip_address_eth0.
Really though, the cobbler generated way with the new snippets should be much easier, as you can just store that info all in Cobbler and it will generate the network lines.
This also supports bonding and VLAN setup, for those that want to do this:
https://fedorahosted.org/cobbler/wiki/AdvancedNetworking
--Michael
which are very similar to some I’ve seen online (to see if ip_address is defined), so they should work, yet I get the following errors when I try to view the rendered kickstart (from the webUi):
# *** ERROR ***
#
# There is a templating error preventing this file from rendering correctly.
#
# This is most likely not due to a bug in Cobbler and is something you can fix.
#
# Look at the message below to see what things are causing problems.
#
# (1) Does the template file reference a $variable that is not defined?
# (2) is there a formatting error in a Cheetah directive?
# (3) Should dollar signs ($) be escaped that are not being escaped?
#
# Try fixing the problem and then investigate to see if this message goes
# away or changes.
#
#
# cannot find 'ip_address'
# File "/usr/lib/python2.5/site-packages/cobbler/templar.py", line 114, in render
# data_out = str(t)
#
# File "/usr/lib64/python2.5/site-packages/Cheetah/Template.py", line 982, in __str__
# def __str__(self): return getattr(self, mainMethName)()
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1231532768_64_25621.py", line 122, in respond
#
<pre> MOD_PYTHON ERROR ProcessId: 10225 Interpreter: 'linux-jared.militho.com' ServerName: 'linux-jared.militho.com' DocumentRoot: '/var/www/html' URI: '/cblr/svc/op/ks/profile/Fedora10-x86_64' Location: None Directory: '/var/www/cobbler/svc/' Filename: '/var/www/cobbler/svc/op' PathInfo: '/ks/profile/Fedora10-x86_64' Phase: 'PythonHandler' Handler: 'services' Traceback (most recent call last): File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target result = _execute_target(config, req, object, arg) File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target result = object(arg) File "/var/www/cobbler/svc/services.py", line 98, in handler return apache.HTTP_ERROR AttributeError: 'module' object has no attribute 'HTTP_ERROR' MODULE CACHE DETAILS Accessed: Fri Jan 9 14:27:48 2009 Generation: 2 _mp_cb62af599b9ec7a553f07c92e369abb6 { FileName: '/var/www/cobbler/svc/services.py' Instance: 1 Generation: 1 Modified: Fri Dec 19 10:17:37 2008 Imported: Fri Jan 9 13:37:26 2009 } </pre>
Sorry if this is a very simple syntax issue, but I’m new to cobbler (and never used cheetah). It seems to me though, that my install is broken. I had the same issues before I rebuilt 1.4 from srpms, so I don’t think that’s the issue. Thanks.
-Jared
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
When I try: %cobbler system dumpvars --name=Fedora10-x86_64 object not found
But I know it's got that system because when I: %cobbler system list --name=Fedora10-x86_64
I get a couple of systems listed.
About the Snippets, I originally intended to use them, but had similar problems to this. I'm guessing that when I get this problem fixed the snippets will start working also. My understanding is that the statement I listed should be parsed correctly regardless if ip_address is defined or not (with different results if it is or isn't defined). I tried ip_address_eth0 just to check, but that didn't fix the problem.
It's almost like the link with cheetah isn't working correctly, though I've got the latest version of cheetah installed (from what I can find on the web). Any ideas? Thanks.
-Jared
-----Original Message----- From: cobbler-bounces@lists.fedorahosted.org [mailto:cobbler-bounces@lists.fedorahosted.org] On Behalf Of Michael DeHaan Sent: Friday, January 09, 2009 2:43 PM To: cobbler mailing list Subject: Re: Kickstart template variables not working
Jared Hodge wrote:
So now that I've upgraded to 1.4, I'm still having the same issue I was having back in 1.0 (though with better debugging output). I have the following lines:
#if $ip_address
network --bootproto static --ip $ip_address --netmask 255.255.0.0 --gateway 10.0.0.62 --nameserver 10.0.100.1 --onboot=true --noipv6 --device=eth0
#end if
The new network configuration templates in 1.4 make this kind of configuration unneccessary. You can store the gateway and other information directly in Cobbler and it will template all of this out for
you without you having to figure it out.
See /var/lib/cobbler/kickstarts/sample.ks for an example of how these snippets are used in a kickstart file, and you should be able to insert these directly into yours as they are used in the sample.
The static field is also storable in cobbler, so the whole thing has really become a lot easier.
With respect to the question of figuring out what variables are valid (suppose you don't want to do the above), this is also easier:
cobbler system dumpvars --name=foo
That will show you all the templating variables you can use in your kickstart.
For example, it looks like you want ip_address_eth0.
Really though, the cobbler generated way with the new snippets should be
much easier, as you can just store that info all in Cobbler and it will generate the network lines.
This also supports bonding and VLAN setup, for those that want to do this:
https://fedorahosted.org/cobbler/wiki/AdvancedNetworking
--Michael
which are very similar to some I've seen online (to see if ip_address is defined), so they should work, yet I get the following errors when I try to view the rendered kickstart (from the webUi):
# *** ERROR ***
#
# There is a templating error preventing this file from rendering correctly.
#
# This is most likely not due to a bug in Cobbler and is something you
can fix.
#
# Look at the message below to see what things are causing problems.
#
# (1) Does the template file reference a $variable that is not
defined?
# (2) is there a formatting error in a Cheetah directive?
# (3) Should dollar signs ($) be escaped that are not being escaped?
#
# Try fixing the problem and then investigate to see if this message
goes
# away or changes.
#
#
# cannot find 'ip_address'
# File "/usr/lib/python2.5/site-packages/cobbler/templar.py", line 114, in render
# data_out = str(t)
#
# File "/usr/lib64/python2.5/site-packages/Cheetah/Template.py", line 982, in __str__
# def __str__(self): return getattr(self, mainMethName)()
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1231532768_64_25621.py", line 122, in respond
#
<pre> MOD_PYTHON ERROR ProcessId: 10225 Interpreter: 'linux-jared.militho.com' ServerName: 'linux-jared.militho.com' DocumentRoot: '/var/www/html' URI: '/cblr/svc/op/ks/profile/Fedora10-x86_64' Location: None Directory: '/var/www/cobbler/svc/' Filename: '/var/www/cobbler/svc/op' PathInfo: '/ks/profile/Fedora10-x86_64' Phase: 'PythonHandler' Handler: 'services' Traceback (most recent call last): File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line
1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line
1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line
1128, in _execute_target
result = object(arg)
File "/var/www/cobbler/svc/services.py", line 98, in handler
return apache.HTTP_ERROR
AttributeError: 'module' object has no attribute 'HTTP_ERROR'
MODULE CACHE DETAILS
Accessed: Fri Jan 9 14:27:48 2009
Generation: 2
_mp_cb62af599b9ec7a553f07c92e369abb6 {
FileName: '/var/www/cobbler/svc/services.py'
Instance: 1
Generation: 1
Modified: Fri Dec 19 10:17:37 2008
Imported: Fri Jan 9 13:37:26 2009
}
</pre>
Sorry if this is a very simple syntax issue, but I'm new to cobbler (and never used cheetah). It seems to me though, that my install is broken. I had the same issues before I rebuilt 1.4 from srpms, so I don't think that's the issue. Thanks.
-Jared
------------------------------------------------------------------------
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
_______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
Jared Hodge wrote:
When I try: %cobbler system dumpvars --name=Fedora10-x86_64 object not found
But I know it's got that system because when I: %cobbler system list --name=Fedora10-x86_64
I get a couple of systems listed.
That's not a system, that's a profile.
# cobbler profile dumpvars --name=foo
.. will show you profiles.
If you have an IP defined, that's a system record.
# cobbler system list
About the Snippets, I originally intended to use them, but had similar problems to this. I'm guessing that when I get this problem fixed the snippets will start working also. My understanding is that the statement I listed should be parsed correctly regardless if ip_address is defined or not (with different results if it is or isn't defined). I tried ip_address_eth0 just to check, but that didn't fix the problem.
The proper way to check for a variable being defined in Cheetah is really something like
#if $getVar("foo","") != "" do something #end if
It's almost like the link with cheetah isn't working correctly, though I've got the latest version of cheetah installed (from what I can find on the web). Any ideas? Thanks.
It's working perfectly, it's just that as you do more advanced things with Cheetah, you have to know more about Cheetah. This is exactly why we have the (new) network snippets in 1.4 (not around previously) to auto build this out for you -- for the vast majority of users, they don't need to figure out how to do this on their own -- it now just does what they mean based on how things are defined in Cobbler, no cheetah writing required for network configuration.
In fact, snippets in Cobbler 1.4 are now 100% cheetah, where before they were included ahead of the Cheetah step and then evaluated.
Things have changed a lot since 1.0, that was 6 months ago, so please try things again. If you're editing network configurations on systems, I highly recommend starting with the web app as that makes things easier to understand, at least at first, and will make it clear what fields need to be set.
-Jared
-----Original Message----- From: cobbler-bounces@lists.fedorahosted.org [mailto:cobbler-bounces@lists.fedorahosted.org] On Behalf Of Michael DeHaan Sent: Friday, January 09, 2009 2:43 PM To: cobbler mailing list Subject: Re: Kickstart template variables not working
Jared Hodge wrote:
So now that I've upgraded to 1.4, I'm still having the same issue I was having back in 1.0 (though with better debugging output). I have the following lines:
#if $ip_address
network --bootproto static --ip $ip_address --netmask 255.255.0.0 --gateway 10.0.0.62 --nameserver 10.0.100.1 --onboot=true --noipv6 --device=eth0
#end if
The new network configuration templates in 1.4 make this kind of configuration unneccessary. You can store the gateway and other information directly in Cobbler and it will template all of this out for
you without you having to figure it out.
See /var/lib/cobbler/kickstarts/sample.ks for an example of how these snippets are used in a kickstart file, and you should be able to insert these directly into yours as they are used in the sample.
The static field is also storable in cobbler, so the whole thing has really become a lot easier.
With respect to the question of figuring out what variables are valid (suppose you don't want to do the above), this is also easier:
cobbler system dumpvars --name=foo
That will show you all the templating variables you can use in your kickstart.
For example, it looks like you want ip_address_eth0.
Really though, the cobbler generated way with the new snippets should be
much easier, as you can just store that info all in Cobbler and it will generate the network lines.
This also supports bonding and VLAN setup, for those that want to do this:
https://fedorahosted.org/cobbler/wiki/AdvancedNetworking
--Michael
which are very similar to some I've seen online (to see if ip_address is defined), so they should work, yet I get the following errors when I try to view the rendered kickstart (from the webUi):
# *** ERROR ***
#
# There is a templating error preventing this file from rendering correctly.
#
# This is most likely not due to a bug in Cobbler and is something you
can fix.
#
# Look at the message below to see what things are causing problems.
#
# (1) Does the template file reference a $variable that is not
defined?
# (2) is there a formatting error in a Cheetah directive?
# (3) Should dollar signs ($) be escaped that are not being escaped?
#
# Try fixing the problem and then investigate to see if this message
goes
# away or changes.
#
#
# cannot find 'ip_address'
# File "/usr/lib/python2.5/site-packages/cobbler/templar.py", line 114, in render
# data_out = str(t)
#
# File "/usr/lib64/python2.5/site-packages/Cheetah/Template.py", line 982, in __str__
# def __str__(self): return getattr(self, mainMethName)()
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1231532768_64_25621.py", line 122, in respond
#
<pre> MOD_PYTHON ERROR ProcessId: 10225 Interpreter: 'linux-jared.militho.com' ServerName: 'linux-jared.militho.com' DocumentRoot: '/var/www/html' URI: '/cblr/svc/op/ks/profile/Fedora10-x86_64' Location: None Directory: '/var/www/cobbler/svc/' Filename: '/var/www/cobbler/svc/op' PathInfo: '/ks/profile/Fedora10-x86_64' Phase: 'PythonHandler' Handler: 'services' Traceback (most recent call last): File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line
1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line
1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line
1128, in _execute_target
result = object(arg)
File "/var/www/cobbler/svc/services.py", line 98, in handler
return apache.HTTP_ERROR
AttributeError: 'module' object has no attribute 'HTTP_ERROR'
MODULE CACHE DETAILS
Accessed: Fri Jan 9 14:27:48 2009
Generation: 2
_mp_cb62af599b9ec7a553f07c92e369abb6 {
FileName: '/var/www/cobbler/svc/services.py'
Instance: 1
Generation: 1
Modified: Fri Dec 19 10:17:37 2008
Imported: Fri Jan 9 13:37:26 2009
}
</pre>
Sorry if this is a very simple syntax issue, but I'm new to cobbler (and never used cheetah). It seems to me though, that my install is broken. I had the same issues before I rebuilt 1.4 from srpms, so I don't think that's the issue. Thanks.
-Jared
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler _______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
cobbler@lists.fedorahosted.org