Puppet Class: profile::phabricator::logmail

Defined in:
modules/profile/manifests/phabricator/logmail.pp

Overview

SPDX-License-Identifier: Apache-2.0 phabricator - informational emails for admins

Parameters:

  • logmail (Boolean) (defaults to: lookup('phabricator_logmail', { 'default_value' => false }))
  • deploy_target (String) (defaults to: lookup('phabricator_deploy_target', { 'default_value' => 'phabricator/deployment'}))
  • mysql_slave (String) (defaults to: lookup('phabricator::mysql::slave', { 'default_value' => 'localhost' }))
  • mysql_slave_port (String) (defaults to: lookup('phabricator::mysql::slave::port', { 'default_value' => '3323' }))


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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'modules/profile/manifests/phabricator/logmail.pp', line 4

class profile::phabricator::logmail (
    Boolean                     $logmail            = lookup('phabricator_logmail',
                                                      { 'default_value' => false }),
    String                      $deploy_target      = lookup('phabricator_deploy_target',
                                                      { 'default_value' => 'phabricator/deployment'}),
    String                      $mysql_slave        = lookup('phabricator::mysql::slave',
                                                      { 'default_value' => 'localhost' }),
    String                      $mysql_slave_port   = lookup('phabricator::mysql::slave::port',
                                                      { 'default_value' => '3323' }),
){

    # logmail must be explictly enabled in Hiera with 'phabricator_logmail: true'
    # to avoid duplicate mails from labs and standby (T173297)
    $logmail_ensure = $logmail ? {
        true    => 'present',
        default => 'absent',
    }

    # community metrics mail (T81784, T1003)
    phabricator::logmail {'community_metrics':
        ensure           => $logmail_ensure,
        rcpt_address     => 'wikitech-l@lists.wikimedia.org',
        sndr_address     => 'aklapper@wikimedia.org',
        monthday         => 1,
        require          => Package[$deploy_target],
        mysql_slave      => $mysql_slave,
        mysql_slave_port => $mysql_slave_port,
        mysql_db_name    => 'phabricator_maniphest',
    }

    # project changes mail (T85183)
    phabricator::logmail {'project_changes':
        ensure           => $logmail_ensure,
        rcpt_address     => [ 'phabricator-reports@lists.wikimedia.org' ],
        sndr_address     => 'aklapper@wikimedia.org',
        weekday          => 'Monday',
        require          => Package[$deploy_target],
        mysql_slave      => $mysql_slave,
        mysql_slave_port => $mysql_slave_port,
        mysql_db_name    => 'phabricator_project',
    }

    # multi-factor auth mail (T299403)
    phabricator::logmail {'mfa_check':
        ensure           => $logmail_ensure,
        rcpt_address     => [ 'aklapper@wikimedia.org' ],
        sndr_address     => 'aklapper@wikimedia.org',
        weekday          => 'Wednesday',
        require          => Package[$deploy_target],
        mysql_slave      => $mysql_slave,
        mysql_slave_port => $mysql_slave_port,
        mysql_db_name    => 'phabricator_user',
    }

    # yearly metrics mail (T337388)
    phabricator::logmail {'yearly_metrics':
        ensure           => $logmail_ensure,
        rcpt_address     => [ 'aklapper@wikimedia.org', 'releng@lists.wikimedia.org' ],
        sndr_address     => 'aklapper@wikimedia.org',
        month            => 1,
        monthday         => 1,
        require          => Package[$deploy_target],
        mysql_slave      => $mysql_slave,
        mysql_slave_port => $mysql_slave_port,
        mysql_db_name    => 'phabricator_maniphest',
    }

    # quarterly metrics mail (T337387)
    phabricator::logmail {'quarterly_metrics':
        ensure           => $logmail_ensure,
        rcpt_address     => [ 'oonifade@wikimedia.org', 'aklapper@wikimedia.org' ],
        sndr_address     => 'aklapper@wikimedia.org',
        month            => '01,04,07,10',
        monthday         => 1,
        require          => Package[$deploy_target],
        mysql_slave      => $mysql_slave,
        mysql_slave_port => $mysql_slave_port,
        mysql_db_name    => 'phabricator_maniphest',
    }
}