You're right, explicitly adding the UUID isn't practical for large
numbers of nodes. It's more suited to a monitoring system.
For arbitrary numbers of agents you could tweak the catalog
regular expression allow rule to match a portion of the cert name.
# puppet.conf on the agent
[main]
certname = jeff.uuid.ec7f5196-7f63-5f73-f18d-ca69afc5c24d
node_name_value = jeff.uuid
# auth.conf on the master (This requires Puppet 2.7.1 or later since
# it uses a regexp allow)
path ~ ^/catalog/([^/]+).uuid$
method find
allow /^$1\.uuid.*/
path ~ ^/catalog/([^/]+)$
method find
allow $1
Here's puppet generating a new key and getting a catalog on the first
run with autosign turned on:
root@pe-centos6:~/conf# puppet agent --confdir /tmp/jeff --test
info: Creating a new SSL key for jeff.uuid.ec7f5196-7f63-5f73-f18d-ca69afc5c24d
warning: peer certificate won't be verified in this SSL session
info: Caching certificate for ca
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
info: Creating a new SSL certificate request for
jeff.uuid.ec7f5196-7f63-5f73-f18d-ca69afc5c24d
info: Certificate Request fingerprint (md5):
E4:A9:CD:19:15:2F:EC:E0:4C:C7:16:85:E3:8C:00:12
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
info: Caching certificate for jeff.uuid.ec7f5196-7f63-5f73-f18d-ca69afc5c24d
info: Caching certificate_revocation_list for ca
info: Caching catalog for jeff.uuid
info: Applying configuration version '1338877114'
info: Creating state file /tmp/jeff/var/state/state.yaml
notice: Finished catalog run in 0.02 seconds
We have the ability to generate a unique certificate CN that works for
a single node and use it to get a catalog with a single run.
The two remaining hurdles are signing the certificate request and writing
the configuration file. We can insecurely work around the CSR issue
today with autosign. We're working to make this easier while
maintaining security with the sites project Daniel Sauble emailed the
list about recently.
The second problem is writing to the configuration file. What do you
think a puppet subcommand should look like that helps automate this?
Maybe something like:
puppet config write --section main \
certname=$(hostname).uuid.$(ruby -rubygems -e '\
require "guid"; puts Guid.new; \
')
puppet config write --section main \
node_name_value=$(hostname).uuid
-Jeff