sudoers

A simple puppet recipe for managing the /etc/sudoers file.

# the following directories (assuming that /etc/puppet is your topdir - this is default on most installations)

/etc/puppet

/etc/puppet/modules

/etc/puppet/modules/sudo

/etc/puppet/modules/sudo/manifests

# the sudo module init file:

/etc/puppet/modules/sudo/manifests/init.pp

# This class will define the /etc/sudoers file, it's ownership & perms, along with its source.

# the order of source location:

# 1. if sudoers.<hostname> exists, then use it.

# 2. else see if sudoers.<OS> exists, if so, use it.

# 3. otherwise just use the file sudoers.

class sudo {

file { "/etc/sudoers":

owner => root,

group => root,

mode => 0440,

source => [

"puppet:///sudo/sudoers.$host",

"puppet:///sudo/sudoers.$operatingsystem",

"puppet:///sudo/sudoers"

]

}

}

# the sudo module files directory - this is where we will keep the fileserver files.

/etc/puppet/modules/sudo/files

# these are all /etc/sudoers files, each either host-specific, OS-specific, or default.

/etc/puppet/modules/sudo/files/sudoers.<some-hostname>

/etc/puppet/modules/sudo/files/sudoers.CentOS

/etc/puppet/modules/sudo/files/sudoers.Debian

/etc/puppet/modules/sudo/files/sudoers