Puppet with Windows clients

I was asked if I had configured Windows clients for a Puppet server running on Linux. I have, and I write everything down whenever I make some new configurations. So here’s my notes on configuring Windows Puppet clients for Ubuntu Puppet server. Don’t forget to check the official guides.

Test environment:
Ubuntu 12.10
Windows 7 64-bit
Puppet 2.7.18
Puppet agent for Windows 3.1.0-rc2

My hostnames in this guide are as follows:

Puppetmaster server = puppetserver.local
Windows client = henri-pc

I’m assuming you have puppet server configured. Check this tutorial if you don’t.

Ping pong

Make sure that your master and agent machines can reach each other.
On windows machine:
ping puppetserver.local

On Linux machine:
ping henri-pc.local

If you can’t ping your puppet server by hostname, you should add the hostname to your windows hosts file:
C:\Windows\System32\drivers\etc\hosts

Installation

Download Puppet for Windows:
https://downloads.puppetlabs.com/windows/

I used puppet-3.1.0-rc2.msi:
https://downloads.puppetlabs.com/windows/puppet-3.1.0-rc2.msi

You can install the Puppet client by just running the installer or by running this command:

msiexec /qn /i puppet-3.1.0-rc2.msi PUPPET_MASTER_SERVER=puppetserver.local

Replace puppetserver.local with the hostname of your puppetmaster server.
Replace puppet-3.1.0-rc2.msi with your puppet installer.

Server config

On the server, check that you got a certificate request and sign it:
sudo puppet cert --list
sudo puppet cert --sign --all

winpup4

Create a test module:
/etc/puppet/modules/wintest/manifests/init.pp

class wintest { file { 'c:/hello.txt': content => 'Hello master!' } }

Add the windows machine to your site.pp manifest:

/etc/puppet/manifests/site.pp

node 'henri-pc.local' { include wintest }

It works!

Now you can wait for the agent to fetch the module or you can force it by running the puppet agent from the windows start menu or by restarting the puppet agent service.

If everything went fine, you should have hello.txt file on your windows machine.
c:\hello.txt

There’s another Puppet module (nsclient++) for Windows on our github:
https://github.com/awaseroot/awaseroot/tree/master/puppet/modules/nscp

It doesn’t work!

If you have problems:
Is puppet agent service running?

winpup6

Can Windows host ping the puppet master?

winpup7

Can puppet master ping windows?

winpup8

The hostnames are correct in windows puppet config and in site.pp?

Puppet config file for windows can be found here:
C:\ProgramData\PuppetLabs\puppet\etc\puppet.conf

Also check the /var/log/syslog for errors.
If you see this error (192.168.100.25 is my windows box):
Could not resolve 192.168.100.25: no name for 192.168.100.25

Add the ip to your /etc/hosts

192.168.100.25  henri-pc

Still having problems? Check the Event Viewer of your windows machine:
Event Viewer > Windows Logs > Application

If you see this error:
Couldn not send report: Server hostname ‘xxx.xxx.xxx.xxx’ did not match server certificate; expected one of …

Add the puppetmaster hostname to your windows machine’s hosts file:
C:\Windows\System32\drivers\etc\hosts

192.168.100.111 puppetserver

And make sure the hostname in the config is the same as above:
C:\ProgramData\PuppetLabs\puppet\etc\puppet.conf

[main]
server=puppetserver

Sources

PuppetLabs – Puppet on Windows: http://docs.puppetlabs.com/windows/index.html

About these ads

2 responses to “Puppet with Windows clients

  1. Pingback: Puppet Reading List | Tero Karvinen

  2. Pingback: Puppet Master with Windows and Linux slaves: “Hello Puppet” | School Work and Other Notes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: