Writing Puppet Modules – Part 1 – Environment/Tools Setup

I have been busy recently and I haven’t had a chance to write anything for last few weeks. I have been asked by few people on how to implement , write modules for windows servers and applications. I have done some basics on Puppet configuration in past, but now this time started writing the puppet modules for windows. Since I’m not 100% sure, I have drafted a 4 weeks plan to master writing puppet modules for windows.

 The first part is also about the platform, Tools, Environment and setup required to accomplish the training in writing the puppet modules

 Source Control : https://github.com/mani0070/dipuppet

Editor : Geppetto (https://docs.puppetlabs.com/geppetto/latest/)

Windows Azure account (http://azure.microsoft.com/en-gb/pricing/free-trial/)

Windows 10 (http://windows.microsoft.com/en-us/windows-10/about)

Hyper-V (https://technet.microsoft.com/library/hh831531.aspx)

Vagrant (https://www.vagrantup.com/)

Windows 7/8.1 desktop/laptop Machine

 Step-by-Step

  • Get an github account created and create a repository (example dipuppet)
  • Download the Geppetto editor from the above location and extract the zip content into a folder of your choice as shown below


  • Now you can create a shortcut for geppetto.exe into your task bar for your convenience


  • Now, when launching the Geppetto, select the workspace location of your choice this folder will contain all the files you are going to work on
  • Click File->New->Project and select the puppet module project then Click Next


  • On clicking finish , below project structure will be created


  • Now, the highlighted file called metadata.json contains all the information regarding the module we creating. Information like Dependencies, Operating system required , Name, author , source location etc [This is mandatory when publishing the puppet modules]

    Note: More, detailed information is available under http://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#write-a-metadatajson-file

  • First thing is we have added some dependencies as shown below


  • Now, let’s look at the manifests folder which contains a init.pp file. This file will contain the class with the name of the module. As shown below


    Note: Any manifests file we create, will contain the class which matches the name of the .pp file.

    Now, we have everything to get started with the module. In the next post let’s have a look at writing few lines of code and prepare our test environment for testing our modules.

 Puppet are great on Linux but now on Windows too 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.