Puppet Class: phabricator::phd

Defined in:
modules/phabricator/manifests/phd.pp

Overview

Parameters:

  • phd_user (String) (defaults to: 'phd')
  • phd_log_dir (Stdlib::Unixpath) (defaults to: '/var/log/phd')
  • phd_home (Stdlib::Unixpath) (defaults to: '/var/run/phd')
  • phd_uid (Integer) (defaults to: 920)
  • basedir (Stdlib::Unixpath) (defaults to: '/')
  • use_systemd_sysuser (Boolean) (defaults to: false)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'modules/phabricator/manifests/phd.pp', line 6

class phabricator::phd (
    String $phd_user              = 'phd',
    Stdlib::Unixpath $phd_log_dir = '/var/log/phd',
    Stdlib::Unixpath $phd_home    = '/var/run/phd',
    Integer $phd_uid              = 920,
    Stdlib::Unixpath $basedir     = '/',
    Boolean $use_systemd_sysuser  = false,
) {

    # PHD user needs perms to drop root perms on start
    file { "${basedir}/phabricator/scripts/daemon/":
        owner   => $phd_user,
        recurse => true,
    }

    # Managing repo's as the PHD user
    file { "${basedir}/phabricator/scripts/repository/":
        owner   => $phd_user,
        recurse => true,
    }

    file { $phd_home:
        ensure => directory,
        owner  => $phd_user,
        group  => $phd_user,
    }

    file { $phd_log_dir:
        ensure => 'directory',
        owner  => $phd_user,
        group  => $phd_user,
    }

    # TODO: remove if/else and parameter after migration to new servers
    if $use_systemd_sysuser {
        systemd::sysuser { $phd_user:
            ensure      => present,
            id          => "${phd_uid}:${phd_uid}",
            description => 'Phabricator daemon user',
            home_dir    => $phd_home,
        }

    } else {

        group { $phd_user:
            ensure => present,
            system => true,
        }

        user { $phd_user:
        gid    => $phd_user,
        shell  => '/bin/false',
        home   => $phd_home,
        system => true,
        }
    }

    logrotate::conf { 'phd':
        ensure => present,
        source => 'puppet:///modules/phabricator/logrotate_phd',
    }
}