How to reconfigure Red Hat Satellite 5.x when changing its IP address or hostname (FQDN)
Environment
- Red Hat Network (RHN) Satellite versions 5.3 to 5.5
- Red Hat Satellite 5.6 to 5.8
Issue
- How do I change the IP address, domain name or hostname of the Satellite, and what additional configuration needs to be done?
- What is the process of changing hostname after Satellite is set up?
Resolution
To change the hostname or IP of the RHN Satellite:
-
During a maintenance window when the Satellite can be made unavailable, change the hostname or IP address of the system.
-
Reboot the Satellite to ensure that the new hostname or IP address is now active.
-
Run the following command as the root user, specifying the IP address associated with the Satellite's hostname:
# spacewalk-hostname-rename <IP address>
Prerequisites
If you have already changed the system's hostname:
-
Make sure the spacewalk-* packages are updated on satellite.
-
Proper DNS mappings (forward and reverse entries) are set for new hostname / IP address.
-
Know the SSL CA passphrase. It will be needed by the script.
-
The FQDN cannot have any capital letters.
-
Verify that SSL CA password is working:
# openssl rsa -in /root/ssl-build/RHN-ORG-PRIVATE-SSL-KEY Enter pass phrase for ssl-build/RHN-ORG-PRIVATE-SSL-KEY: writing RSA key -----BEGIN RSA PRIVATE KEY----- cut -----END RSA PRIVATE KEY-----
How to use the script
- The
spacewalk-hostname-renametakes one mandatory argument - IP_ADDRESS - regardless of whether the IP address has changed or not. If there is a need to generate a new SSL certificate, all necessary information will be asked interactively, unless it is specified by the options. When the system hostname has not changed, the regeneration of a new SSL server certificate is not necessary. However, if at least one--ssl-*option is specified, certificate generation is forced.
Usage:
spacewalk-hostname-rename <IP_ADDRESS> [ --ssl-country=<SSL_COUNTRY> --ssl-state=<SSL_STATE> --ssl-org=<SSL_ORG> --ssl-orgunit=<SSL_ORGUNIT> --ssl-email=<SSL_EMAIL> --ssl-ca-password=<SSL_CA_PASSWORD>]
spacewalk-hostname-rename { -h | --help }
IP_ADDRESS is the default IP address of the system used mainly for monitoring.
Example usage:
# spacewalk-hostname-rename <my_ip_address>
Validating IP ... OK
=============================================
hostname: <my_hostname>
ip: <my_ip_address>
=============================================
Stopping rhn-satellite services ... OK
Testing DB connection ... OK
Updating /etc/rhn/rhn.conf ... OK
Actual SSL key pair package: rhn-org-httpd-ssl-key-pair-rlx-2-18.rhndev-1.0-6
No need to re-generate SSL certificate.
Regenerating new bootstrap client-config-overrides.txt ... OK
Updating NOCpulse.ini ... OK
Updating monitoring data ... OK
Pushing monitoring scouts ... OK
Updating other DB entries ... OK
Changing cobbler settings ... OK
Changing jabberd settings ... OK
Starting rhn-satellite services ... OK
Logging and backup
- The
spacewalk-hostname-renamelogs to/var/log/rhn/rhn_hostname_rename.logand all manually changed files get backed up with predefined.rnmbckextension.
What about the clients?
-
Check the serverURL value in
/etc/sysconfig/rhn/up2dateon every client registered to the renamed satellite and change it to the new hostname/IP value. -
Reconfiguration of RHN proxy servers isn't trivial and it is recommended to recreate the RHN proxy servers.
Script failures
- The most frequent cause of problems is an incorrectly set system hostname. The script checks whether the hostname is correctly set. If not, an error message will inform you of what needs to be fixed. After the problem is resolved, the script can be re-run.
Script location
- The
spacewalk-hostname-renamescript is a part of thespacewalk-utilspackage.
Comments
- Renaming RHN Satellite is not supported for Satellite v 5.2 and earlier versions.
Root Cause
- The
spacewalk-hostname-renameutility reconfigures the Satellite server, in the event that the IP address or hostname have changed, modifying/etc/rhn/rhn.conffile, the server's SSL key pair, etc. - For further information about how to create the SSL certificate manually, please refer to the article This content is not included.#10809.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.