Class: Wright::Provider::Group

Inherits:
Wright::Provider show all
Defined in:
lib/wright/provider/group.rb,
lib/wright/provider/group/gnu_passwd.rb,
lib/wright/provider/group/darwin_directory_service.rb

Overview

Group provider. Used as a base class for Resource::Group providers.

Direct Known Subclasses

DarwinDirectoryService, GnuPasswd

Defined Under Namespace

Classes: DarwinDirectoryService, GnuPasswd

Constant Summary

Constants inherited from Wright::Provider

PROVIDER_DIR

Instance Method Summary collapse

Methods inherited from Wright::Provider

#initialize, #updated?

Constructor Details

This class inherits a constructor from Wright::Provider

Instance Method Details

#createvoid

This method returns an undefined value.

Creates or updates the group.



12
13
14
15
16
17
18
19
# File 'lib/wright/provider/group.rb', line 12

def create
  unless_uptodate(:create, "group already created: '#{group_name}'") do
    unless_dry_run("create group: '#{group_name}'") do
      ensure_group_exists
      set_members unless members_uptodate?
    end
  end
end

#removevoid

This method returns an undefined value.

Removes the group.



24
25
26
27
28
29
30
# File 'lib/wright/provider/group.rb', line 24

def remove
  unless_uptodate(:remove, "group already removed: '#{group_name}'") do
    unless_dry_run("remove group: '#{group_name}'") do
      remove_group
    end
  end
end