Hey Guys,
Let me try to step through this one step at a time. I recommend downloading one of our VMs that we host for testing puppet (I'm using the VM we use for training located here -->
http://downloads.puppetlabs.com/training/puppet-vmware.zip but there's also one for VirtualBox too -->
http://downloads.puppetlabs.com/training/puppet-vbox.zip) to test this setup. If you do that, make sure DNS and networking are working (So, setup host entries on your laptop for each VM, setup the hostname and FQDN ON EACH VM, and make sure each VM can ping the VM Master). I'm using three VMs (a master and two agents): nodemaster.puppetlabs.vm, node1.puppetlabs.vm, and node2.puppetlabs.vm. Once DNS resolves and is working, setup Puppet on the master FIRST, and then setup the remaining nodes as agents. Again, I recommend using the VMs and using Puppet Enterprise because it makes it MUCH EASIER to setup Puppet - just use the puppet-enterprise-installer script (once you get the process of using a single cert and multiple node_names DOWN, THEN you can start on some actual machines).
Now we can start customizing Puppet. There are a couple of key steps that need to be taken since we're shipping around a single cert for all machines:
1. When you stand up a PE Agent, it's going to contact the master and setup a Certificate Signing Request. Because of this, go to the master node's $ssldir (which, on Puppet Enterprise, is /etc/puppetlabs/puppet/ssl. If you want to find the $ssldir on YOUR master, just run `puppet config print ssldir` and it will print it out for you) and remove the CSRs that are in the ca/requests/ directory (they should be named after your nodes).
2. Next, lets generate the single certificate that will be shopped around. You will need to use the same 'certname' on every node. This is the name of the node as SSL is aware (in my case I'm using 'macs.puppetlabs.vm'). Do this by doing `puppet cert generate macs.puppetlabs.vm` on your MASTER machine. The master will generate the certs and your $ssldir will look something like this:
ssl
|-- ca
| |-- ca_crl.pem
| |-- ca_crt.pem
| |-- ca_key.pem
| |-- ca_pub.pem
| |-- inventory.txt
| |-- private
| | `-- ca.pass
| |-- requests
| |-- serial
| `-- signed
| |-- macs.puppetlabs.vm.pem
| |-- nodemaster.puppetlabs.vm.pem
| |-- pe-internal-broker.pem
| |-- pe-internal-dashboard.pem
| |-- pe-internal-mcollective-servers.pem
| |-- pe-internal-peadmin-mcollective-client.pem
| `-- pe-internal-puppet-console-mcollective-client.pem
|-- certificate_requests
|-- certs
| |-- ca.pem
| |-- macs.puppetlabs.vm.pem
| |-- nodemaster.puppetlabs.vm.pem
| |-- pe-internal-broker.pem
| |-- pe-internal-mcollective-servers.pem
| |-- pe-internal-peadmin-mcollective-client.pem
| `-- pe-internal-puppet-console-mcollective-client.pem
|-- crl.pem
|-- private
|-- private_keys
| |-- macs.puppetlabs.vm.pem
| |-- nodemaster.puppetlabs.vm.pem
| |-- pe-internal-broker.pem
| |-- pe-internal-mcollective-servers.pem
| |-- pe-internal-peadmin-mcollective-client.pem
| `-- pe-internal-puppet-console-mcollective-client.pem
`-- public_keys
|-- foo.puppetlabs.vm.pem
|-- macs.puppetlabs.vm.pem
|-- nodemaster.puppetlabs.vm.pem
|-- pe-internal-broker.pem
|-- pe-internal-mcollective-servers.pem
|-- pe-internal-peadmin-mcollective-client.pem
`-- pe-internal-puppet-console-mcollective-client.pem
3. There are three files you need to collect on your master and ship around to all of your nodes. They are ALL in the $ssldir, so these paths are relative to THAT directory. The three files are:
- $ssldir/private_keys/macs.puppetlabs.vm.pem on the master -> gets copied to the agent's $ssldir/private_keys directory
- $ssldir/public_keys/macs.puppetlabs.vm.pem on the master -> gets copied to the agent's $ssldir/public_keys directory
- $ssldir/ca/signed/macs.puppetlabs.vm.pem on the master -> gets copied to the agent's $ssldir/certs directory
4. You need to modify /etc/puppetlabs/puppet/auth.conf on the master so every node can access the find action on the catalog REST endpoint for the master (i.e. The Mac nodes can get their catalog). Look for this stanza in auth.conf:
# allow nodes to retrieve their own catalog (ie their configuration)
path ~ ^/catalog/([^/]+)$
method find
allow $1
Add the following line under 'allow $1': (Remember that I'm using the certname of macs.puppetlabs.vm - you would substitute the certname you will use in your infrastructure)
5. Now, we need to modify /etc/puppetlabs/puppet/puppet.conf on the NODES themselves. There are two changes that need to be made: the certname and the nodename. Remember that we need to decouple the name that SSL uses to identify the node (macs.puppetlabs.vm) with the name that PUPPET uses to CLASSIFY the node (node1.puppetlabs.vm and node2.puppetlabs.vm in our case). The first line you need to change in puppet.conf is the certname configuration item, set that to the following on ALL of your nodes: 'certname = macs.puppetlabs.vm'. If you're using Puppet Enterprise, that item should already be in the [agent] stanza, so you'll need to change it. The next configuration item could either go in the [agent] or [main] stanza, and that's the node_name_fact OR the node_name_value item. NOTE: THESE ITEMS ARE MUTUALLY EXCLUSIVE - YOU CAN ONLY USE ONE OR THE OTHER. For more information, see -->
http://docs.puppetlabs.com/references/stable/configuration.html#nodenamefact The node_name_fact allows you to set the nodename based on a Facter fact. In my case I'm going to set 'node_name_fact = fqdn' on all of my nodes because I want the nodename to match the FQDN on the machine. If you're managing Macs, however, you might want to use something relatively static like a serial number (if you use something like the hostname, it will change any time someone renames their machine in the sharing pane). You could also do 'node_name_value = thisnode' and Puppet would classify the node based on the name of 'thisnode', but you would need to have that item be unique for every one of your nodes. This is a change you will need to evaluate in your own environment.
6. Once you've generated the cert, put it in the appropriate directories on the client, changed auth.conf, set puppet.conf on the agents, and everything is installed, you should be able to run `puppet agent -t` and watch things work! Note that if you're using the console, you will see the node records listed based on the nodename.
Let me know if you have any other questions on this process :)