Hello,
I use Puppet for some weeks in mutli-environments mode (I have 4 environments : "developpement", "homologation", "production" and "dmz") and i still have the same problem when i want to switch node's environment.
Example :
I install and configure for the first time an agent.
"/etc/puppet/puppet.conf" on "stestsles03" :
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
server=mypuppetmaster.domain.local
environment=developpement
I execute "puppet agent--test" on my node and i go to the puppetmaster to sign SSL certificat.
I create in the manifests file my new node ("/etc/puppet/environment/developpement/manifests/site.pp":
node 'stestsles03.domain.local' {
include repos
include client_vtom
}
and i return on my new node to execute "puppet agent --test"
Result : OK
After, i want to change the environment of my new node to "homologation", so i change it in "/etc/puppet/puppet.conf" on stestsles03.local.
And when i run again "puppet agent --test" i have this error :
stestsles03:~ # puppet agent --test
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find default node or by name with 'stestsles03.domain.local, stestsles03.domain, stestsles03' on node stestsles03.domain.local
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
I have testing this :
- Cleaning node on the puppet master : "puppet cert --clean stestsles03.domain.local", delete ssl directory in "/var/lib/puppet" and execute agent to create new ssl certificate (I cut/copy my node decalaration (manifests) from developpement environnement to homologation environnement)
What is wrong ?
Sorry for bad english :-)
Best regards,
Olivier