LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-01-2016, 01:47 PM   #1
galron010
LQ Newbie
 
Registered: Sep 2015
Posts: 7

Rep: Reputation: Disabled
RedHat Satellite Kickstart: Passing IP information from Kernel Parameters to Kickstart Config file


Hello,

I am trying to set up an automated Kickstart provisioning process and I have run into a snag. First thing's first, here is what I am currently working with:
  • OS attempting to install: RHEL 6.7
  • VM boot source: Custom ISO with Kernel Parameters which provide IP information and KS file location.
  • Kickstart deployment: Using RedHat Satellite 5.x server to create and store KS config file.

Where I am so far:
  • I can boot a blank VM off of the ISO and it goes out and grabs the KS file.
  • IF I configure the IP information in the KS file, the system will continue to the Kickstart process without prompt (if IP information is not configured statically in the KS file, then I am prompted for IP info - this is what I need to avoid).

So, what I need now is to be able to take the network config information from the ISO, and write it to the Kickstart portion.

Here is the ISO boot option I am using:

Code:
label ks
  menu label Install system using ^Kickstart on remote server
  menu default
  kernel vmlinuz
  append text ksdevice=eth0 ip=192.168.1.11 netmask=255.255.255.0 gateway=192.168.1.1 dns=192.168.1.200,192.168.2.200 ks=http://my-satellite.domain.net/ks/cfg/org/1/label/ks-config-file initrd=initrd.img
The whole process works so long as I adjust both the ISO and the KS file with the IP information every time. I intend on having a script adjust the ISO automatically, but in the interest of ease, I need to then be able to take this portion from the ISO:

Code:
ip=192.168.1.11 netmask=255.255.255.0 gateway=192.168.1.1 dns=192.168.1.200,192.168.2.200
And put it in the Kickstart process where normally the "network" portion of the KS file would provide the information.

What kind of pre-script or other re-configuration could I put in place to make this happen.

I realize this is a long question and a bit convoluted, and I apologize for that, but this is becoming a complex setup. I already know work-arounds I could implement, but right now I need whatever options can be thought of to make the above scenario work as described. If we can't make that work, then I will implement a work-around later.

Thank you all in advanced.
 
Old 03-03-2016, 12:11 PM   #2
sgrlscz
Member
 
Registered: Aug 2008
Posts: 123

Rep: Reputation: 84
I've done something similar in the past, and what I did was in the kickstart, in place of the network configuration, I put:
Code:
%include /tmp/network.inc
Then in the %pre section, I use the following code to turn the command-line options into variables:

Code:
# just in case no network variables
touch /tmp/network.inc
# turn the command-line options into variables
set -- `cat /proc/cmdline`
for I in $*; do case "$I" in *=*) eval $I;; esac; done
Once the variables are setup, you can generate the /tmp/network.inc using the information supplied on the command-line. So for example:

Code:
echo "network --device=$ksdevice --bootproto=static --ip=$ip --netmask=$netmask --gateway=$gateway --nameserver=$dns --activate" >>/tmp/network.inc
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] RHL 6.0 Unable to download the Kickstart file/ Error downloading kickstart file AnApproach2DigestLinux Linux - Newbie 3 11-23-2012 05:50 PM
Kickstart Error Error opening kickstart file (null): bad address Latitude Linux - Networking 0 06-03-2009 11:20 AM
how to add users to kickstart config file? windstory Linux - Newbie 4 02-26-2009 02:35 AM
RHEL5 kickstart config file creation problem rado_dimitrov Linux - Enterprise 2 02-13-2008 09:50 AM
MBR location specified in kickstart config file owenh Linux - General 2 03-22-2005 05:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:44 PM.

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