summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRishi Kumar Chawda <rishichawda@users.noreply.github.com>2023-03-08 01:58:55 +0530
committerGitHub <noreply@github.com>2023-03-07 15:28:55 -0500
commit364813a324b71cc4ee38238e096216b27491d6bb (patch)
tree61a2504e4c7e4355f00b5114dedc3931e873d0f4 /lib
parent8a78e532bd87a525bab5e414826aa31f13ae3125 (diff)
downloadchef-364813a324b71cc4ee38238e096216b27491d6bb.tar.gz
set default values for user and host on userdefaults (#12791)
* set default values for user and host on userdefaults Signed-off-by: rishichawda <rishichawda@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/macos_userdefaults.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb
index 7559990d3a..558188c932 100644
--- a/lib/chef/resource/macos_userdefaults.rb
+++ b/lib/chef/resource/macos_userdefaults.rb
@@ -50,15 +50,17 @@ class Chef
end
```
- **Specifying the type of a key to skip automatic type detection**
+ **Setting a value for specific user and hosts**
```ruby
- macos_userdefaults 'Finder expanded save dialogs' do
- key 'NSNavPanelExpandedStateForSaveMode'
- value 'TRUE'
- type 'bool'
+ macos_userdefaults 'Enable macOS firewall' do
+ key 'globalstate'
+ value 1
+ user 'jane'
+ host :current
end
```
+
DOC
property :domain, String,
@@ -79,6 +81,7 @@ class Chef
property :host, [String, Symbol],
description: "Set either :current, :all or a hostname to set the user default at the host level.",
+ default: :all,
desired_state: false,
introduced: "16.3"
@@ -94,6 +97,7 @@ class Chef
property :user, [String, Symbol],
description: "The system user that the default will be applied to. Set :current for current user, :all for all users or pass a valid username",
+ default: :current,
desired_state: false
property :sudo, [TrueClass, FalseClass],