Skip to main content
Puppet

Installing the Windows Puppet Agent

By March 10, 2016September 12th, 2022No Comments

windows puppet agentInstalling the Windows Puppet Agent is very easy. This is supplied as an MSI file that can be downloaded directly from Puppetlabs. There are many versions that are available and it id often best to download the latest version that matches your platform. This would be 32 bit or 64 bit. The file is quite small, less than 30M currently, so you should not have to wait too long to start the install.


The installation asks just two question, the path to the install location and the FQDN of the puppet server. We can usually accept the default for the install location. The server FQDN though should match the name used to access your puppet server. If you don’t have a puppet server you can leave it as the default puppet and change it later if required.

Once install we can start to see some of the benefits of Puppet and how it is Operating System agnostic. It dis a declarative language in the way that it says what should be done and now how it should be done. The commands and code we execute is the same on Linux as it is on Windows.

If we open a command or PowerShell prompt as Administrator we can see the version of the client that we are using:

c:> puppet agent --version

We can take this little further to create a simple manifest to show how to create a local host record. Manifests are text files describing the desired state of a system. They will normally be located on the Puppet Server but we can create and apply them locally for testing. In Windows, the local hosts file is located at c:\windows\system32\drivers\etc\hosts and on Linux it is /etc/hosts. The manifest though will work on either system as it does not care about the location.

The following file should be created as %USERPROFILE%\Documents\host.pp:

host { 'myhost.example.local':
  ip => '127.0.0.1',
}

This makes use of the host resource type in the Puppet Language and creates a new record for the host my host.example.local with an IP Address of 127.0.0.1. We can run this code with the following command line:

c:> puppet apply -t %USERPROFILE%/Documents/host.pp

11-03-2016 09-48-16

Once this code has run then the record will be added to the local host file that is correct for the OS that the agent runs on.