Admittedly I’ve not read all the things you’ve tried, but there was a post by 
Emmett a few days back about assigning a random hostname on build. It may help?



From: [email protected] 
[mailto:[email protected]] On Behalf Of Emmett Hogan
Sent: Saturday, 5 March 2016 3:20 AM
To: [email protected]
Subject: Re: [Spacewalk-list] Set Random Hostname During Build process 
(SOLUTION)

Well…I never got a response from the list (or the IRC Channel) on this, but it 
turns out the solution is WAY easier than I thought, but not very intuitive.

I simply put this line in as a “PRE” bash script:

echo "network --hostname=temp-$RANDOM$RANDOM.mydomain.com" > /tmp/pre-hostname

Then put the line:

%include /tmp/pre-hostname

into the “Custom Options” box at the bottom of the “Kickstart Details” -> 
“Advanced Options” page for your kickstart profile.

Hopefully this will save time for other folks.

-Emmett

From: [email protected] 
[mailto:[email protected]] On Behalf Of Lachlan Musicman
Sent: Wednesday, 23 March 2016 3:08 PM
To: [email protected]
Subject: [Spacewalk-list] kickstart, cobbler and hostnames

Hola,
I've found a number of ideas online about how to inject the hostname into a 
kickstart'ed installation, but I'm still unable to get a server to boot using a 
hostname that isn't generic.  I don't have admin access to the DNS or DHCP 
server, so I can't use either of those.
I have tried a post install script, but that failed to change the hostname.

There is the pre-script pass as kernel parameter option, which I don't like much

http://monzell.com/post/15547967527/automatically-set-the-hostname-during-kickstart

and the network config line which I'm also ambivalent on:

http://forums.fedoraforum.org/showthread.php?t=285238
given that I want dynamic names (if I launch 20 servers from the same profile, 
I want them to have unique hostnames that aren't localhost.localdomain). 
Neither of these systems is dynamic enough for this, unless I'm missing 
something?

I found this email:

https://www.redhat.com/archives/spacewalk-list/2015-July/msg00054.html
which lead me to "3.1.4.6. Adding a System to Cobbler" here 
https://access.redhat.com/documentation/en-US/Red_Hat_Satellite/5.6/html/Getting_Started_Guide/chap-Getting_Started_Guide-System_Provisioning.html

I created a pool of MAC addresses and then added them as cobbler systems, I 
regenerated the generated.iso - but the systems that are booting aren't getting 
the "cobbler system" that was created for each of them?
I'm not 100% sure at which point the "cobbler system" should be taking control 
- I'm still getting a boot menu with a list of KS profiles to choose from, 
despite each cobbler system being associated with a ks profile...
What am I doing wrong or not understanding wrt cobbler systems? Is it because 
my NICs are vNICS and therefore the MAC addresses are ...?
If, alternatively, I was to do something in a %post, like this

%post --nochroot

echo $hostname > /mnt/sysimage/home/hostname
(as found here:

http://serverfault.com/questions/608544/passing-variables-in-kickstart )

I presume I could apply hostnames depending on the MAC address, which 
presumably I can get in %post via # ifconfig | grep ether | awk '{print $2}' or 
somesuch





Cheers
L.




------
The most dangerous phrase in the language is, "We've always done it this way."

- Grace Hopper

______________________________________________________________________
Any views expressed in this message are those of the individual sender, 
except where the sender specifically states them to be the views of 
Fletcher Building or any related subsidiaries.
_______________________________________________
Spacewalk-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-list

Reply via email to