Defined Type: phabricator::redirector

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

Overview

Parameters:

  • mysql_user (String)
  • mysql_pass (String)
  • mysql_host (Stdlib::Fqdn)
  • rootdir (Stdlib::Unixpath) (defaults to: '/srv/phab')
  • field_index (String) (defaults to: '')
  • phab_host (Stdlib::Fqdn) (defaults to: 'phabricator.wikimedia.org')
  • alt_host (Stdlib::Fqdn) (defaults to: 'phab.wmfusercontent.org')
  • rate_limits (Hash) (defaults to: {'request' => 0, 'connection' => 0})


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
# File 'modules/phabricator/manifests/redirector.pp', line 9

define phabricator::redirector(
    String $mysql_user,
    String $mysql_pass,
    Stdlib::Fqdn $mysql_host,
    Stdlib::Unixpath $rootdir = '/srv/phab',
    String $field_index       = '',
    Stdlib::Fqdn $phab_host   = 'phabricator.wikimedia.org',
    Stdlib::Fqdn $alt_host    = 'phab.wmfusercontent.org',
    Hash $rate_limits         = {'request' => 0, 'connection' => 0}
) {
    require phabricator

    $preamble = "${phabricator::confdir}/preamble.php"
    $redirect_config = "${phabricator::confdir}/redirect_config.json"

    file { $preamble:
        content => template('phabricator/preamble.php.erb'),
        notify  => Service['apache2'],
    }

    file { "${rootdir}/phabricator/support/preamble.php":
        ensure => 'link',
        target => $preamble
    }

    file { $redirect_config:
        content => template('phabricator/redirect_config.json.erb'),
        notify  => Service['apache2'],
        owner   => 'root',
        group   => 'www-data',
        mode    => '0640',
    }

    file { "${rootdir}/phabricator/support/redirect_config.json":
        ensure => 'link',
        target => $redirect_config,
    }
}