Bug 576211 - Centos kickstart fails at registration due to regex error in KickstartFormatter
Summary: Centos kickstart fails at registration due to regex error in KickstartFormatter
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 0.8
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space10 613994
TreeView+ depends on / blocked
 
Reported: 2010-03-23 14:14 UTC by Gavin White
Modified: 2010-07-13 13:02 UTC (History)
0 users

Fixed In Version:
Clone Of:
: 613994 (view as bug list)
Environment:
Last Closed: 2010-05-10 14:47:57 UTC
Embargoed:


Attachments (Terms of Use)

Description Gavin White 2010-03-23 14:14:23 UTC
Description of problem:



I have created a kickstart distribution and profile for a channel built from the Centos 5.4 x86_64 DVD. The kickstart profile is configured to register using an activation key.

There is a line in the auto generated kickstart file which goes:

perl -npe 's/xmlrpc.rhn.redhat.com/my.fqdn.server/' -i /etc/sysconfig/rhn/up2date

(where my.fqdn.server is my actual spacewalk server)

I believe this is expecting to find the following in the up2date file:

serverURL=https:// xmlrpc.rhn.redhat.com /XMLRPC

However, the up2date file from the Centos DVD contains the following:

#serverURL=https://xmlrpc.rhn.redhat.com/XMLRPC 
serverURL=https://enter.your.server.url.here/XMLRPC

This means that the hashed out entry gets fixed, and my newly kickstarted machine tries to register against enter.your.server.url.here.

It looks like this is done at http://git.fedorahosted.org/git/spacewalk.git/?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java;h=63e73d66431faeb308208e1ffdc7bf49b04faa93;hb=HEAD#l659

I think it would be better to do something like this:

perl -npe 's/serverURL=https:\/\/.*\/XMLRPC/serverURL=https:\/\/@@http_server@@\/XMLRPC/' -i /etc/sysconfig/rhn/up2date

rather than the current approach:

perl -npe 's/xmlrpc.rhn.redhat.com/@@http_server@@/'  -i /etc/sysconfig/rhn/up2date



Version-Release number of selected component (if applicable):

spacewalk 8.0

How reproducible:

For me, every time. 

Steps to Reproduce:
1. create a software channel based on centos5.4 x86_64
2. create a child channel which contains rhn-client-tools etc.
3. build a kickstart distribution from the centos5.4 x86_64 DVD
2. build a kickstart profile which uses the centos channel and link it to an activation key
3. run the kickstart install
  
Actual results:
- See the rhnreg_ks failure in /root/ks-post.log
- After rebooting the new server, see the entry 'serverURL=https://enter.your.server.url.here/XMLRPC' in /etc/sysconfig/up2date


Expected results:
New server is registered to spacewalk using an activation key

I can download the kickstart file, edit it to fix the serverURL line and kickstart off it, and I end up with a properly registered machine.


Additional info:


As a sanity test, I have just uninstalled rhn-client-tools, which provides /etc/sysconfig/rhn/up2date, and reinstalled it from http://spacewalk.redhat.com/yum/0.8/RHEL/5/x86_64/spacewalk-client-repo-0.8-1.el5.noarch.rpm. The up2date file contains:

serverURL[comment]=Remote server URL
#serverURL=https://xmlrpc.rhn.redhat.com/XMLRPC
serverURL=https://enter.your.server.url.here/XMLRPC

ie. this would not work with the serverURL regex built into spacewalk's kickstart.

Comment 1 Gavin White 2010-03-23 14:15:47 UTC
Typo: by 'the up2date file from the Centos DVD' I meant the one from spacewalk-client-repo.

Comment 2 Michael Mráka 2010-04-19 14:31:11 UTC
FIxed by modifying regular expression

commit 39e2ca81ef152e3d6c47633b0ce71138e5f45b04
    576211 - fixed server name replacement pattern

Package spacewalk-java-1.0.4-1 and spacewalk-config-1.0.1-1.

Comment 3 Michael Mráka 2010-05-10 14:47:57 UTC
This bug has been fixed in Spacewalk 1.0.


Note You need to log in before you can comment on or make changes to this bug.