Permalink
Browse files

Added user resource attr to mac_os_x_userdefaults LWRP.

  • Loading branch information...
1 parent 5ed2619 commit 20f031487823f4d2c5b13b13fb300a9b3babf1a0 @patcon patcon committed Jul 28, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −0 README.md
  2. +0 −1 metadata.rb
  3. +3 −1 providers/userdefaults.rb
  4. +1 −0 resources/userdefaults.rb
View
@@ -30,6 +30,7 @@ Manage the Mac OS X user defaults(1) system. The parameters to the resource are
- key: The preference key. Required.
- value: The value of the key. Required.
- type: Value type of the preference key.
+- user: User for which to set the default.
- sudo: Set to true if the setting requires privileged access to modify. Default false.
`value` settings of `1`, `TRUE`, `true`, `YES` or `yes` are treated as true by defaults(1), and are handled in the provider.
View
@@ -4,4 +4,3 @@
description "Manage OS X user defaults settings"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.3.6"
-supports "mac_os_x"
@@ -65,6 +65,8 @@ def load_current_resource
cmd << "-#{type}" if type
cmd << value
- execute cmd.join(' ')
+ execute cmd.join(' ') do
+ user new_resource.user unless new_resource.user.nil?
+ end
end
end
@@ -24,6 +24,7 @@
attribute :key, :kind_of => String, :default => nil
attribute :value, :kind_of => [Integer,String,TrueClass,FalseClass,Hash], :default => nil, :required => true
attribute :type, :kind_of => String, :default => nil
+attribute :user, :kind_of => String, :default => nil
attribute :sudo, :kind_of => [TrueClass, FalseClass], :default => false
attribute :is_set, :kind_of => [TrueClass, FalseClass], :default => false

0 comments on commit 20f0314

Please sign in to comment.