Module Development Tooling¶
For years, the standard tool for developing and testing Puppet modules was the Puppet Development Kit (PDK). After PDK moved to a closed-source model, the Vox Pupuli community built open replacements. This course uses two complementary tools:
- jig — a Go-based reimplementation of PDK. It ships as a single static binary with no Ruby runtime and handles scaffolding modules, creating module components, validating style and syntax, running unit tests, and building/releasing modules.
- voxbox — a container
image bundling the full Vox Pupuli testing toolchain (OpenVox, OpenFact,
hiera-eyaml,r10k,rubocop,voxpupuli-test,voxpupuli-acceptance, and more). Its entrypoint israke, so it runs a module's complete test suite via Podman or Docker without installing any Ruby gems locally.
Use jig for day-to-day scaffolding and quick checks; reach for voxbox when
you want the full test matrix (including acceptance tests) in a reproducible
environment, especially in CI.
Installing the tools¶
jig is distributed as a static binary — download a release from the
jig repository, or build it from source with
Go. Because it has no runtime dependencies, you can drop the binary anywhere on
your PATH.
voxbox requires only Podman or Docker; the image is pulled automatically the
first time you run it:
Using jig¶
Create a new module (the --skip-interview flag accepts defaults
non-interactively):
Create a new class within a module:
jig can scaffold the other module components too — jig new defined_type,
jig new task, jig new fact, jig new function, and jig new provider — all
of which you will use later in this course.
Using voxbox¶
From inside a module directory, mount it into voxbox and call any rake task.
List the available tasks:
Run the unit tests (rspec-puppet):
Substitute docker for podman if that's what you have, and drop the :Z
SELinux label on systems without SELinux.