To change the hostnames assigned to your PE infrastructure nodes, you must update the corresponding PE certificate names. You might have to update your master hostname, for example, when migrating to a new PE installation, or after an organizational change such as a change in company name.
Download and install the puppetlabs-support_tasks module.
Make sure you are using the latest version of the support_tasks module.
Set up RBAC permissions and token authentication for orchestrator tasks. See Setting PE RBAC permissions and token authentication for orchestrator for more information.
To update the hostname of your master:
On the master, set the new hostname by running the
hostnamectl set-hostname newhostname.example.com
Make sure the
hostname -fcommand returns the new fully qualified hostname, and that it resolves to the same IP address as the old hostname, by adding an entry for the new hostname in
<IP address> <newhostname.example.com> <oldhostname.example.com> …
Run a task for changing the host name against the
old certificate name on the master, using one of the following methods:
The task restarts all Puppet services, which causes a connection error. You can ignore the error while the task continues to run in the background. To check if the task is complete, tail
- Using Bolt:
bolt task run support_tasks::st0263_rename_pe_master -n $(puppet config print certname) --modulepath="/etc/puppetlabs/code/environments/production/modules"Note: When running the task, Bolt must be using the default SSH transport, rather than the PCP protocol, to avoid errors when services are restarted.
- Using the command
puppet task run support_tasks::st0263_rename_pe_master -n $(puppet config print certname)
/var/log/messages. When the output from the
puppet agent -tcommand is displayed in the system log, the task is complete. For example:
# tail /var/log/messages Aug 15 09:08:28 oldhostname systemd: Reloading pe-orchestration-services Service. Aug 15 09:08:29 oldhostname systemd: Reloaded pe-orchestration-services Service. Aug 15 09:08:29 oldhostname puppet-agent: (/Stage[main]/Puppet_enterprise::Profile::Orchestrator/Puppet_enterprise::Trapperkeeper::Pe_service[orchestration-services]/Service[pe-orchestration-services]) Triggered 'refresh' from 1 event Aug 15 09:08:34 oldhostname puppet-agent: Applied catalog in 19.16 seconds
- Using Bolt: