Puppet Class: profile::phorge

Defined in:
modules/profile/manifests/phorge.pp

Overview

SPDX-License-Identifier: Apache-2.0 we.phorge.it - fork of Phabricator

Parameters:

  • server_name (String) (defaults to: lookup('profile::phorge::server_name'))
  • install_path_arcanist (Stdlib::Unixpath) (defaults to: lookup('profile::phorge::install_path_arcanist'))
  • git_origin_arcanist (Stdlib::HTTPSUrl) (defaults to: lookup('profile::phorge::git_origin_arcanist'))
  • install_path_phorge (Stdlib::Unixpath) (defaults to: lookup('profile::phorge::install_path_phorge'))
  • git_origin_phorge (Stdlib::HTTPSUrl) (defaults to: lookup('profile::phorge::git_origin_phorge'))
  • repo_path (Stdlib::Unixpath) (defaults to: lookup('profile::phorge::repo_path'))
  • local_db_server (Boolean) (defaults to: lookup('profile::phorge::local_db_server', {default_value => true}))
  • database_datadir (Stdlib::Unixpath) (defaults to: lookup('profile::phorge::database_datadir', {default_value => '/var/lib/mysql'}))


3
4
5
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
# File 'modules/profile/manifests/phorge.pp', line 3

class profile::phorge(
    String $server_name = lookup('profile::phorge::server_name'),
    Stdlib::Unixpath $install_path_arcanist = lookup('profile::phorge::install_path_arcanist'),
    Stdlib::HTTPSUrl $git_origin_arcanist = lookup('profile::phorge::git_origin_arcanist'),
    Stdlib::Unixpath $install_path_phorge = lookup('profile::phorge::install_path_phorge'),
    Stdlib::HTTPSUrl $git_origin_phorge = lookup('profile::phorge::git_origin_phorge'),
    Stdlib::Unixpath $repo_path = lookup('profile::phorge::repo_path'),
    Boolean $local_db_server = lookup('profile::phorge::local_db_server', {default_value => true}),
    Stdlib::Unixpath $database_datadir = lookup('profile::phorge::database_datadir', {default_value => '/var/lib/mysql'}),
){

    ensure_packages([
        'libapache2-mod-php',
        'git',
        'php-mbstring',
        'php-curl',
        'php-mysql',
        'php-zip',
        'php-gd',
        'php-apcu',
        'python3-pygments',
    ])

    $httpd_modules = ['rewrite', 'headers', 'php7.4']

    class { 'httpd::mpm':
        mpm    => 'prefork',
    }

    class { 'httpd':
        modules             => $httpd_modules,
        purge_manual_config => false,
        require             => Class['httpd::mpm'],
    }

    $document_root = "${install_path_phorge}/webroot"

    httpd::site { 'phorge':
        content => template('profile/phorge/httpd.conf.erb'),
    }

    wmflib::dir::mkdir_p([$install_path_arcanist, $install_path_phorge, $repo_path])

    git::clone { 'arcanist':
        ensure    => 'present',
        origin    => $git_origin_arcanist,
        directory => $install_path_arcanist,
        branch    => 'master',
    }

    git::clone { 'phorge':
        ensure    => 'present',
        origin    => $git_origin_phorge,
        directory => $install_path_phorge,
        branch    => 'master',
    }

    if $local_db_server {
        class { 'profile::mariadb::generic_server':
            datadir => $database_datadir,
        }
    }
}