- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with sudo
- Usage - Configuration options and additional functionality
- Reference - Parameter reference
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This module manages the sudo package, the main /etc/sudoers file and
configuration fragments in /etc/sudoers.d/.
- The sudo package (optional, see
package_manage). /etc/sudoers, rendered from the module's EPP template.- The
/etc/sudoers.d/directory. By default it is purged, so any fragment not managed by Puppet is removed (seeconfig_dir_purge).
Include the main sudo class. The defaults give a working /etc/sudoers
that includes /etc/sudoers.d/.
include sudoEach entry in sudo::sudoers becomes a sudo::fragment, written to
/etc/sudoers.d/<priority>_<name>:
sudo::sudoers:
'admins':
content: '%admins ALL=(ALL) NOPASSWD: ALL'
'userX':
content: 'USERX ALL=(ALL) ALL'sudo::fragment { 'backup':
priority => 20,
content => 'backup ALL=(root) NOPASSWD: /usr/local/bin/backup.sh',
}Set include_libsudo_vas to load the libsudo_vas group plugin. When the
sudo_version fact is 1.8.15 or newer, always_query_group_plugin is then
enabled automatically, so unknown system groups are resolved through the
plugin.
This module is documented via puppet-strings. See REFERENCE.md for the full list of classes, defined types and all of their parameters.
This module supports Puppet 8 (see metadata.json for the exact requirement).
It is tested against the operating systems listed below. The supported OS
matrix is defined in metadata.json, and CI runs pdk validate and
pdk test unit on Puppet 8 via GitHub Actions (see .github/workflows/).
- Debian 11, 12
- RedHat (EL) 7, 8, 9, 10
- Rocky 8, 9, 10
- SLES 12, 15
- Ubuntu 20.04, 22.04, 24.04
Other operating systems might be supported by configuring the module with the correct parameters.
Contributions are welcome. This module is managed with PDK. Before submitting changes, run the validators and unit tests:
pdk validate
pdk test unitPlease keep REFERENCE.md in sync by regenerating it from the class
documentation when parameters change:
pdk bundle exec puppet strings generate --format markdown