Class: Wright::Resource::Group
- Inherits:
-
Wright::Resource
- Object
- Wright::Resource
- Wright::Resource::Group
- Defined in:
- lib/wright/resource/group.rb
Overview
TODO:
Use GnuPasswd provider on all GNU-flavoured systems
Group resource, represents a group.
Instance Attribute Summary collapse
-
#gid ⇒ Integer
The group’s intended group id.
-
#members ⇒ Array<String>
The group’s intended members.
-
#system ⇒ Bool
True if the group should be a system group.
Attributes inherited from Wright::Resource
#action, #ignore_failure, #name, #resource_name
Instance Method Summary collapse
-
#create ⇒ Bool
Creates or updates the group.
-
#initialize(name, args = {}) ⇒ Group
constructor
Initializes a Group.
-
#remove ⇒ Bool
Removes the group.
Methods inherited from Wright::Resource
Constructor Details
#initialize(name, args = {}) ⇒ Group
Initializes a Group.
32 33 34 35 36 37 38 |
# File 'lib/wright/resource/group.rb', line 32 def initialize(name, args = {}) super @action = args.fetch(:action, :create) @members = args.fetch(:members, nil) @gid = args.fetch(:gid, nil) @system = args.fetch(:system, false) end |
Instance Attribute Details
#gid ⇒ Integer
Returns the group’s intended group id.
17 18 19 |
# File 'lib/wright/resource/group.rb', line 17 def gid @gid end |
#members ⇒ Array<String>
Returns the group’s intended members.
14 15 16 |
# File 'lib/wright/resource/group.rb', line 14 def members @members end |
#system ⇒ Bool
Returns true if the group should be a system group. Ignored if #gid is set.
21 22 23 |
# File 'lib/wright/resource/group.rb', line 21 def system @system end |
Instance Method Details
#create ⇒ Bool
Creates or updates the group.
44 45 46 47 48 |
# File 'lib/wright/resource/group.rb', line 44 def create might_update_resource do provider.create end end |
#remove ⇒ Bool
Removes the group.
54 55 56 57 58 |
# File 'lib/wright/resource/group.rb', line 54 def remove might_update_resource do provider.remove end end |