-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Message: 4
Date: Mon, 29 Dec 2008 11:35:56 -0800
From: "Jeff Schroeder" <jeffschroed(a)gmail.com>
Subject: Re: A problem with variables in 1.4
To: "cobbler mailing list" <cobbler(a)lists.fedorahosted.org>
Message-ID:
<c24352ca0812291135s744f92f0rdd3bb6035991b404(a)mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Dec 29, 2008 at 11:29 AM, D. Christopher Dale
<dale_christopher(a)bah.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> It appears that a problem was introduced in the 1.4 release on my fedora
> 10 laptop. The following section of the %post section of my kickstarts
> used to poduce a desired host name of dbg01.dbg.gesi (or whatever node I
> was building).
>
> # set hostname and populate hosts file
> cat >> /etc/sysconfig/networking << EOF
> NETWORKING=yes
> HOSTNAME=$grid$node.dbg.gesi
> EOF
>
> %hostname produces: dbg.dbg.gesi.
>
> If I escape the . after the variable as follows:
>
> # set hostname and populate hosts file
> cat >> /etc/sysconfig/networking << EOF
> NETWORKING=yes
> HOSTNAME=$grid$node\.dbg.gesi
> EOF
>
> %hostname is dbg01.dbg.gesi. The /etc/sysconfig/network file keeps the
> \, as expected.
Try something like this:
# set hostname and populate hosts file
#raw
cat >> /etc/sysconfig/networking << EOF
NETWORKING=yes
HOSTNAME=$grid$node.dbg.gesi
EOF
#end raw
See this for more info:
https://fedorahosted.org/cobbler/wiki/KickstartTemplating#RawescapingandS...
- -- Jeff Schroeder Don't drink and derive, alcohol and analysis don't
mix.
http://www.digitalprognosis.com
Jeff -
Thanks for the help. Here is the the working element.
# For more information see
#https://fedorahosted.org/cobbler/wiki/KickstartTemplating#RawescapingandSnippets
#http://cheetahtemplate.org/docs/users_guide_html/users_guide.html#SECTION000850000000000000000
#
b_grid=$grid # $grid is provided from ks_meta from the profile
b_node=$node # $node is provided from ks_meta from the system
#raw
cat > /etc/sysconfig/network << EOF
NETWORKING=yes
HOSTNAME=$b_grid$b_node.dbg.gesi
EOF
#end raw
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iEYEARECAAYFAklaeHAACgkQsGBgRqdy/C31OwCgg1K2KlxtjwT/JTn3/5pBOhGs
O1wAn3JciUBJs6h6kADtKGXLIHAZTlJs
=NdOm
-----END PGP SIGNATURE-----