LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 07-19-2012, 01:08 PM   #1
Rogue45
Member
 
Registered: Jun 2012
Posts: 47

Rep: Reputation: Disabled
Kickstart Script reading configuration from a file


I am creating a Kickstart script that will be used to deploy a system. My goal is to get input from a config file on my install server for the static ip settings, timezone, and possibly a couple others. I know how to get variables from users in the %pre section or from my cmd line arguments, but i am having trouble finding any tutorial on how to use variables from a file retrieved in %pre in the command section.

Here is what i have now:

In the command section
%include /tmp/file_to_include
In %PRE
wget http://server/info_to_include -O /tmp/file_to_include

I think i have the file available in my command section now, but i'm not sure how to parse it in order to use its contents?

Only helpful link i've found is pg 19 of: http://www.redhat.com/promo/summit/2010/presentations/summit/decoding-the-code/wed/cshabazi-530-more/MORE-Kickstart-Tips-and-Tricks.pdf[/URL]
 
Old 07-25-2012, 12:07 PM   #2
Rogue45
Member
 
Registered: Jun 2012
Posts: 47

Original Poster
Rep: Reputation: Disabled
Solved it.

I had two problems.
1) my wget command in pre i was using a lowercase -o. It must be upper case -O.
2) In the beginning of my %post section you have to copy your config file from the tmp partition in your preinstalled environment to your tmp directory of your installed image. In my case i have two post sections. The first is nochroot which is why i had to include /mnt
cp /tmp/myConfigFile.cfg /mnt/sysimage/tmp/myConfigFile.cfg

Here is an example of me splitting myConfigFile.cfg into two files. One for variables need in command and the other for variables needed in post.
You will need these commands in the pre section to actually do them and in post to write log files

sed -n /timezone*/p /tmp/myConfigFile.cfg >> /tmp/commandVariables.cfg
sed -n /ntpServer*/p /tmp/myConfigFile.cfg >> /tmp/postVariables.cfg
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kickstart configuration through iso file deepak_message Linux - Server 4 08-25-2011 08:00 AM
pxe booting is not reading kickstart file surajpd Linux - Networking 5 07-01-2010 02:33 PM
Unable to Pick the kickstart configuration file !! arunabh_biswas Linux - Enterprise 16 10-04-2008 12:53 AM
Not reading kickstart configuration file from specified location.....PLEASE HELP!! deepika Linux - Software 4 08-02-2003 08:00 PM
%include directive in Kickstart configuration file deepika Linux - Newbie 0 07-24-2003 05:32 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 10:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration