Puppet Class: turnilo

Defined in:
modules/turnilo/manifests/init.pp

Overview

Class: turnilo

This class installs and configures the Allegro Turnilo nodejs application.

Turnilo is an open source replacement for Imply Pivot.

Parameters

port

The port used by Turnilo to accept HTTP connections. Default: 9091

druid_clusters

Array of hashes of druid cluster config. Each hash must contain at least 'name' and 'host' with the druid broker hostname:port.

deployment_user

Scap deployment user. Default: 'analytics_deploy'

scap_repo

Scap repository. Default: 'analytics/turnilo/deploy'

Parameters:

  • druid_clusters (Any)
  • port (Any) (defaults to: 9091)
  • deployment_user (Any) (defaults to: 'analytics_deploy')
  • scap_repo (Any) (defaults to: 'analytics/turnilo/deploy')


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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'modules/turnilo/manifests/init.pp', line 25

class turnilo(
    $druid_clusters,
    $port              = 9091,
    $deployment_user   = 'analytics_deploy',
    $scap_repo         = 'analytics/turnilo/deploy',
) {

    require_package(['nodejs', 'firejail'])

    $scap_deployment_base_dir = '/srv/deployment'
    $turnilo_deployment_dir = "${scap_deployment_base_dir}/${scap_repo}"

    scap::target { 'analytics/turnilo/deploy':
        deploy_user  => $deployment_user,
        service_name => 'turnilo',
    }

    group { 'turnilo':
        ensure => present,
        system => true,
    }

    user { 'turnilo':
        gid     => 'turnilo',
        shell   => '/bin/bash',
        system  => true,
        require => Group['turnilo'],
    }

    file { '/etc/firejail/turnilo.profile':
        ensure => present,
        owner  => 'root',
        group  => 'root',
        mode   => '0444',
        source => 'puppet:///modules/turnilo/turnilo.profile.firejail',
    }

    file { '/etc/turnilo':
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
    }

    file { '/etc/turnilo/config.yaml':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('turnilo/config.yaml.erb'),
        require => File['/etc/turnilo'],
    }

    systemd::syslog { 'turnilo':
        readable_by => 'all',
        base_dir    => '/var/log',
        group       => 'root',
        force_stop  => true,
    }

    systemd::service { 'turnilo':
        ensure  => present,
        content => systemd_template('turnilo'),
        restart => true,
        require => [
            Scap::Target['analytics/turnilo/deploy'],
            File['/etc/firejail/turnilo.profile'],
            File['/etc/turnilo/config.yaml'],
            User['turnilo'],
            Systemd::Syslog['turnilo'],
        ],
    }
}