Install Puppet Development Kit (PDK) as your first step in creating and testing Puppet modules.

System requirements

Ensure that you're using PDK with one of the supported operating systems.

PDK is compatible with *nix, Windows, and Mac OS X systems. For detailed version compatibility, see the table below. By default, PDK installs to the following locations:
  • On *nix and Mac OS X systems: /opt/puppetlabs/pdk/

  • On Windows systems: C:\Program Files\Puppet Labs\DevelopmentKit

PDK uses Puppet 4 and later. Modules created with PDK work with all Puppet and Ruby version combinations currently under maintenance. See open source Puppet and Puppet Enterprise lifecycle pages for details. PDK functions, such as creating classes, testing, and validation, are supported only on modules created or converted with PDK.
Operating systemVersionsArchPackage type
Red Hat Enterprise Linux (RHEL) 6, 7x86_64RPM
CentOS 6, 7x86_64RPM
Oracle Linux 6, 7x86_64RPM
Scientific Linux 6, 7x86_64RPM
SUSE Linux Enterprise Server 11, 12x86_64N/A
Ubuntu 14.04, 16.04x86_64DEB
Windows (Consumer OS)7, 8.1, 10x86_64MSI
Windows (Server OS)2008r2, 2012, 2012r2, 2012r2 Core, and 2016x86_64MSI
Mac OS X 10.11, 10.12x86_64N/A
Tip: On Windows, PowerShell version 2.0 or greater is supported, but we recommend 4.0 or greater.

PDK tools

PDK includes a variety of development and testing tools built by Puppet and by the Puppet open source community. 

ToolDescription
metadata-json-lintValidates and lints metadata.json files in modules against Puppet module metadata style guidelines.
pdkTool to generate and test modules and module content, such as classes, from the command line.
puppet-lintChecks your Puppet code against the recommendations in the Puppet Language style guide.
puppet-syntaxChecks for correct syntax in Puppet manifests.
puppetlabs_spec_helperProvides classes, methods, and Rake tasks to help with spec testing Puppet code.
rspec-puppetTests the behavior of Puppet when it compiles your manifests into a catalog of Puppet resources.
rspec-puppet-factsAdds support for running rspec-puppet tests against the facts for your supported operating systems.

Install PDK on Linux

On *nix systems, you can install PDK either from a downloadable package or from a repository.

Install PDK from the package

Download and install the PDK package on Red Hat and Debian based systems. 

  1. Download the package for your operating system from the PDK download site.
  2. Install the package using the command appropriate to your system:
    OptionDescription
    On RPM-based (such as Red Hat or CentOS) systems: sudo rpm -ivh pdk-<VERSION>-<PLATFORM>.rpm
    On Debian (such as Debian or Ubuntu) systems: sudo dpkg -i pdk-<VERSION>-<PLATFORM>.deb

Install PDK from the repository

Download and install the PDK repository for your platform with your package manager. 

Before you begin

Enable the Puppet platform repositories. See the documentation for your version of Puppet.

CAUTION: If you're installing PDK on a system managed by PE, download and install the package from the Puppet download site to avoid agent version conflicts. See installing PDK packages on Linux for more information. 

  1. Install the package using the command appropriate to your system.
    OptionDescription
    On RPM-based (such as Red Hat or CentOS) systems: sudo yum install pdk
    On Debian (such as Debian or Ubuntu) systems: sudo apt-get install pdk
  2. Open a terminal to re-source your shell profile and make PDK available to your PATH.

Install PDK on Mac OS X

Download and install the PDK package on Mac OS X .

  1. Download the package for your operating system from the PDK download site.
  2. Double click on the downloaded package to install.
  3. Open a terminal to re-source your shell profile and make PDK available to your PATH.

Install PDK on Windows

Download and install PDK for Windows systems.

  1. Download the package for your operating system from the PDK download site.
  2. Double click on the downloaded package to install.
  3. Open a new PowerShell window to re-source your profile and make PDK available to your PATH.

On PowerShell 4.0 or later, PDK loads automatically and pdk commands are available to the prompt. On PowerShell 2.0 or 3.0, you'll need to add the PowerShell module to your profile.

Tip: If you encounter execution policy restriction errors when you try to run pdk commands, see troubleshooting for help.

Add the PDK module to PowerShell

PowerShell versions 2.0 and 3.0 cannot automatically discover and load the PDK module, so you'll need to add it manually. 

To allow PowerShell to load PDK, add the module to your PowerShell profile.

  1. Add the following line to your PowerShell profile:

    `Import-Module -Name "$($env:ProgramFiles)\WindowsPowerShell\Modules\PuppetDevelopmentKit"`

  2. Close and re-open the PowerShell window to re-source your profile.

PDK will now automatically load every time you open PowerShell.

Setting up PDK behind a proxy

If you are using PDK behind a proxy, you must set environment variables to enable PDK to communicate.

You can set these variables on the command line before each working session, or you can add them to your system configuration, which varies depending on the operating system.

On *nix or Mac OS X systems, run:
export http_proxy="http://user:[email protected]:port"

export https_proxy="http://user:[email protected]:port"
On Windows systems, run:
$env:http_proxy="http://user:[email protected]:port"

$env:https_proxy="http://user:[email protected]:port"
Back to top