I added a simple script in rc.local that first checks to make sure it is not 
still the gold image hostname (to avoid unnecessary spacewalk joins when 
booting the image to perform maintenance) and then execute the join script if 
it is needed.  The join script is a simple two-liner that runs the rhnreg_ks 
command with the appropriate key and then removes the entries from rc.local so 
it doesn’t re-run on subsequent boots.  

 

It’s pretty rudimentary and not very pretty, but it does the job so I’m happy.  
Thanks everyone!

 

BTW, props to the Spacewalk devs on the new GUI.  It has a nice feel to it and 
looks pretty sharp!  

 

From: spacewalk-list-boun...@redhat.com 
[mailto:spacewalk-list-boun...@redhat.com] On Behalf Of Thomas Foster
Sent: Thursday, May 01, 2014 4:46 PM
To: spacewalk-list@redhat.com
Subject: Re: [Spacewalk-list] Automatically Registering VM Clones as SPacewalk 
Clients

 

There are ways to get what you want from spacewalk using the rhnreg_ks command 
and a script that I wrote that I am currently integrating into a puppet 
module(hence the question about puppet).  Here is the url to the script (I got 
tired of removing servers when rebuilt them with vmware).

 

https://gist.github.com/nohtyp/10331844

 

On Thu, May 1, 2014 at 4:30 PM, Justin Edmands <shockwav...@gmail.com> wrote:

On Thu, May 1, 2014 at 4:16 PM, Glennie, Jonathan - 0443 - MITLL 
<jrgle...@ll.mit.edu> wrote:

Hello All-

 

My apologies if this has been covered somewhere before, but I’m trying to 
determine the best method of automating spacewalk client registration in a 
virtual environment and surprisingly enough I haven’t found much.  Right now, 
we are using VMware CentOS 6 templates as base images for client machines.  We 
have a handful of scripts set up to automate other tasks such as hostname/IP 
changes, but I’m not sure the best way to handle spacewalk registration.  Has 
anyone set this up before that may have some experiences to share? 

 

I don’t think we want to go down the road of using kickstart as most of the 
configuration we need is already done on the template, unless there is a 
“light” way of using it to run simple post install scripts?  And I’m pretty 
sure we can’t register the template to spacewalk otherwise we would have to 
deal with duplicate systems showing up in the inventory, or at least I think we 
would.  I’m leaning towards using a template with the necessary packages 
installed but not registered to spacewalk, with a script in rc.local which will 
check to see if the machine is registered to spacewalk (not sure how yet) and 
then run the rhnreg command if not.  Thoughts anyone?

 

Thanks in advance,

-Jon

 

 

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list

 

Hey Jon,
Nothing will be automated if going the vmware route. The only automated way 
would be to use redhats virtualization software, KVM. I built a bash program 
that automates the process of installation and registration. It has the ability 
to register to various channels by answering questions, etc. 

Your best bet would be to just generate a simple startup script that prompts 
you for input. The possibilities are endless for this kind of method. You will 
build the last part of the script to remove itself from startup only if it 
successfully registers. 

--Justin


_______________________________________________
Spacewalk-list mailing list
Spacewalk-list@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list

 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list

Reply via email to