This is my first post!
I have 100's of nodes managed by puppet/foreman. Everything is fine. I did something I already did without problem in the past: Change the hostname of a server.
This time I changed 2 hostnames:
Initially I had 'gate02' and 'gate03'.
I moved gate02 to 'gate02old' (with dummy IP, and switched the server OFF)
then I moved gate03 to gate02 ...
Now (the new) gate02 reports are updating the host called gate02old in foreman.
I did clean the certs in the puppetserver. I rm the ssl dir in the (new) gate02 and run puppet agent. I did not fing any reference to 'gate' in /var/lib/puppet. I changed the certname in puppet.conf and in hostname, and in sysconfig/network-script/ifcfg-xxxx.
The puppet agent run smoothly, and sends it to the puppetserver. But it updates the wrong host!
Anyone would have a clue on how to fix this ?
Thanks!
Foreman 2.0.3 Puppet 6
I do not accept that the sequence of events described led to the behavior described. If reports for the former
gate03, now namedgate02, are being logged on the server for namegate02old, then that is because that machine is presenting a cert to the server that identifies it asgate02old(and the server is accepting that cert). The sequence of events presented does not explain how that might be, but my first guess would be that it is actually (new)gate02oldthat is running and requesting catalogs from the server, not (new)gate02.Fix it by
Ensuring that the machine you want running is in fact the one that is running, and that its hostname is in fact what you intend for it to be.
Shutting down the agent on (new)
gate02. If it is running in daemon mode then shut down the daemon and disable it. If it is being scheduled by an external scheduler then stop and disable it there. Consider also usingpuppet agent --disable.Deactivating the node on the server and cleaning out its data, including certs:
You may want to wait a bit at this point, then ...
Cleaning out the nodes' certs. For safety, I would do this on both nodes. Removing
/opt/puppetlabs/puppet/ssl(on the nodes, not the server!) should work for that, or you could remove the puppet-agent package altogether, remove any files left behind, and then reinstall.Updating the puppet configuration on the new
gate02as appropriate.Re-enabling the agent on
gate02, and starting it or running it in--testmode.Signing the new CSR (unless you have autosigning enabled), which should have been issued for
gate02or whatever certname is explicitly specified in in that node's puppet configuration.