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 hostname and hostname -f commands must return the FQDN of Capsule Server or the satellite-change-hostname script will fail to complete.
  • If the hostname command returns the shortname of Capsule Server instead of the FQDN, use hostnamectl set-hostname old_fqdn to set the old FQDN correctly before attempting to use the satellite-change-hostname script.

Prerequisites

  • Backup Capsule Server. The satellite-change-hostname script 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

  1. 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 .tar file.

    • 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.
  2. On Satellite Server, copy the certificates archive file to Capsule Server, providing the root user’s password when prompted. In this example the archive file is copied to the root user’s home directory, but you may prefer to copy it elsewhere.

    # scp /root/new-capsule.example.com-certs.tar root@capsule.example.com:
  3. On Capsule Server, run the satellite-change-hostname script 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 .tar file.

  4. Optional: If you have created a custom certificate for Capsule Server, on Capsule Server, to deploy the certificate, enter the satellite-installer command that the capsule-certs-generate command returns. For more information, see Deploying a Custom SSL Certificate to Capsule Server in Installing Capsule Server.
  5. 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
  6. In the Satellite web UI, navigate to Infrastructure > Capsules.
  7. Locate Capsule Server in the list, and click Edit to the right of it.
  8. Edit the Name and URL fields to match the Capsule Server’s new host name, then click Submit.
  9. On your DNS server, add a record for the Capsule Server’s new host name, and delete the record for the previous host name.