(MAINT) Switch default pdk-templates branch to `main`
|2 weeks ago|
|.github||1 year ago|
|bin||3 years ago|
|docs||2 months ago|
|exe||3 years ago|
|ext||11 months ago|
|lib||2 weeks ago|
|locales||5 months ago|
|package-testing||2 months ago|
|rakelib||1 year ago|
|spec||2 weeks ago|
|.dependency_decisions.yml||1 year ago|
|.gitignore||1 year ago|
|.rspec||3 years ago|
|.rubocop.yml||8 months ago|
|.rubocop_todo.yml||1 year ago|
|.travis.yml||8 months ago|
|CHANGELOG.md||3 months ago|
|CODEOWNERS||3 months ago|
|CONTRIBUTING.md||1 year ago|
|Gemfile||6 months ago|
|LICENSE||3 years ago|
|NOTICE||3 years ago|
|README.md||1 year ago|
|Rakefile||10 months ago|
|appveyor.yml||10 months ago|
|pdk.gemspec||3 months ago|
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:
|metadata-json-lint||Validates and lints
|pdk||Command line tool for generating and testing modules|
|puppet-lint||Checks your Puppet code against the recommendations in the Puppet Language style guide.|
|puppet-syntax||Checks for correct syntax in Puppet manifests, templates, and Hiera YAML.|
|puppetlabs_spec_helper||Provides classes, methods, and Rake tasks to help with spec testing Puppet code.|
|rspec-puppet||Tests the behavior of Puppet when it compiles your manifests into a catalog of Puppet resources.|
|rspec-puppet-facts||Adds support for running rspec-puppet tests against the facts for your supported operating systems.|
|puppet-debugger||Provides a REPL based debugger console.|
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.
For complete installation information, see the PDK documentation.
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.
Generates the basic components of a module and set up an infrastructure for testing it with PDK.
pdk new modulecommand, 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.
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.
pdk new class class_name
PDK creates the new class manifest and a test file (as
class_name_spec.rb) in your module’s
To generate a defined type in your module, use the
pdk new defined_type command, specifying the name of your new defined type.
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
To generate a task in your module, use the
pdk new task command, specifying the name of your new task.
pdk new task task_name
PDK creates the new task file and metadata.
PDK can validate the well-formedness of the module and style and syntax of its files.
This command validates the metadata, Puppet code syntax and style, and Ruby syntax and style for the entire module.
In the module’s directory, run unit tests with:
pdk test unit
This command runs all available unit tests.
The pdk console command executes a session of the puppet debugger when inside a module and allows for exploration of puppet code. See the official puppet debugger site for more info and the official docs site here.
To use, execute
pdk console from inside your module directory. You can also supply the
--puppet-dev to swap out the puppet version when using the console.
Example (from within a module):
pdk console --puppet-version=5
pdk console --pe-version=2018.1
pdk console command will also pass through any puppet debugger arguments you wish to use.
pdk console --no-facterdb
pdk console --play https://gist.github.com/logicminds/4f6bcfd723c92aad1f01f6a800319fa4
pdk console -e "md5('sdfasdfasdf')" --run-once --quiet
pdk console -h for a further explanation of pass through arguments.
If you receive the following error you do not have the puppet-debugger gem installed.
pdk console -h Error: Unknown Puppet subcommand 'debugger' See 'puppet help' for help on available puppet subcommands
To fix this you will need to add the following entry to your .sync.yml file and run pdk update:
Gemfile: required: ":development": - gem: puppet-debugger version: "~> 0.14"
NOTE: The puppet-debugger gem has been added to the puppet-module-* gems, so once you get the gem update you no longer need the .sync.yml entry.
This command executes arbitrary commands in a bundler context within the module you’re currently working on. Arguments to this command are passed straight through to bundler. This command is experimental and can lead to errors that can’t be resolved by PDK itself.
PDK Version Compatibility: Modules created with PDK validate against and run on all Puppet and Ruby version combinations currently under maintenance (see https://docs.puppet.com/puppet/latest/about_agent.html and https://puppet.com/misc/puppet-enterprise-lifecycle)
PDK encourages community contributions. See the CONTRIBUTING.md file for development notes.
To contact us with questions: firstname.lastname@example.org