Overview
Following on from a previous post where I outlined how to set up a Puppet Master server we are now going to look at how to connect a client to the Puppet Master and start to manage the client server. This walkthrough is based on two Ubuntu 10.04.2 LTS servers.
Assumptions
For the purpose of this walkthrough I’m going to assume you have a working Puppet Master server as outlined in the previous post. I’m also assuming that you have a client server and that you have either have DNS set up of that you have amended the hosts files of each server so that each can ping the other by hostname. If you are using hosts files your /etc/hosts files should look something like this
1 2 | |
Connect client to server
Once we can ping each server make sure the Puppet Master is running
1
| |
Then we can connect from the client to the server
1
| |
You should see
1
| |
Now on the server we can see the request that has come in with
1
| |
You should see ‘puppetclient’. Now we can sign the certificate with
1
| |
The first time I did this I encountered an issue that complained that the hostname did not match the server certificate. This can be resolved by setting this explicitly in /etc/puppet/puppet.conf
1 2 | |
Now you should have both servers talking to each other and everything configured to start configuring the client with the Puppet Master. After a minute or so you should see the puppet client cache the certificate - this shows that everything is ok.
Adding a module
Now you can start building modules to be sent to the client server. I started with a module to change the message of the day banner. You can find it on github. Once you’ve added your new module restart puppet.
Then you can send modules to nodes that you manage. In /etc/puppet/manifests/nodes.pp add this
1 2 3 | |
When the client requests an update from the server it will be sent the new configuration and the motd will be updated.
The Puppet documentation has some good documentation on creating manifests.