Class: Koch::Group

Inherits:
Resource show all
Defined in:
lib/koch/group.rb

Overview

Represents a Linux group

Instance Attribute Summary

Attributes inherited from Resource

#changed, #name

Instance Method Summary collapse

Methods inherited from Resource

dsl_writer, #initialize

Constructor Details

This class inherits a constructor from Koch::Resource

Instance Method Details

#apply!Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/koch/group.rb', line 8

def apply!
  if exist? name
    debug "Group #{name} already exists"
    return
  end

  @changed = true

  params = +""
  params << " --gid #{gid}" if gid
  params << " --system" if system_group

  maybe "groupadd#{params} #{name}"
end