%includes issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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="">

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"

 

 

 

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux