Defined Type: phabricator::logmail

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

Overview

Parameters:

  • sndr_address (String)
  • rcpt_address (Variant[String, Array])
  • mysql_slave (Stdlib::Fqdn)
  • mysql_slave_port (Stdlib::Port)
  • mysql_db_name (String)
  • basedir (Stdlib::Unixpath) (defaults to: '/usr/local/bin')
  • hour (Optional[Integer]) (defaults to: 0)
  • minute (Optional[Integer]) (defaults to: 0)
  • monthday (Optional[Integer]) (defaults to: undef)
  • weekday (Optional[Integer]) (defaults to: undef)
  • ensure (Wmflib::Ensure) (defaults to: 'present')


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
84
85
86
# File 'modules/phabricator/manifests/logmail.pp', line 44

define phabricator::logmail (
    String $sndr_address,
    Variant[String, Array] $rcpt_address,
    Stdlib::Fqdn $mysql_slave,
    Stdlib::Port $mysql_slave_port,
    String $mysql_db_name,
    Stdlib::Unixpath $basedir  = '/usr/local/bin',
    Optional[Integer] $hour = 0,
    Optional[Integer] $minute = 0,
    Optional[Integer] $monthday = undef,
    Optional[Integer] $weekday = undef,
    Wmflib::Ensure $ensure = 'present',
) {

    require_package('mariadb-client')
    require_package('bsd-mailx')

    file { "/etc/phab_${title}.conf":
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0550',
        content => template("phabricator/${title}.conf.erb"),
    }

    file { "${basedir}/${title}.sh":
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0550',
        content => file("phabricator/${title}.sh"),
    }

    cron { "phabstatscron_${title}":
        ensure   => $ensure,
        command  => "${basedir}/${title}.sh",
        user     => 'root',
        hour     => $hour,
        minute   => $minute,
        weekday  => $weekday,
        monthday => $monthday,
    }
}