From e6adaff217f3848416a8c15fae3b0e50b44e5925 Mon Sep 17 00:00:00 2001 From: Konrad Bucheli Date: Wed, 28 Aug 2024 10:02:38 +0200 Subject: [PATCH] document hostname change --- _toc.yml | 5 ++- admin-guide/configuration/host_rename.md | 50 ++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 admin-guide/configuration/host_rename.md diff --git a/_toc.yml b/_toc.yml index 9423bc3a..c4ba552d 100644 --- a/_toc.yml +++ b/_toc.yml @@ -45,7 +45,7 @@ chapters: - file: admin-guide/deployment/re_installation - file: admin-guide/deployment/console_installation - file: admin-guide/deployment/dmz_installation - + - file: admin-guide/configuration sections: - file: admin-guide/configuration/icinga2 @@ -59,6 +59,7 @@ chapters: - file: admin-guide/configuration/resize_vm_disk - file: admin-guide/configuration/partitioning - file: admin-guide/configuration/networking + - file: admin-guide/configuration/host_rename - file: admin-guide/configuration/xrdp - file: admin-guide/configuration/puppet_agent - file: admin-guide/configuration/sudo @@ -109,7 +110,7 @@ chapters: - file: admin-guide/puppet/puppet_client - file: admin-guide/puppet/puppet_environments - file: admin-guide/puppet/hiera - + - file: engineering-guide/index sections: - file: engineering-guide/infrastructure_systems diff --git a/admin-guide/configuration/host_rename.md b/admin-guide/configuration/host_rename.md new file mode 100644 index 00000000..70da45fe --- /dev/null +++ b/admin-guide/configuration/host_rename.md @@ -0,0 +1,50 @@ +# Host Renaming + +Following steps are required to rename a host. + + +## Introduce New Hostname + +### Sysdb/bob +For sysdb create a new node with bob as usual. +For reference do + +``` +bob node list -v $OLD_FQDN +``` +then add the new node +``` +bob node add $NEW_FQDN $SYSDB_ENV +bod node set-attr $NEW_FQDN [all attributes as listed above] +``` +and the same for the MAC addresses: +``` +for mac in $(bob node list-macs $OLD_FQDN); do echo bob node add-mac $NEW_FQDN $mac; done +``` + +### Hiera + +In Hiera ensure that a host specific configuration file exists for the FQDN with the same content as for the old hostname. + +## Acutal Hostname Change + +On the node as `root` run + +``` +hostnamectl set-hostname $NEW_FQDN +rm -rf /etc/puppetlabs/puppet/ssl +puppet agent -t +``` + +which changes the local hostname, removes the local Puppet certificate and updates the configuration with Puppet using the new hostname. + +## Other Changes to Consider + +- change DNS entry if a static IP address is assigned +- redo SSL/TLS certificates with new hostname + +## Remove Old Hostname + +- `bob node delete $OLD_FQDN` +- remove from Hiera +- inform the Linux Team (linux-eng@psi.ch) so it can remove from Puppet server the certificate and other data and remove the computer object from the AD