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

Re: [Spacewalk-devel] Question about kickstart registration key



On Fri, Aug 26, 2011 at 01:32:14PM +0200, Uwe Gansert wrote:
> 
> if I create a kickstart file with the web ui (not uploading but clicking 
> through the wizard) and I use that profile, a uniq registration key is created 
> for that kickstart session (like 1-bde5342234e....)
> That key is stored together with the reregistration key (re-......) in the 
> table RHNACTIVATIONKEY which is the connection to the kickstart session.
> 
> As far as I can see, the key is for example used to track the installation 
> state of virtual machines. If the machine registers with that key, the 
> installation is tagged as finished.
> 
> If you don't use the wizard but upload a kickstart profile or an autoyast XML 
> file, that tracking does not work. No key is created because in 
> KickstartScheduleCommand.java there is:
> 
>         if (!cobblerOnly) {
>             kickstartSession = this.setupKickstartSession(packageAction);
>             KickstartData data = getKsdata();
>             if (!data.isRawData()) {
>                 storeActivationKeyInfo();
>             }
>         }
> 
> if (!data.isRawData()) prevents the key creation - so it happens on purpose 
> that no key is created for uploaded profiles.
> 
> My questions now are.
> 1. installations with uploaded kickstart files can not be tracked. They will 
> never finish. Is that wanted or a bug?

I'd say it's a side-effect of the approach we use -- if you upload a
kickstart profile, it will not contain the correct rhnreg_ks in
it to use the activation key, and in the pre-cobbler era we even did
not have snippets to somehow get it in.

> 2. I think about removing the if-clause above and always create such a key. 
> Do you see a problem with that? I'm not 100% sure why that restriction to 
> uploaded kickstart profiles was made. Maybe there is good reason not to create 
> a key for it.
> That change would require a change in the 'spacewalk/redhat_register'-Snippet 
> like (just a suggestion)
> 
> if [ -n "$registration_key" ]; then
>   redhat_management_key="$redhat_management_key,$registration_key"
> fi
> 
> if [ \$key ]; then 
>     rhnreg_ks --serverUrl=$endpoint --sslCACert=$mycert --activationkey=\$key,
> $redhat_management_key
> else
>      
>      rhnreg_ks --serverUrl=$endpoint --sslCACert=$mycert --
> activationkey=$redhat_management_key
> fi
> 
> 
> the variable $registration_key is new and can contain the "real" key that is 
> used to register a system in the variables of an uploaded profile.
> 
> What do you think about that?
> Did I overlook something?

I don't think you have. If the approach works in your tests, we'll
love to see a patch. ;-)

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat


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