Puppet Class: profile::ores::web

Defined in:
modules/profile/manifests/ores/web.pp

Overview

Parameters:

  • redis_host (Any) (defaults to: hiera('profile::ores::web::redis_host'))
  • redis_queue_port (Any) (defaults to: lookup('profile::ores::web::redis_queue_port', {'default_value' => 6379}))
  • redis_cache_port (Any) (defaults to: lookup('profile::ores::web::redis_cache_port', {'default_value' => 6380}))
  • redis_password (Any) (defaults to: hiera('profile::ores::web::redis_password', undef))
  • web_workers (Any) (defaults to: hiera('profile::ores::web::workers'))
  • celery_workers (Any) (defaults to: hiera('profile::ores::celery::workers'))
  • celery_queue_maxsize (Any) (defaults to: hiera('profile::ores::celery::queue_maxsize'))
  • poolcounter_nodes (Any) (defaults to: hiera('profile::ores::web::poolcounter_nodes'))
  • logstash_host (Any) (defaults to: hiera('profile::ores::logstash_host'))
  • logstash_port (Any) (defaults to: hiera('logstash_json_lines_port', 11514))
  • statsd (Any) (defaults to: hiera('statsd'))
  • ores_config_user (Any) (defaults to: hiera('profile::ores::web::ores_config_user', 'deploy-service'))
  • ores_config_group (Any) (defaults to: hiera('profile::ores::web::ores_config_group', 'deploy-service'))


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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'modules/profile/manifests/ores/web.pp', line 1

class profile::ores::web(
    $redis_host = hiera('profile::ores::web::redis_host'),
    $redis_queue_port = lookup('profile::ores::web::redis_queue_port', {'default_value' => 6379}),
    $redis_cache_port = lookup('profile::ores::web::redis_cache_port', {'default_value' => 6380}),
    $redis_password = hiera('profile::ores::web::redis_password', undef),
    $web_workers = hiera('profile::ores::web::workers'),
    $celery_workers = hiera('profile::ores::celery::workers'),
    $celery_queue_maxsize = hiera('profile::ores::celery::queue_maxsize'),
    $poolcounter_nodes = hiera('profile::ores::web::poolcounter_nodes'),
    $logstash_host = hiera('profile::ores::logstash_host'),
    $logstash_port = hiera('logstash_json_lines_port', 11514),
    $statsd = hiera('statsd'),
    $ores_config_user = hiera('profile::ores::web::ores_config_user', 'deploy-service'),
    $ores_config_group = hiera('profile::ores::web::ores_config_group', 'deploy-service'),
){
    $statsd_parts = split($statsd, ':')
    # NOTE: The following is an include to avoid duplicate declaration issues
    # when both profile::ores::worker and profile::ores::web are included in the
    # same role class. scap::target also ends up using it
    include ::git::lfs # lint:ignore:wmf_styleguide

    # rsyslog forwards json messages sent to localhost along to logstash via kafka
    class { '::profile::rsyslog::udp_json_logback_compat':
        port => $logstash_port,
    }

    class { '::ores::web':
        redis_password       => $redis_password,
        redis_host           => $redis_host,
        redis_queue_port     => $redis_queue_port,
        redis_cache_port     => $redis_cache_port,
        web_workers          => $web_workers,
        celery_workers       => $celery_workers,
        celery_queue_maxsize => $celery_queue_maxsize,
        poolcounter_nodes    => $poolcounter_nodes,
        logstash_host        => $logstash_host,
        logstash_port        => $logstash_port,
        statsd_host          => $statsd_parts[0],
        statsd_port          => $statsd_parts[1],
        ores_config_user     => $ores_config_user,
        ores_config_group    => $ores_config_group,
    }

    ferm::service { 'ores':
        proto  => 'tcp',
        port   => '8081',
        srange => '$DOMAIN_NETWORKS',
    }

    $min_crit = $celery_workers - 2
    $max_crit = $celery_workers + 2
    nrpe::monitor_service { 'ores_workers':
        description  => 'ores_workers_running',
        retries      => 10,
        nrpe_command => "/usr/lib/nagios/plugins/check_procs -C celery -c ${min_crit}:${max_crit}",
        notes_url    => 'https://wikitech.wikimedia.org/wiki/ORES',
    }
}