summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2022-02-13 11:47:00 -0800
committerTim Smith <tsmith84@gmail.com>2022-02-13 11:47:00 -0800
commitd5306e158df7cde9cb430d61344fd6d0c94696a5 (patch)
treeae118393559bd317273457e607ed49bb83d5cbe5
parent1c8f84f84d267524076e2d0c5a69bc23be04f593 (diff)
downloadchef-d5306e158df7cde9cb430d61344fd6d0c94696a5.tar.gz
Add examples to the group resource
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/group.rb26
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/chef/resource/group.rb b/lib/chef/resource/group.rb
index 545cd0b35d..ffb6e0fd8b 100644
--- a/lib/chef/resource/group.rb
+++ b/lib/chef/resource/group.rb
@@ -25,6 +25,30 @@ class Chef
description "Use the **group** resource to manage a local group."
+ examples <<~EXAMPLES
+ The following examples demonstrate various approaches for using the **group** resource in recipes:
+
+ Append users to groups:
+
+ ```ruby
+ group 'www-data' do
+ action :modify
+ members 'maintenance'
+ append true
+ end
+ ```
+
+ Add a user to group on the Windows platform:
+
+ ```ruby
+ group 'Administrators' do
+ members ['domain\\foo']
+ append true
+ action :modify
+ end
+ ```
+ EXAMPLES
+
provides :group
allowed_actions :create, :remove, :modify, :manage
@@ -39,7 +63,7 @@ class Chef
property :members, [String, Array], default: [],
coerce: proc { |arg| arg.is_a?(String) ? arg.split(/\s*,\s*/) : arg },
- description: "Which users should be set or appended to a group. When more than one group member is identified, the list of members should be an array: members ['user1', 'user2']."
+ description: "Which users should be set or appended to a group. When more than one group member is identified, the list of members should be an array: `members ['user1', 'user2']`."
property :excluded_members, [String, Array], default: [],
coerce: proc { |arg| arg.is_a?(String) ? arg.split(/\s*,\s*/) : arg },