summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Bode <dan@bodepd.com>2010-03-16 07:34:16 -0500
committerDan Bode <dan@bodepd.com>2010-03-16 07:34:16 -0500
commit9329d9cba0f05557783226539a081f003d63c734 (patch)
tree1fcf87263c26fb64b951fa9b47aa9f01695b5778
parentbe21deec85ab9579844dc18240fe35b30308ae0f (diff)
checked that there are no users named defaults
-rw-r--r--README8
-rw-r--r--lib/puppet/type/sudoers.rb9
2 files changed, 13 insertions, 4 deletions
diff --git a/README b/README
index 566b40b..0ae948c 100644
--- a/README
+++ b/README
@@ -1,11 +1,11 @@
-This is a type and a provider for managing sudoers file.
+Type/provider for managing sudoers file.
-It seems to work pretty well.
+Examples of usage can be found in the tests directory. The type also has rdocs.
-lots of examples of usage can be found in the tests directory. The type also has rdocs.
+Sudoers supports ensure => (present|absent)
-TODO(stuff that I will fix before 0.1 release)
+*TODO(stuff that I hope to fix)
1. A user spec record that starts with Defaults will be parsed as a default. (this may not be resonable to fix)
2. I can probably set up autorequires on aliases in User Spec line, but this order would only be followed if both records were created.
diff --git a/lib/puppet/type/sudoers.rb b/lib/puppet/type/sudoers.rb
index dcb4cfe..e9805b9 100644
--- a/lib/puppet/type/sudoers.rb
+++ b/lib/puppet/type/sudoers.rb
@@ -9,6 +9,10 @@ License:: GPL3
The sudoers type supports managing individual lines from the sudoers file.
+Supports present/absent.
+
+supports purging.
+
= Record Types
There are 3 types of records that are supported:
@@ -117,6 +121,11 @@ Defaults@host x=y,one=1,two=2
# single user is namevar
newproperty(:users, :array_matching => :all) do
desc "list of users for user spec"
+ validate do |value|
+ if value =~ /^\s*Defaults/
+ raise Puppet::Error, 'Cannot specify user named Defaults in sudoers'
+ end
+ end
end
newproperty(:hosts, :array_matching => :all) do