summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorDan Bode <dan@bodepd.com>2010-04-06 10:25:31 -0500
committerDan Bode <dan@bodepd.com>2010-04-06 10:25:31 -0500
commit550e760b2a3319d1c39f4f5f0c9296501a756e1d (patch)
tree578ea3af1a61aa0438e634662e06d24aed593d94 /manifests
parent598f1c19cea15f70907c4bd426ab6fe69675ce87 (diff)
added defined resouce types for the 3 kinds of sudoers lines
Diffstat (limited to 'manifests')
-rw-r--r--manifests/alias.pp19
-rw-r--r--manifests/defaults.pp11
-rw-r--r--manifests/spec.pp21
-rw-r--r--manifests/tests/sudo.pp1
4 files changed, 51 insertions, 1 deletions
diff --git a/manifests/alias.pp b/manifests/alias.pp
new file mode 100644
index 0000000..6127a23
--- /dev/null
+++ b/manifests/alias.pp
@@ -0,0 +1,19 @@
+#
+# defined resource that wraps the functionality for creating
+# aliases with the sudoers type
+# * name - name of alias
+# * type - type of sudo alias can be (Cmnd|Host|User|Runas)(_Alias)?
+# * items - list of things to be aliased.
+define sudo::alias(
+ $ensure=present,
+ $sudo_alias, $items,
+ $target='/etc/sudoers'
+) {
+ sudoers { $name:
+ type => 'alias',
+ ensure => $ensure,
+ sudo_alias => $sudo_alias,
+ items => $items,
+ target => $target,
+ }
+}
diff --git a/manifests/defaults.pp b/manifests/defaults.pp
new file mode 100644
index 0000000..65776f0
--- /dev/null
+++ b/manifests/defaults.pp
@@ -0,0 +1,11 @@
+#
+# define that wraps sudoers functionality of sudores
+#
+define sudo::defaults( $ensure='present', $parameters, $target='/etc/sudoers') {
+ sudoers { $name:
+ type => 'default',
+ ensure => $ensure,
+ parameters => $parameters,
+ target => $target,
+ }
+}
diff --git a/manifests/spec.pp b/manifests/spec.pp
new file mode 100644
index 0000000..1a75afd
--- /dev/null
+++ b/manifests/spec.pp
@@ -0,0 +1,21 @@
+# Defined resoruce to manage sudoers user specification lines.
+#
+# attributes:
+# * name - arbitrary string used to determine uniquemenss
+# * users - list of users
+# * hosts - list of hosts
+# * commands - list of commands
+define sudo::spec(
+ $ensure=present,
+ $users, $hosts, $commands,
+ $target='/etc/sudoers'
+) {
+ sudoers { $name:
+ type => 'user_spec',
+ ensure => $ensure,
+ users => $users,
+ hosts => $hosts,
+ commands => $commands,
+ target => $target,
+ }
+}
diff --git a/manifests/tests/sudo.pp b/manifests/tests/sudo.pp
deleted file mode 100644
index a27b70b..0000000
--- a/manifests/tests/sudo.pp
+++ /dev/null
@@ -1 +0,0 @@
-include sudo