All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Optional[String[1]] $sudogroup = undef,
3 Boolean $root_may_sudo = true,
4 Optional[Hash] $generic = undef,
5 Optional[Hash] $user = undef,
6 Optional[Hash] $host = undef,
7 Optional[Hash] $runas = undef,
8 Optional[Hash] $cmnd = undef,
10 $netfacts = $facts[networking] ? { undef => $facts, default => $facts[networking] }
11 sudo::alias { "LOCALHOST":
20 $sudogroup_target = "00-sudogroup"
26 sudo::rule { "sudogroup":
29 require => Sudo::Alias["LOCALHOST"],
30 what => "PASSWD: ALL",
31 target => "$sudogroup_target",
32 comment => "Members of the ${sudogroup} group can use sudo (with password)",
37 $rootsudo_target = "00-root_may_sudo"
39 sudo::option { "syslog":
43 target => "$rootsudo_target",
44 comment => "No need to log root usage of sudo",
46 sudo::rule { "root_may_sudo":
49 require => Sudo::Alias["LOCALHOST"],
50 what => "NOPASSWD: ALL",
51 target => "$rootsudo_target",
52 comment => "root may inadvertedly run sudo, so let them:",
57 concat::fragment { "sudo::defaults::generic comment":
58 target => "sudoers_file_$sudo::default_target",
60 content => "\n# Generated from the sudo::defaults::generic class parameter:\n",
62 $generic.each | $param, $value | {
63 sudo::option { "$param":
66 newline_before => false,
67 require => Concat::Fragment["sudo::defaults::generic comment"],
70 concat::fragment { "sudo::defaults::generic end":
71 target => "sudoers_file_$sudo::default_target",
73 content => "# End sudo::defaults::generic class parameters\n",
77 $context_hash = {"user"=>$user,"host"=>$host,"runas"=>$runas,"cmnd"=>$cmnd}
78 $context_hash.keys.each | $index, $context | {
79 $defaults = $context_hash[$context]
81 concat::fragment { "sudo::defaults::${context} comment":
82 target => "sudoers_$default_target",
83 order => 17 + $index * 3,
84 content => "\n# Generated from the sudo::defaults::${context} class parameter:\n",
86 $defaults.each | $list, $items | {
87 $items.each | $param, $value | {
88 sudo::option { "${context}_${list}_${param}":
93 order => 18 + $index * 3,
94 newline_before => false,
98 concat::fragment { "sudo::defaults::${context} end":
99 target => "sudoers_$default_target",
100 order => 19 + $index * 3,
101 content => "# End sudo::defaults::${context} class parameters\n",