Modifica del certificato SSL di un Puppet Master: Difference between revisions
Jump to navigation
Jump to search
Created page with "Se si configura un Master puppet in lan, il certificato SSL verrà generato con l'fqdn del dominio locale, ad esempio myserver.mylan.example.com Se, ad esempio, poi si vuole..." |
mNo edit summary |
||
| Line 47: | Line 47: | ||
=Riferimenti= | =Riferimenti= | ||
*[http://serverfault.com/questions/320028/how-to-add-multiple-dns-names-to-my-puppetmaster certificate - How to add multiple dns names to my puppetmaster? - Server Fault] | |||
*[http://serverfault.com/questions/197074/puppet-hostname-doesnt-match-server-certificate Puppet hostname doesn't match server certificate - Server Fault] | *[http://serverfault.com/questions/197074/puppet-hostname-doesnt-match-server-certificate Puppet hostname doesn't match server certificate - Server Fault] | ||
*[http://agix.com.au/blog/?p=3376 Puppet err: Could not retrieve catalog from remote server: hostname was not match with the server certificate | AGIX Linux] | *[http://agix.com.au/blog/?p=3376 Puppet err: Could not retrieve catalog from remote server: hostname was not match with the server certificate | AGIX Linux] | ||
*[http://docs.puppetlabs.com/guides/troubleshooting.html#agents-are-failing-with-a-hostname-was-not-match-with-the-server-certificate-error-whats-wrong Troubleshooting — Documentation — Puppet Labs] | *[http://docs.puppetlabs.com/guides/troubleshooting.html#agents-are-failing-with-a-hostname-was-not-match-with-the-server-certificate-error-whats-wrong Troubleshooting — Documentation — Puppet Labs] | ||
*[http://www.masterzen.fr/2010/11/14/puppet-ssl-explained/ Puppet SSL explained - Masterzen's Blog] | *[http://www.masterzen.fr/2010/11/14/puppet-ssl-explained/ Puppet SSL explained - Masterzen's Blog] | ||
Revision as of 15:20, 10 July 2014
Se si configura un Master puppet in lan, il certificato SSL verrà generato con l'fqdn del dominio locale, ad esempio myserver.mylan.example.com
Se, ad esempio, poi si vuole esporre questo Master su internet, e renderlo raggiungibile tramite un IP Pubblico, cin un nome DNS ad esempio mypublic.example.com, se si tenta di accedervi, si otterrà un errore del tipo:
hostname was not match with the server certificate
- Verificare sul master che nomi DNS alterntivi contiene il certificato attuale:
sudo openssl x509 -text -in /var/lib/puppet/ssl/certs/$(hostname -f).pem | grep DNS
DNS:puppet, DNS:puppet.mylan.example.com, DNS:myserver.mylan.example.com
- È Possibile rigenerare questo certificato senza dover rigenerare nulal per i client, includendo il nuovo nome DNS mypublic.example.com.
- Sul master, trovare il nome del vecchio certificato:
sudo puppet master --configprint certname
myserver.mylan.example.com
- Verificare la directory dove è memorizzato il certificato:
puppet master --configprint ssldir
/var/lib/puppet/ssl
- Rimuovere il vecchio certificato:
sudo find $(puppet master --configprint ssldir) -name "$(puppet master --configprint certname).pem" -delete
- Generare il nuovo:
sudo puppet cert generate \ myserver.mylan.example.com \ --dns_alt_names= \ puppet,\ puppet.mylan.example.com,\ puppet.example.com,\ mypublic.example.com
- Verificarlo:
sudo openssl x509 -text -in /var/lib/puppet/ssl/certs/$(hostname -f).pem | grep DNS
DNS:puppet, DNS:puppet.mylan.example.com, DNS:myserver.mylan.example.com, DNS:puppet.example.com, DNS:mypublic.example.com,
- Riavviare il Master:
sudo invoke-rc.d puppetmaster restart
- ATTENZIONE: se il puppetmaster gira sotto passenger (ad esempio è un'istanza Foreman), è necessrio riavviare APACHE, datoc he utlizza il certificato che abbiamo appena modificato:
sudo invoke-rc.d apache2 restart
- Controllare ora che ci si possa connettere:
sudo puppet agent --test --server=mypublic.example.com
Riferimenti
- certificate - How to add multiple dns names to my puppetmaster? - Server Fault
- Puppet hostname doesn't match server certificate - Server Fault
- Puppet err: Could not retrieve catalog from remote server: hostname was not match with the server certificate | AGIX Linux
- Troubleshooting — Documentation — Puppet Labs
- Puppet SSL explained - Masterzen's Blog