[xcat-user] Template processing in xCAT 2.x
Mark Loveridge
markl at gatwick.westerngeco.slb.com
Wed Sep 2 02:43:16 MDT 2009
Hi Vallard,
So far as I can tell all you've done is change $NODE to THISNODE which has no effect -
they appear to be synonyms.
If I take a simple (and somewhat meaningless template) like:
#INCLUDE:#ENV:XCATROOT#/test/partitions/#TABLE:nodetype:$NODE:profile##
#INCLUDE:/opt/xcat/test/partitions/#TABLE:nodetype:THISNODE:profile##
#INCLUDE:#ENV:XCATROOT#/test/packages/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:profile##
#COMMAND:#ENV:XCATROOT#/test/bin/test-echo #TABLE:nodetype:$NODE:profile# #TABLE:nodetype:$NODE:os#
#TABLE:nodetype:THISNODE:arch##
(this includes a simple partitioning (twice:-)), a very simple package list
and test-echo simply echoes it's arguments). It gets expanded as:
#INCLUDE:/opt/xcat/test/partitions/test#
TABLE:nodetype:THISNODE:profile##
#INCLUDE:/opt/xcat/test/packages/rh5.4/test#
#COMMAND:/opt/xcat/test/bin/test-echo test rh5.4 x86_64#
(The profile for this node is "test" and I'm attempting to install RH 5.4 on a 64-bit system)
On reflection last night I decided my request to allow the inclusion of file names containing
variables wasn't so difficult to achieve. The attached patch to Template.pm fixes both my
requests and should not break any existing templates (at least I can't see any problems at
the moment). With this patch I now get the following output from the same template:
clearpart --all --initlabel
part swap --size 1024
part / --size 1 --grow --fstype ext3
clearpart --all --initlabel
part swap --size 1024
part / --size 1 --grow --fstype ext3
%packages
@everything
test rh5.4 x86_64
So far as I'm concerned this looks good, but I've probably overlooked something...
Mark
Vallard Benincosa wrote:
> Hey Mark,
> I don't know why the rules were changed. Maybe Jarrod knows. I don't
> see any reason that it couldn't be changed back to what it was in 1.3
>
> As far as this:
> #INCLUDE /somewhere/partitions/#TABLE:
>
> nodetype:$NODE:profile#/#TABLE:nodetype:$NODE:os##
>
>
> You should be able to still do that with:
> #INCLUDE
> /somewhere/partitions/#TABLE:nodetype:THISNODE:profile#/#TABLE:nodetype:THISNODE:os##
>
> Doesn't that work?
>
> On Tue, Sep 1, 2009 at 8:29 AM, Mark Loveridge
> <markl at gatwick.westerngeco.slb.com
> <mailto:markl at gatwick.westerngeco.slb.com>> wrote:
>
> Hi,
>
> At long last I've started investigating how to migrate our xcat 1.3
> setup to xcat 2.
>
> The first issue that I've run into is in the processing of the
> kickstart templates
> (I'm attempting to install CentOS and RHEL based systems). The old
> xCAT 1.3
> templates had lines of the form:
>
> #COMMAND:genscript pre #ENV:OSVER# #ENV:ARCH##
>
> and we have used this model extensively in building our templates.
> This no longer
> works in xCAT 2. (This particular line is not used any more of
> course - I'm using
> this example because this is the behaviour we've come to expect).
>
> The reason this no longer works is because the order of processing
> variables has changed. In
> xcat 1.3 (/opt/xcat/lib/subvars.pl) the variables are expanded in
> the order:
>
> #INCLUDE
> #XCATVAR
> #ENV
> #TABLE
> #COMMAND
>
> In xCAT 2 (/opt/xcat/lib/perl/xCAT/Template.pm) the order is now:
>
> #INCLUDE
> #COMMAND
> #TABLE
> #XCATVAR
> #ENV
>
> Is there a reason for this change? From my point of view moving
> #COMMAND back to the
> end restores the old behaviour and makes my task of updating the
> templates much simpler.
>
> (What I would really like to see is the ability to do something like:
>
> #INCLUDE
> /somewhere/partitions/#TABLE:nodetype:$NODE:profile#/#TABLE:nodetype:$NODE:os##
>
> but this requires rather more work...)
>
> Mark
> --
> ----------------------------------------------------------------------------
> Mark Loveridge
> markl at gatwick.westerngeco.slb.com
> <mailto:markl at gatwick.westerngeco.slb.com>
>
> Tel: +44(0)1293 556870 --- Fax: +44(0)1293 556800 --- Mob:
> +44(0)7824 473477
>
> Registered Name: WesternGeco Limited
> Registered Office: Schlumberger House, Buckingham Gate, Gatwick Airport,
> West Sussex RH6 0NZ, UK
> Registered in England & Wales: No. 1389716
> _______________________________________________
> xcat-user mailing list
> xcat-user at lists.xcat.org <mailto:xcat-user at lists.xcat.org>
> http://www.xcat.org/mailman/listinfo/xcat-user
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> xcat-user mailing list
> xcat-user at lists.xcat.org
> http://www.xcat.org/mailman/listinfo/xcat-user
--
----------------------------------------------------------------------------
Mark Loveridge markl at gatwick.westerngeco.slb.com
Tel: +44(0)1293 556870 --- Fax: +44(0)1293 556800 --- Mob: +44(0)7824 473477
Registered Name: WesternGeco Limited
Registered Office: Schlumberger House, Buckingham Gate, Gatwick Airport,
West Sussex RH6 0NZ, UK
Registered in England & Wales: No. 1389716
-------------- next part --------------
A non-text attachment was scrubbed...
Name: template.patch
Type: text/x-patch
Size: 1686 bytes
Desc: not available
Url : http://www.xcat.org/pipermail/xcat-user/attachments/20090902/40b33f12/template.bin
More information about the xcat-user
mailing list