Puppet Class: sentry::config

Defined in:
manifests/config.pp

Overview

Class: sentry::config

This class is called from sentry for service config.



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
59
60
61
62
63
64
65
66
# File 'manifests/config.pp', line 5

class sentry::config
{
  $password       = $sentry::password
  $secret_key     = $sentry::secret_key
  $email          = $sentry::email
  $url            = $sentry::url
  $host           = $sentry::host
  $port           = $sentry::port
  $workers        = $sentry::workers
  $database       = $sentry::database
  $beacon_enabled = $sentry::beacon_enabled
  $email_enabled  = $sentry::email_enabled
  $proxy_enabled  = $sentry::proxy_enabled
  $redis_enabled  = $sentry::redis_enabled
  $extra_config   = $sentry::extra_config

  $config = {
    'database' => merge(
      $sentry::params::database_config_default,
      $sentry::database_config
    ),
    'email'    => merge(
      $sentry::params::email_config_default,
      $sentry::email_config
    ),
    'redis'    => merge(
      $sentry::params::redis_config_default,
      $sentry::redis_config
    ),
  }

  file { "${sentry::path}/sentry.conf.py":
    ensure  => present,
    content => template('sentry/sentry.conf.py.erb'),
    owner   => $sentry::owner,
    group   => $sentry::group,
    mode    => '0640',
  } ->

  file { "${sentry::path}/.initialized":
    ensure  => present,
    content => 'This file tells Puppet to avoid running an upgrade again on config change',
    owner   => $sentry::owner,
    group   => $sentry::group,
  } ~>

  sentry::command { 'postconfig_upgrade':
    command     => 'upgrade --noinput',
    refreshonly => true,
  } ~>

  sentry::command { 'create_superuser':
    command     => join([
      'createuser',
      "--email='${email}'",
      '--superuser',
      "--password='${password}'",
      '--no-input'
    ], ' '),
    refreshonly => true,
  }
}