Puppet Class: sentry::service

Defined in:
manifests/service.pp

Overview

Class: sentry::service

This class is meant to be called from sentry. It ensures the service is running.



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

class sentry::service
{
  $command = join([
    "${sentry::path}/virtualenv/bin/sentry",
    "--config=${sentry::path}/sentry.conf.py"
  ], ' ')

  Supervisord::Program {
    ensure          => present,
    directory       => $sentry::path,
    user            => $sentry::owner,
    autostart       => true,
    redirect_stderr => true,
  }

  anchor { 'sentry::service::begin': } ->

  supervisord::program {
    'sentry-http':
      command => "${command} start http",
    ;
    'sentry-worker':
      command => "${command} celery worker -B",
    ;
  } ->

  anchor { 'sentry::service::end': }

  if $sentry::service_restart {
    Anchor['sentry::service::begin'] ~>

    supervisord::supervisorctl { 'sentry_reload':
      command     => 'reload',
      refreshonly => true,
    }
  }
}