Use this command to install Puppet Development Kit:
winget install --id=Puppet.pdk -e
The Puppet Development Kit (PDK) includes key Puppet code development and testing tools for Linux, Windows, and OS X workstations, so you can install one package with the tools you need to create and validate new modules.
PDK includes testing tools, a complete module skeleton, and command line tools to help you create, validate, and run tests on Puppet modules. PDK also includes all dependencies needed for its use.
Puppet Development Kit (PDK) is a toolset designed to simplify Puppet module development by providing a consistent and repeatable environment for building, testing, and packaging modules.
Key Features:
Standardized project structure for Puppet modules
Built-in testing framework with support for unit, integration, and acceptance tests
Integration with static analysis tools like RuboCop for code quality assurance
Cross-platform compatibility across multiple operating systems
Support for module versioning and semantic versioning guidelines
Access to documentation and best practices directly from the CLI
Audience & Benefit:
Ideal for Puppet developers and system administrators who want to create high-quality, maintainable Puppet modules. With PDK, users can ensure their modules are consistent, well-tested, and compliant with Puppet community standards.
The Puppet Development Kit (PDK) includes key Puppet code development and testing tools for Linux, Windows, and OS X workstations, so you can install one package with the tools you need to create and validate new modules.
PDK includes testing tools, a complete module skeleton, and command line tools to help you create, validate, and run tests on Puppet modules. PDK also includes all dependencies needed for its use.
PDK includes the following tools:
Tool
Description
Owned by Puppet
facterdb
A gem that contains facts for Operating Systems.
N
metadata-json-lint
Validates and lints metadata.json files in modules against Puppet module metadata style guidelines.
N
pdk
Tool to generate and test modules and module content, such as classes, from the command line.
Y
puppet-lint
Checks your Puppet code against the recommendations in the Puppet language style guide.
Y
puppet-syntax
Checks for correct syntax in Puppet manifests, templates, and Hiera YAML.
N
puppetlabs_spec_helper
Provides classes, methods, and Rake tasks to help with spec testing Puppet code.
Tests the behavior of Puppet when it compiles your manifests into a catalog of Puppet resources.
Y
rspec-puppet-facts
Adds support for running rspec-puppet tests against the facts for your supported operating systems.
N
Installation
Download and install the newest package matching your platform from the download page. If you are using Windows, remember to close any open PowerShell windows.
PDK can generate modules and classes, validate module metadata, style, and syntax, and run unit tests. This README contains very basic usage information---for complete usage information, see the PDK documentation.
Generate a module
Generates the basic components of a module and set up an infrastructure for testing it with PDK.
Run the pdk new module command, specifying the name of the new module:
pdk new module my_module
This command asks a series of metadata questions and then generates the basic components of a new module.
Generate a class
To generate a class in your module, use the pdk new class command, specifying the name of your new class. To generate the main class of the module, which is defined in an init.pp file, give the class the same name as the module.
From the command line, in your module's directory, run:
pdk new class class_name
PDK creates the new class manifest and a test file (as class_name_spec.rb) in your module's /spec/classes directory.
Generate a defined type
To generate a defined type in your module, use the pdk new defined_type command, specifying the name of your new defined type.
From the command line, in your module's directory, run:
pdk new defined_type defined_type_name
PDK creates the new defined_type manifest and a test file (as defined_type_name_spec.rb) in your module's /spec/defines directory.
Generate a task
To generate a task in your module, use the pdk new task command, specifying the name of your new task.
From the command line, in your module's directory, run:
pdk new task task_name
PDK creates the new task file and metadata.
Validating a module
PDK can validate the well-formedness of the module and style and syntax of its files.
In the module's directory, run:
pdk validate
This command validates the metadata, Puppet code syntax and style, and Ruby syntax and style for the entire module.
PDK encourages community contributions. See the CONTRIBUTING.md file for development notes.
Known Issues
Prevelant known issues with the PDK, for more detailed information, please check the PDK documentation on puppet.com.
v3.4.0
Moving forward, if you are using the installed version of the PDK, if you wish to utilize the inbuilt templates you will have to manually fix their permissions, either by changing their ownership to your local user or by setting them as a safe directory.
This codebase is licensed under Apache 2.0. However, the open source dependencies included in this codebase might be subject to other software licenses such as AGPL, GPL2.0, and MIT.