[Spacewalk-list] Bare Metal Provision Through Proxy

Miroslav Suchý msuchy at redhat.com
Wed Mar 14 08:23:28 UTC 2012


On 03/14/2012 07:45 AM, Jan Pazdziora wrote:
> On Tue, Mar 13, 2012 at 08:23:16PM +0100, Miroslav Suchy wrote:
>>> regex going on that replaces all occurrences of 'spacewalk' with my proxy
>>> name instead of just the domain portion of the URL.  So 'spacewalk-client'
>>> is becoming 'proxy.fqdn.tld-client' within the URL string.
>>
>> Aha. Indeed, we have in code which do the replacement something like:
>> s/fqdn-sw-server/fqdn-sw-proxy/
>
> I thought the approach was more fine grained.

No.

> Could we at least change
> the modification to be in the context of a URL
>
> 	s!://fqdn-sw-server(:\d+)?/!://fqdn-sw-proxy/!

Yes, you can.
The code is at 
java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java
in function:
public String renderKickstart(String host, String url)
and the line is:
retval = retval.replaceAll(ConfigDefaults.get().getCobblerHost(), host);

but do not forget to fine tune your regexp to replace cases like:
  CN=FQDN
or
  perl -npe 
's|^(\s*(noSSLS\|s)erverURL\s*=\s*[^:]+://)[^/]*/|${1}FQDN/|' -i 
/etc/sysconfig/rhn/up2date
or
  COBBLER_SERVER=FQDN
or
  any other snippet which customer may put there.

-- 
Miroslav Suchy
Red Hat Satellite Engineering




More information about the Spacewalk-list mailing list