Puppet Class: sudo

Defined in:
manifests/init.pp

Summary

Installs and configures sudo

Overview

Examples:

include sudo

Parameters:

  • install_package (Boolean) (defaults to: true)

    Determines if package for sudo should be installed.

  • package_name (String[1]) (defaults to: 'sudo')

    The name of the package to install.

  • package_ensure (String[1]) (defaults to: 'present')

    What value for ‘ensure’ to pass to resource type package.

  • package_provider (Optional[String]) (defaults to: undef)

    Override the default package provider.

  • sudoers (Stdlib::Unixpath) (defaults to: '/etc/sudoers')

    The main configuration file for the sudoers plugin. Default is /usr/local/etc/sudoers on FreeBSD, and /etc/sudoers on all other osfamilies.

  • manage_sudoers (Boolean) (defaults to: true)

    Manage the primary sudoers file if true.

  • includedir (Stdlib::Unixpath) (defaults to: '/etc/sudoers.d')

    The dropin directory for additional config files. Default is /usr/local/etc/sudoers.d on FreeBSD, and /etc/sudoers.d on all other osfamilies.

  • purge_includedir (Boolean) (defaults to: false)

    Purge any files in $includedir not explicitly managed by this class.

  • includedir_mode (Stdlib::Filemode) (defaults to: '0750')

    The filemode for the includedir

  • defaultmode (Stdlib::Filemode) (defaults to: '0440')

    The mode for created files.

  • owner (String[1]) (defaults to: 'root')

    The owner for sudo configfiles.

  • group (String[1]) (defaults to: 'root')

    The group for sudo configfiles.

  • use_includedir (Boolean) (defaults to: true)

    Add entry for includedir to main sudoer file if true.

  • conf (Hash[String,Hash[String,Optional[Any]]]) (defaults to: { '_sudoers' => {} })

    This is the most important control-structure for configuring sudo. It consists of a hash with the first level key is the destination file (under $includedir), or the special value “_sudoers” for the content of the master sudoers file. There is a default content for this that differs for some os-families.

Author:

  • Christer Ekholm



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'manifests/init.pp', line 44

class sudo (
  Boolean $install_package           = true,
  String[1] $package_name            = 'sudo',
  String[1] $package_ensure          = 'present',
  Optional[String] $package_provider = undef,
  Stdlib::Unixpath $sudoers          = '/etc/sudoers',
  Boolean $manage_sudoers            = true,
  Stdlib::Unixpath $includedir       = '/etc/sudoers.d',
  Boolean $purge_includedir          = false,
  Stdlib::Filemode $includedir_mode  = '0750',
  Stdlib::Filemode $defaultmode      = '0440',
  String[1] $owner                   = 'root',
  String[1] $group                   = 'root',
  Boolean $use_includedir            = true,
  Hash[String,Hash[String,Optional[Any]]] $conf = { '_sudoers' => {} }
) {
  contain sudo::config
  if $install_package {
    contain sudo::install
    Class['sudo::install']
    -> Class['sudo::config']
  }
}