I’m trying to configure puppetmaster and puppet clients using Ubuntu 11.10 EC2 Instances (ami-a562a9cc). I have enabled automatic certificate signing. But whenever I issue command from puppet client :
#puppet agent –server puppet –waitforcert 60 –test
Certificates get signed but it throws an error and does not run catalog file.
Error Message :
err: Could not retrieve catalog from remote server: hostname was not match with the server certificate
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
err: Could not send report: hostname was not match with the server certificate
Applying Manifest file on PuppetMaster works out fine but doesn’t work on puppetclients.
I have already setup puppet environment on Amazon Linux & Centos and it worked out fine on them. But I’m facing these issues for Ubuntu 11.10
Thanks
Sanket Dangi
Puppet uses standard x.509 SSL certificates to communicate. These are the same certificates used in HTTPS so you can think of them using the same mental model.
This problem is almost always caused by the situation where the puppet agent is using a name not listed in the subject or x.509 alt names field of the puppet master’s certificate.
To resolve this problem please ask yourself, “Is the name the agent is using to contact the master listed in the master’s certificate?”
To answer this question you should determine the name being used by the agent to contact the master. In your example since you’ve specified the
--server puppetoption, puppet is the name being used. If you’re working with a Puppet deployment you yourself didn’t setup, you can find the configured name using the commandpuppet agent --configprint serverwhich should print back something like this:Now that we know the agent is using the name “puppetmaster.acme.com” to contact the master, the next question is “Is puppetmaster.acme.com” in the SSL certificate of the master.
To answer this question, go to the Puppet Master and examine the x.509 SSL certificate being nused. This can be done with the following command. This command uses the
--configprintoption to find out the certificate name being used by the Puppet Master. This is usually just the hostname. Thepuppet cert printcommand prints out a certificate in human readable form and is just like theopenssl x509 -text -noout -in ...command you may already be familiar with.Focus on the two fields named
Subject:andX509v3 Subject Alternative Name:If the name found in the first step (puppetmaster.acme.com) is not listed in either of these two fields, then you’re sure to receive thehostname was not match with the server certificate warningyou’ve received.To resolve the problem, simply use
puppet agent --server <hostname>where<hostname>is something listed in the certificate being used by the master.You shouldn’t need to re-issue certificates to solve this problem.
Hope this helps.