%includes issues

Miller, Kevin R kevin.r.miller at lmco.com
Thu Oct 2 16:35:31 UTC 2014


I have an operational Cobbler kickstart environment that is working great.  In addition I modified the kickstart file and have incorporated it into a DVD based kickstart.   The changes that were required were to remove SNIPPET calls and change the "url" command to be "cdrom".   I have pasted the kickstart files for each below.

#######Cobbler version ##############
%include /tmp/diskparam
authconfig --enableshadow --passalgo=sha512
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=$tree
reboot

%pre
$SNIPPET('disk_choose')
%end

%packages
$SNIPPET('my_pkgs')
%end

%post
$SNIPPET('my_post')
%end

############end cobbler version###################

##############DVD Version#####################
%include /tmp/diskparam
authconfig --enableshadow --passalgo=sha512
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
cdrom
reboot

%pre
%include '/mnt/stage2/ks/includes/disk_choose'
%end

%packages
%include '/mnt/stage2/ks/includes/my_pkgs'
%end

%post
%include '/mnt/stage2/ks/includes/my_post'
%end
##########end DVD version#####################

What I would like to is make a single kickstart file that could be used for both Cobbler/net based and DVD based installations.  I added some logic to the %pre section to adjust but it doesn't seem to be working.  Logic is listed below.   The logic works when I test it outside of kickstart but the kickstart doesn't seem to be interpreting the $basepath variable.  When I interrupt a kickstart using a ctl-f2 and look at /tmp/ks.cfg it just shows the base kickstart file and not an interpreted one.  Any help would be appreciated.  If any ideas on how to accomplish the same thing are out the please let me know.

%pre
#!/bin/bash
if [ `/bin/grep cdrom /proc/cmdline | wc -l` -gt 0 ]
then
touch /tmp/yes_cdrom
basepath=/mnt/stage2/ks/
else
touch /tmp/no_cdrom
basepath=http://10.0.0.100/
fi
%include "${basepath}includes/disk_choose"



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20141002/ffe02b20/attachment.htm>


More information about the Kickstart-list mailing list