diff options
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/resource/homebrew_package.rb | 31 | ||||
-rw-r--r-- | lib/chef/resource/kernel_module.rb | 15 | ||||
-rw-r--r-- | lib/chef/resource/plist.rb | 27 | ||||
-rw-r--r-- | lib/chef/resource/template.rb | 2 |
4 files changed, 68 insertions, 7 deletions
diff --git a/lib/chef/resource/homebrew_package.rb b/lib/chef/resource/homebrew_package.rb index 71a9ffde38..c3b34395f6 100644 --- a/lib/chef/resource/homebrew_package.rb +++ b/lib/chef/resource/homebrew_package.rb @@ -29,8 +29,37 @@ class Chef provides :homebrew_package provides :package, os: "darwin" - description "Use the **homebrew_package** resource to manage packages for the macOS platform." + description "Use the **homebrew_package** resource to manage packages for the macOS platform. Note: Starting with #{Chef::Dist::PRODUCT} 16 the homebrew resource now accepts an array of packages for isntalling multiple packages at once." introduced "12.0" + examples <<~DOC + **Install a package**: + + ```ruby + homebrew_package 'git' + ``` + + **Install multiple packages at once**: + + ```ruby + homebrew_package %w(git fish ruby) + ``` + + **Specify the Homebrew user with a UUID** + + ```ruby + homebrew_package 'git' do + homebrew_user 1001 + end + ``` + + **Specify the Homebrew user with a string**: + + ```ruby + homebrew_package 'vim' do + homebrew_user 'user1' + end + ``` + DOC property :homebrew_user, [ String, Integer ], description: "The name or uid of the Homebrew owner to be used by #{Chef::Dist::PRODUCT} when executing a command." diff --git a/lib/chef/resource/kernel_module.rb b/lib/chef/resource/kernel_module.rb index c3b3dba9d5..87a1d79d24 100644 --- a/lib/chef/resource/kernel_module.rb +++ b/lib/chef/resource/kernel_module.rb @@ -19,11 +19,14 @@ class Chef introduced "14.3" examples <<~DOC Install and load a kernel module, and ensure it loads on reboot. + ```ruby kernel_module 'loop' ``` + Install and load a kernel with a specific set of options, and ensure it loads on reboot. Consult kernel module documentation for specific options that are supported. + ```ruby kernel_module 'loop' do options [ @@ -32,31 +35,41 @@ class Chef ] end ``` + Load a kernel module. + ```ruby kernel_module 'loop' do action :load end ``` - Unload a kernel module and remove module config, so it doesn’t load on reboot. + + Unload a kernel module and remove module config, so it doesn't load on reboot. + ```ruby kernel_module 'loop' do action :uninstall end ``` + Unload kernel module. + ```ruby kernel_module 'loop' do action :unload end ``` + Blacklist a module from loading. + ```ruby kernel_module 'loop' do action :blacklist end ``` + Disable a kernel module. + ```ruby kernel_module 'loop' do action :disable diff --git a/lib/chef/resource/plist.rb b/lib/chef/resource/plist.rb index 944eea18e9..06811ea8b6 100644 --- a/lib/chef/resource/plist.rb +++ b/lib/chef/resource/plist.rb @@ -28,14 +28,33 @@ class Chef description "Use the **plist** resource to set config values in plist files on macOS systems." introduced "16.0" + examples <<~DOC + **Show hidden files in finder**: + + ```ruby + plist 'show hidden files' do + path '/Users/vagrant/Library/Preferences/com.apple.finder.plist' + entry 'AppleShowAllFiles' + value true + end + ``` + DOC + + property :path, String, name_property: true, + description: "The path on disk to the plist file." - property :path, String, name_property: true property :entry, String property :value, [TrueClass, FalseClass, String, Integer, Float, Hash] property :encoding, String, default: "binary" - property :owner, String, default: "root" - property :group, String, default: "wheel" - property :mode, [String, Integer] + + property :owner, String, default: "root", + description: "The owner of the plist file." + + property :group, String, default: "wheel", + description: "The group of the plist file." + + property :mode, [String, Integer], + description: "The file mode of the plist file. Ex: '644'" PLISTBUDDY_EXECUTABLE = "/usr/libexec/PlistBuddy".freeze DEFAULTS_EXECUTABLE = "/usr/bin/defaults".freeze diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb index 1ac99b3d13..0ffa2194d8 100644 --- a/lib/chef/resource/template.rb +++ b/lib/chef/resource/template.rb @@ -69,7 +69,7 @@ class Chef property :local, [ TrueClass, FalseClass ], default: false, desired_state: false, - description: "Load a template from a local path. By default, the #{Chef::Dist::CLIENT} loads templates from a cookbook’s /templates directory. When this property is set to true, use the source property to specify the path to a template on the local node." + description: "Load a template from a local path. By default, the #{Chef::Dist::CLIENT} loads templates from a cookbook's /templates directory. When this property is set to true, use the source property to specify the path to a template on the local node." # Declares a helper method to be defined in the template context when # rendering. |