saz/puppet-sudo — pull request #24 by nicwaller (2013-07-30 05:04:35+00:00)
Title: Feature hiera

Here is a pull request that corresponds to my request from issue #23. This adds a class called `sudo::allow` that makes it easy to create entries for users and/or groups using a built-in template.

```
class { 'sudo': }
class { 'sudo::allow':
add_users => ['jsmith', 'bjones'],
add_groups => ['wheel'],
}
```

But the **real** reason for adding this class is to provide a singleton for use with Hiera automatic parameter lookup in Puppet >= 3.0. This makes is extremely easy to specify a default list of users who can sudo at one level, then either append or override at a higher level of the hierarchy. For example...

common.yaml
```
classes:
- sudo
- sudo::allow
sudo::allow::add_groups:
- wheel
```

department/marketing.yaml
```
sudo::allow::add_groups:
- marketing_admins
```

node/restricted.yaml
```
sudo::allow::replace_groups:
- max_security_admins
```