Hi
We are looking at a migration from standalone cobbler and going to spacewalk. Currently spacewalk just requires 'cobbler' but on a fresh install you get 2.0.3 and i have actually upgraded this to 2.0.4 to see if the error is still there and it is.
Basically a number of our snippets dont render out they are just left with $SNIPPET('name') in the rendered out ks and yet these work fine on 1.6.5 - Is there any difference in how cheetah renders stuff out in the versions?
An example of a snippet that does not work is
#set root_password = $getVar("role"," ") #if $root_password == "XXX" # Set the root pwd to be for XXX rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #elif $root_password == "XXX" # Set the root pwd to be for XXX rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #else # Set the XXX root pwd rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #end if
now i can make this one work with #raw's however we have some rather more complicated ones that might be more tricky to fix like that.
any clues on why they fail?
thanks
On Thu, 2010-05-06 at 09:20 +0100, Tom Brown wrote:
Hi
We are looking at a migration from standalone cobbler and going to spacewalk. Currently spacewalk just requires 'cobbler' but on a fresh install you get 2.0.3 and i have actually upgraded this to 2.0.4 to see if the error is still there and it is.
Basically a number of our snippets dont render out they are just left with $SNIPPET('name') in the rendered out ks and yet these work fine on 1.6.5 - Is there any difference in how cheetah renders stuff out in the versions?
An example of a snippet that does not work is
#set root_password = $getVar("role"," ") #if $root_password == "XXX" # Set the root pwd to be for XXX rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #elif $root_password == "XXX" # Set the root pwd to be for XXX rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #else # Set the XXX root pwd rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #end if
now i can make this one work with #raw's however we have some rather more complicated ones that might be more tricky to fix like that.
any clues on why they fail?
I have no problem when rendering this snippet.
Running cobbler-2.0.3.1-3 here.
Léon
strange - as it happened on 2.0.3 and 2.0.4 for me. What OS are you on? I am on fresh CentOS-5.4 but cobbler was a dependency of spacewalk so i will try standalone 2.0 again
OK - seems to happen to me on 2.0.3
I validate the ks
# cobbler validateks -- snip -- returned: 0 Potential templating errors: Unknown variable found at line 29, column 1: '$SNIPPET('set_root_password')'
The only variable being set in there is
#set root_password = $getVar("rootpwd","")
And
# cobbler system dumpvars --name=vmtest.xxx.xxx.xxx.xxx | grep rootpwd ks_meta : tree=http://@@http_server@@/cblr/links/CentOS-5.4-x86_64 rootpwd=pqa mgmt_parameters : {'from_cobbler': 1, 'tree': 'http://@@http_server@@/cblr/links/CentOS-5.4-x86_64', 'rootpwd': 'pqa'}
So i dont see why this is failing? - Anyone got any clues or where else i could look?
thanks
On 6 May 2010 14:54, Tom Brown tom@ng23.net wrote:
OK - seems to happen to me on 2.0.3
I validate the ks
# cobbler validateks -- snip -- returned: 0 Potential templating errors: Unknown variable found at line 29, column 1: '$SNIPPET('set_root_password')'
The only variable being set in there is
#set root_password = $getVar("rootpwd","")
And
# cobbler system dumpvars --name=vmtest.xxx.xxx.xxx.xxx | grep rootpwd ks_meta : tree=http://@@http_server@@/cblr/links/CentOS-5.4-x86_64 rootpwd=pqa mgmt_parameters : {'from_cobbler': 1, 'tree': 'http://@@http_server@@/cblr/links/CentOS-5.4-x86_64', 'rootpwd': 'pqa'}
So i dont see why this is failing? - Anyone got any clues or where else i could look?
oh and on a 1.6.5 the _same_ ks's and _same_ snippets give me
# cobbler validateks *** all kickstarts seem to be ok ***
I have found if you backquote all $ in snippets files things work again.
ie.
set root_password = $getVar("rootpwd","")
-----Original Message----- From: cobbler-bounces@lists.fedorahosted.org [mailto:cobbler-bounces@lists.fedorahosted.org] On Behalf Of Tom Brown Sent: Thursday, May 06, 2010 9:56 AM To: cobbler mailing list Subject: Re: Snippet error in 2.x - No issues in 1.6.x
On 6 May 2010 14:54, Tom Brown tom@ng23.net wrote:
OK - seems to happen to me on 2.0.3
I validate the ks
# cobbler validateks -- snip -- returned: 0 Potential templating errors: Unknown variable found at line 29, column 1: '$SNIPPET('set_root_password')'
The only variable being set in there is
#set root_password = $getVar("rootpwd","")
And
# cobbler system dumpvars --name=vmtest.xxx.xxx.xxx.xxx | grep rootpwd ks_meta : tree=http://@@http_server@@/cblr/links/CentOS-5.4-x86_64 rootpwd=pqa mgmt_parameters : {'from_cobbler': 1, 'tree': 'http://@@http_server@@/cblr/links/CentOS-5.4-x86_64', 'rootpwd': 'pqa'}
So i dont see why this is failing? - Anyone got any clues or where else i could look?
oh and on a 1.6.5 the _same_ ks's and _same_ snippets give me
# cobbler validateks *** all kickstarts seem to be ok *** _______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
On 5/6/2010 3:20 AM, Tom Brown wrote:
Hi
We are looking at a migration from standalone cobbler and going to spacewalk. Currently spacewalk just requires 'cobbler' but on a fresh install you get 2.0.3 and i have actually upgraded this to 2.0.4 to see if the error is still there and it is.
Basically a number of our snippets dont render out they are just left with $SNIPPET('name') in the rendered out ks and yet these work fine on 1.6.5 - Is there any difference in how cheetah renders stuff out in the versions?
An example of a snippet that does not work is
#set root_password = $getVar("role"," ") #if $root_password == "XXX" # Set the root pwd to be for XXX rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #elif $root_password == "XXX" # Set the root pwd to be for XXX rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #else # Set the XXX root pwd rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #end if
now i can make this one work with #raw's however we have some rather more complicated ones that might be more tricky to fix like that.
any clues on why they fail?
thanks _______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
The problem you're encountering is due to a '$' appearing in your password hashes. With version 2.0.3, snippets are now included via Cheetah, whereas before, cobbler itself was replacing them with the appropriate file. The net result is that you need to use #raw & #end raw tags around your password hashes (ssh keys, etc). Unfortunately, there is a bug in cobbler whereby, when these snippets fail to parse, the original 'snippet' line is all that remains in the parsed kickstart, rather than any sort of error message being included, which is what happens for parsing errors in the main kickstart file.
See these threads for previous discussion of this issue: https://fedorahosted.org/pipermail/cobbler-devel/2010-March/001506.html https://fedorahosted.org/pipermail/cobbler-devel/2010-February/001488.html
I just created a ticket for the issue: https://fedorahosted.org/cobbler/ticket/587
The problem you're encountering is due to a '$' appearing in your password hashes. With version 2.0.3, snippets are now included via Cheetah, whereas before, cobbler itself was replacing them with the appropriate file. The net result is that you need to use #raw & #end raw tags around your password hashes (ssh keys, etc). Unfortunately, there is a bug in cobbler whereby, when these snippets fail to parse, the original 'snippet' line is all that remains in the parsed kickstart, rather than any sort of error message being included, which is what happens for parsing errors in the main kickstart file.
See these threads for previous discussion of this issue: https://fedorahosted.org/pipermail/cobbler-devel/2010-March/001506.html https://fedorahosted.org/pipermail/cobbler-devel/2010-February/001488.html
I just created a ticket for the issue: https://fedorahosted.org/cobbler/ticket/587
thanks - although i am not 100% sure that is the issue as post_install_network_config was one of the ones not rendering out as was a home grown snippet that added a bunch of users but the whole snippet was encapsulated in a #raw #end raw and it still failed.
i'd like to know if there is any better way to debug this
thanks
On Thu, May 6, 2010 at 5:55 PM, Tom Brown tom@ng23.net wrote:
thanks - although i am not 100% sure that is the issue as post_install_network_config was one of the ones not rendering out as was a home grown snippet that added a bunch of users but the whole snippet was encapsulated in a #raw #end raw and it still failed.
i'd like to know if there is any better way to debug this
thanks
There were some default cobbler that went out missing escapes for $ characters, post_install_network_config was one of them IIRC. See if adding the escapes helps, you can look at the post snippets in cobbler git for comparison if need be.
Cheers,
Devan
On Thu, May 6, 2010 at 10:26 AM, Benjamin Riggs riggs@umn.edu wrote:
On 5/6/2010 3:20 AM, Tom Brown wrote:
Hi
We are looking at a migration from standalone cobbler and going to spacewalk. Currently spacewalk just requires 'cobbler' but on a fresh install you get 2.0.3 and i have actually upgraded this to 2.0.4 to see if the error is still there and it is.
Basically a number of our snippets dont render out they are just left with $SNIPPET('name') in the rendered out ks and yet these work fine on 1.6.5 - Is there any difference in how cheetah renders stuff out in the versions?
An example of a snippet that does not work is
#set root_password = $getVar("role"," ") #if $root_password == "XXX" # Set the root pwd to be for XXX rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #elif $root_password == "XXX" # Set the root pwd to be for XXX rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #else # Set the XXX root pwd rootpw --iscrypted XXXXXXXXXXXXXXXXXXXXXX #end if
now i can make this one work with #raw's however we have some rather more complicated ones that might be more tricky to fix like that.
any clues on why they fail?
thanks _______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
The problem you're encountering is due to a '$' appearing in your password hashes. With version 2.0.3, snippets are now included via Cheetah, whereas before, cobbler itself was replacing them with the appropriate file. The net result is that you need to use #raw & #end raw tags around your password hashes (ssh keys, etc). Unfortunately, there is a bug in cobbler whereby, when these snippets fail to parse, the original 'snippet' line is all that remains in the parsed kickstart, rather than any sort of error message being included, which is what happens for parsing errors in the main kickstart file.
See these threads for previous discussion of this issue: https://fedorahosted.org/pipermail/cobbler-devel/2010-March/001506.html https://fedorahosted.org/pipermail/cobbler-devel/2010-February/001488.html
I just created a ticket for the issue: https://fedorahosted.org/cobbler/ticket/587
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
What was the reason for the change?
Not to beat a dead horse, but I'm in the process of upgrading my cobbler 1.6.2 install to 2.0.x myself and I'm running into this exact same problem. The implications are more serious on my end though as this particular change breaks rendering of recursive snippets (which I use quite a bit in my setup).
To give a simple example of an instance where this is breaking, I have one snippet called modular_template that calls in four more snippets: config_prep0, config_prep, openntpd_config, and increase_resource_limits.
To answer the obvious question: yes, I did take those snippets out of the modular_template snippet and place them directly in my kickstart, but that only broke my config_prep snippets; and no, #raw tags did not help the situation either.
What was the reason for the change?
Not to beat a dead horse, but I'm in the process of upgrading my cobbler 1.6.2 install to 2.0.x myself and I'm running into this exact same problem. The implications are more serious on my end though as this particular change breaks rendering of recursive snippets (which I use quite a bit in my setup).
To give a simple example of an instance where this is breaking, I have one snippet called modular_template that calls in four more snippets: config_prep0, config_prep, openntpd_config, and increase_resource_limits.
To answer the obvious question: yes, I did take those snippets out of the modular_template snippet and place them directly in my kickstart, but that only broke my config_prep snippets; and no, #raw tags did not help the situation either.
nested snippets are a problem for me too and raw does not seem to help on a couple of them - so right now i dont know what to do here to move forward
I'm surprised the #raw & #end raw tags aren't working. We use snippets nested several deep ourselves, but once we went through and escaped all the '$' in one form or another (usually "#raw \n <some line with a password or ssl key> \n #end raw") fixed them. If this isn't working, I'd suspect you have some other cheetah error that, unfortunately, isn't be propagated. Cheetah has a command-line option, but it doesn't understand the '$SNIPPET' command, so that doesn't help. I suspect the best method for testing is a python interpreter importing whatever is necessary from Cheetah and registering the '$SNIPPET' command as cobbler does. Unfortunately, this requires digging into the cobbler source.
On Mon, May 24, 2010 at 2:41 PM, Tom Brown tom@ng23.net wrote:
What was the reason for the change?
Not to beat a dead horse, but I'm in the process of upgrading my cobbler 1.6.2 install to 2.0.x myself and I'm running into this exact same problem. The implications are more serious on my end though as this particular change breaks rendering of recursive snippets (which I use quite a bit in my setup).
To give a simple example of an instance where this is breaking, I have one snippet called modular_template that calls in four more snippets: config_prep0, config_prep, openntpd_config, and increase_resource_limits.
To answer the obvious question: yes, I did take those snippets out of the modular_template snippet and place them directly in my kickstart, but that only broke my config_prep snippets; and no, #raw tags did not help the situation either.
nested snippets are a problem for me too and raw does not seem to help on a couple of them - so right now i dont know what to do here to move forward
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
cobbler@lists.fedorahosted.org