From 9329d9cba0f05557783226539a081f003d63c734 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Tue, 16 Mar 2010 07:34:16 -0500 Subject: checked that there are no users named defaults --- README | 8 ++++---- lib/puppet/type/sudoers.rb | 9 +++++++++ 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 -- cgit v1.2.3