10.2. Renaming Capsule Server
The host name of Capsule Server is referenced by Satellite Server components, and all hosts registered to it. This procedure ensures that you update all references to the new host name.
-
Both the
hostnameandhostname -fcommands must return the FQDN of Capsule Server or thesatellite-change-hostnamescript will fail to complete. -
If the
hostnamecommand returns the shortname of Capsule Server instead of the FQDN, usehostnamectl set-hostname old_fqdnto set the old FQDN correctly before attempting to use thesatellite-change-hostnamescript.
Prerequisites
Backup Capsule Server. The
satellite-change-hostnamescript makes irreversible changes to Capsule Server. If the renaming process is not successful, you must restore it from a backup.Perform a backup before changing a host name. For more information, see 8章Backing Up Satellite Server and Capsule Server.
Until BZ#1829115 is resolved, you must edit the usr/share/katello/hostname-change.rb file on Capsule Server and comment out the following lines before attempting to rename Capsule Server:
STDOUT.puts "updating hostname in hammer configuration"
self.run_cmd("sed -i.bak -e 's/#{@old_hostname} \
/#{@new_hostname}/g' #{hammer_root_config_path}/*.yml")
self.run_cmd("sed -i.bak -e 's/#{@old_hostname} \
/#{@new_hostname>/g' #{hammer_config_path}/*.yml")Procedure
On Satellite Server, generate a new certificates archive file for Capsule Server.
If you are using the default SSL certificate, enter the following command:
# capsule-certs-generate \ --foreman-proxy-fqdn new-capsule.example.com \ --certs-tar /root/new-capsule.example.com-certs.tar
Ensure that you enter the full path to the
.tarfile.- If you are using a custom SSL certificate, create a new SSL certificate for Capsule Server. For more information, see Configuring Capsule Server with a Custom SSL Certificate in Installing Capsule Server.
On Satellite Server, copy the certificates archive file to Capsule Server, providing the
rootuser’s password when prompted. In this example the archive file is copied to therootuser’s home directory, but you may prefer to copy it elsewhere.# scp /root/new-capsule.example.com-certs.tar root@capsule.example.com:
On Capsule Server, run the
satellite-change-hostnamescript and provide the host’s new name, Satellite credentials, and certificates archive filename.# satellite-change-hostname new-capsule --username admin \ --password password \ --certs-tar /root/new-capsule.example.com-certs.tar
Ensure that you enter the full path to the
.tarfile.-
Optional: If you have created a custom certificate for Capsule Server, on Capsule Server, to deploy the certificate, enter the
satellite-installercommand that thecapsule-certs-generatecommand returns. For more information, see Deploying a Custom SSL Certificate to Capsule Server in Installing Capsule Server. On all Capsule clients, enter the following commands to reinstall the bootstrap RPM, reregister clients, and refresh their subscriptions.
You can use remote execution feature to perform this step. For more information, see Configuring and Setting up Remote Jobs in Managing Hosts.
# yum remove -y katello-ca-consumer* # rpm -Uvh http://new-capsule.example.com/pub/katello-ca-consumer-latest.noarch.rpm # subscription-manager register --org="Default_Organization" \ --environment="Library" \ --force # subscription-manager refresh
- In the Satellite web UI, navigate to Infrastructure > Capsules.
- Locate Capsule Server in the list, and click Edit to the right of it.
- Edit the Name and URL fields to match the Capsule Server’s new host name, then click Submit.
- On your DNS server, add a record for the Capsule Server’s new host name, and delete the record for the previous host name.