Puppet Class: mjolnir

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

Overview

Class: mjolnir

This class installs the MjoLniR (Machine Learned Ranking) data processing package.

Parameters:

  • logstash_host (String)
  • logstash_port (Stdlib::Port)


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
# File 'modules/mjolnir/manifests/init.pp', line 6

class mjolnir(
    String $logstash_host,
    Stdlib::Port $logstash_port
) {

    require_package('virtualenv', 'zip')

    # Vary libsnappy package on  debian version.
    if os_version('debian >= stretch') {
        require_package('libsnappy1v5')
    }
    else {
        require_package('libsnappy1')
    }

    file { '/etc/mjolnir':
        ensure => 'directory',
        owner  => 'deploy-service',
        group  => 'deploy-service',
        mode   => '0755',
    }

    file { '/etc/mjolnir/logging_config.yaml':
        ensure  => 'file',
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('mjolnir/logging_config.yaml.erb')
    }

    scap::target { 'search/mjolnir/deploy':
        deploy_user => 'deploy-service',
        require     => Package['python3.7'],
    }
}