Thanks for the response.
Unfortunately, I can’t use #raw in this particular instance. I shortened the code to demonstrate the problem, but I use the same construct in another couple of places, and I need to have variables expanded in
general. I just want to specify that this particular string has dollar-signs but is **not** a variable. I thought single-quoting would do that, but apparently I was wrong.
Also, thank you for the link. The link I had (http://www.cheetahtemplate.org/) is apparently way out of date.
I eventually found a work-around:
#set $crypted_password = '$1$abcdef$abcdefghabcdefghabcdef'
rootpw --iscrypted $crypted_password
but I’m still confused as to why the behavior is different.
--EbH
From: alastair@alastair-munro.com [mailto:alastair@alastair-munro.com]
Sent: Monday 19 December 2016 14:06
To: cobbler@lists.fedorahosted.org
Subject: [cobbler] Re: Variable extrapolation
Hi
https://pythonhosted.org/Cheetah/
Try
#raw
#end raw
around your password line with $ in it.
--
Alastair Munro
-----Original Message-----
From: "Hymowitz, Eric B. (GSFC-444.0)[HONEYWELL TECHNOLOGY SOLUTIONS INC]" <eric.b.hymowitz@nasa.gov>
To: "cobbler@lists.fedorahosted.org" <cobbler@lists.fedorahosted.org>
Sent: Mon, 19 Dec 2016 16:24
Subject: [cobbler] Variable extrapolation
Greetings.
I have two cobbler systems running 2.6.5 and 2.6.11, and both are exhibiting this same behavior. I don’t know if it’s something I’m doing wrong, or just something I don’t understand.
My default kickstart calls a snippet called “set_password”. The default “set_password” snippet, located in /var/lib/cobbler/snippets/set_password , includes this line:
rootpw --iscrypted '$1$abcdef$abcdefghabcdefghabcdef'
That works fine. So far so good.
But when I take this same **exact** file and copy it to /var/lib/cobbler/snippets/per_profile/set_password/support , then the snippet fails. It is trying to expand the non-existent variables $abcdef and $abcdefghabcdefghabcdef . I can
verify this by changing the two dollar signs ($1 doesn’t seem to be affected) and the snippet loads properly.
So I guess my question is two-fold
Which is the correct behavior, in a single-quoted string that contains dollar signs? Extrapolate the variable or don’t?
Why is this behavior changing between a default snippet and a per-profile (also for a per-system) snippet?
Thanks.
Eric B. Hymowitz
Systems Administrator
Solar Dynamics Observatory (SDO)
301-286-6352