Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added user resource attr to mac_os_x_userdefaults LWRP.

  • Loading branch information...
commit 20f031487823f4d2c5b13b13fb300a9b3babf1a0 1 parent 5ed2619
@patcon patcon authored
View
1  README.md
@@ -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
1  metadata.rb
@@ -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"
View
4 providers/userdefaults.rb
@@ -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
View
1  resources/userdefaults.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.