Defined Type: profile::ncredir::log

Defined in:
modules/profile/manifests/ncredir/log.pp

Overview

Parameters:

  • ncredirmtail_port (Wmflib::UserIpPort)
  • fifo (Stdlib::Absolutepath) (defaults to: "/var/log/nginx/ncredir.${title}.pipe")
  • socket (Stdlib::Absolutepath) (defaults to: "/var/log/nginx/ncredir.${title}.socket")
  • fifo_owner (String) (defaults to: 'www-data')
  • fifo_group (String) (defaults to: 'adm')
  • fifo_mode (Stdlib::Filemode) (defaults to: '0640')


1
2
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
# File 'modules/profile/manifests/ncredir/log.pp', line 1

define profile::ncredir::log(
    Wmflib::UserIpPort $ncredirmtail_port,
    Stdlib::Absolutepath $fifo = "/var/log/nginx/ncredir.${title}.pipe",
    Stdlib::Absolutepath $socket = "/var/log/nginx/ncredir.${title}.socket",
    String $fifo_owner = 'www-data',
    String $fifo_group = 'adm',
    Stdlib::Filemode $fifo_mode = '0640',
) {
    fifo_log_demux::instance { "ncredir_${title}":
        user        => 'root',
        fifo        => $fifo,
        socket      => $socket,
        required_by => 'nginx.service',
        create_fifo => true,
        fifo_owner  => $fifo_owner,
        fifo_group  => $fifo_group,
        fifo_mode   => $fifo_mode,
        before      => Service['nginx'],
    }

    file { "/usr/local/bin/ncredirlog-${title}":
        ensure  => present,
        content => template('profile/ncredir/ncredirlog.sh.erb'),
        mode    => '0555',
        owner   => 'root',
        group   => 'root',
    }

    systemd::service { "ncredirmtail@${title}":
        ensure  => present,
        restart => true,
        content => systemd_template('ncredirmtail@'),
    }

    exec { 'mask_default_mtail':
        command => '/bin/systemctl mask mtail.service',
        creates => '/etc/systemd/system/mtail.service',
    }
}