Puppet Class: gitea::service::user

Defined in:
manifests/service/user.pp

Summary

creates gitea service user

Overview

Parameters:

  • manage_user (Boolean) (defaults to: $gitea::manage_user)

    Should we manage provisioning the user?

  • manage_group (Boolean) (defaults to: $gitea::manage_group)

    Should we manage provisioning the group?

  • manage_home (Boolean) (defaults to: $gitea::manage_home)

    Should we manage provisioning the home directory?

  • user (String) (defaults to: $gitea::owner)

    The user of gitea service

  • group (String) (defaults to: $gitea::group)

    The group of gitea service

  • home (Optional[String]) (defaults to: $gitea::home)

    Qualified path to the user home directory



23
24
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
# File 'manifests/service/user.pp', line 23

class gitea::service::user (
  Boolean $manage_user   = $gitea::manage_user,
  Boolean $manage_group  = $gitea::manage_group,
  Boolean $manage_home   = $gitea::manage_home,
  String  $user          = $gitea::owner,
  String  $group         = $gitea::group,
  Optional[String] $home = $gitea::home,
) {
  $homedir = ($home =~ Undef) ? {
    true  => "/home/${user}",
    false => $home,
  }

  if ($manage_group) {
    group { $group:
      ensure => present,
      system => true,
    }
  }

  if ($manage_user) {
    user { $user:
      ensure     => present,
      gid        => $group,
      home       => $homedir,
      managehome => $manage_home,
      system     => true,
      require    => Group[$group],
      notify     => Systemd::Tmpfile['gitea.conf'],
    }
  }
}