Defined Type: stunnel::account

Defined in:
manifests/account.pp

Overview

NOTE: THIS IS A PRIVATE CLASS A define for setting up stunnel service users and groups

This is necessary so that services using the same user and group can successfully be spawned via a define.

Parameters:

  • name

    The user name for the account

  • groupname (String) (defaults to: $name)

    The group name for the account

  • uid (Integer) (defaults to: 600)

    The UID of the user

  • gid (Integer) (defaults to: 600)

    The GID of the user

  • home (Stdlib::Absolutepath) (defaults to: '/var/run/stunnel')

    The home directory of the user

  • shell (Stdlib::Absolutepath) (defaults to: '/sbin/nologin')

    The shell for the user



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'manifests/account.pp', line 25

define stunnel::account (
  String               $groupname = $name,
  Integer              $uid       = 600,
  Integer              $gid       = 600,
  Stdlib::Absolutepath $home      = '/var/run/stunnel',
  Stdlib::Absolutepath $shell     = '/sbin/nologin'
) {
  assert_private()

  $_user = {
    $name          => {
      'ensure'     => 'present',
      'allowdupe'  => false,
      'uid'        => $uid,
      'gid'        => $gid,
      'home'       => $home,
      'managehome' => false,
      'membership' => 'inclusive',
      'shell'      => '/sbin/nologin'
    }
  }

  $_group = {
    $groupname    => {
      'ensure'    => 'present',
      'allowdupe' => false,
      'gid'       =>  $gid
    }
  }

  ensure_resources('user', $_user)
  ensure_resources('group', $_group)
}