What Is the Forge?
The Puppet Forge (forge.puppet.com) is the public site for sharing modules. A module on the Forge is a ready-made component, such as 'manage Apache' or 'manage PostgreSQL'. Using a good module saves weeks of work and gives you code that others test.
Choosing a Good Module
| Check | Why |
|---|---|
| Maintainer and badges | Look for Supported, Approved or Partner labels, or a well-known community maintainer such as Vox Pupuli |
| Last release date | Old modules may break on new Puppet or OS versions |
| Operating system support | The metadata lists tested OS versions |
| Puppet version range | Check requirements for your Puppet version (8.x) |
| Open issues and pull requests | Show how alive the project is |
| README quality and examples | A good module documents every parameter |
| Dependencies | Fewer dependencies mean fewer surprises |
| Licence | Make sure it fits your company |
voxpupuli on GitHub, published as puppet/... on the Forge). Modules by puppetlabs are still published too. Always check the current owner and README.
Install a Module
In real projects you do not run puppet module install on servers. You list modules in a Puppetfile and let r10k or Code Manager deploy them (see the Modules lessons).
puppetlabs-stdlib: The Standard Library
stdlib is a must-have. It adds many functions, data types and the file_line resource. Most other modules depend on it.
ensure_packages(['git']) instead of package { 'git': } in modules. If two classes both ask for git, there is no duplicate declaration error.
puppetlabs-concat: Build a File from Pieces
Many modules (for example, HAProxy) use concat so different classes can add their own lines to one file.
puppetlabs-apt and Repositories
On Red Hat family systems, use the built-in yumrepo type, or the puppet-yum module for helpers.
puppet-archive: Download and Extract
Other Commonly Used Modules
| Module | Use it for |
|---|---|
puppetlabs-firewall | iptables/nftables rules as resources (firewall { '100 allow http': dport => 80, proto => tcp, jump => accept }) |
puppet-firewalld or puppet-nftables | Modern firewall management |
puppetlabs-vcsrepo | Clone Git repositories to a path (vcsrepo { '/opt/app': provider => git, source => '...', revision => 'v1.2' }) |
puppet-systemd | Unit files, drop-ins and timers |
puppetlabs-docker | Docker engine, images, containers |
puppetlabs-postgresql, puppetlabs-mysql | Database servers, users, grants |
puppetlabs-apache, puppet-nginx | Web servers and virtual hosts |
puppetlabs-ntp or puppet-chrony | Time sync |
puppet-logrotate, puppet-cron | Log rotation and cron helpers |
puppetlabs-accounts | Users and groups from a hash |
puppet-prometheus, puppet-grafana | Monitoring stack |
puppetlabs-powershell, puppetlabs-registry, puppetlabs-dsc_lite | Windows management |
puppet-selinux | SELinux modes, booleans, ports |
puppetlabs-translate, puppetlabs-inifile | Edit INI-style files (ini_setting) |
Learning a Module Quickly
- Read the README top to bottom, especially the Usage and Reference sections
- Look at
REFERENCE.mdfor every class, parameter and default - Read
manifests/init.ppto see what the main class does - Look at
data/andhiera.yamlof the module for defaults per OS - Try the module in a throwaway VM with
puppet applyfirst
Wrap Modules in Your Own Profiles
Do not scatter calls to Forge modules all over your code. Wrap them in a profile class (see the roles and profiles lesson). That gives you one place to change behaviour and keeps your data in Hiera.
Practice Tasks
- Search the Forge for a module for HAProxy and check its badges, last release and supported OS list
- Install
puppetlabs-stdliband useensure_packagesandfile_linein a manifest - Use
concatto build/etc/hosts.extrafrom three fragments - Write a manifest using
archiveto download and extract any small tarball - Open a module's
REFERENCE.mdand list the parameters of its main class
Conclusion
Reuse before you write. Pick modules with a clear maintainer, recent releases and OS support, pin versions in a Puppetfile, and wrap them inside your own profile classes.

