This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
/
finder_frontend.pp
84 lines (79 loc) · 2.16 KB
/
finder_frontend.pp
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
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
# == Class: govuk::apps::finder_frontend
#
# Configure the finder-frontend application
#
# === Parameters
#
# FIXME: Document all parameters
#
# [*sentry_dsn*]
# The URL used by Sentry to report exceptions
#
# [*nagios_memory_warning*]
# Memory use at which Nagios should generate a warning.
#
# [*nagios_memory_critical*]
# Memory use at which Nagios should generate a critical alert.
#
# [*secret_key_base*]
# The key for Rails to use when signing/encrypting sessions.
#
# [*email_alert_api_bearer_token*]
# Bearer token for communication with the email-alert-api
#
# [*qa_enabled*]
# Whether the Q&A feature is enabled
#
# [*qa_to_content_enabled*]
# Whether the Q&A to content feature is enabled
#
class govuk::apps::finder_frontend(
$port = '3062',
$enabled = false,
$nagios_memory_warning = undef,
$nagios_memory_critical = undef,
$sentry_dsn = undef,
$secret_key_base = undef,
$email_alert_api_bearer_token = undef,
$qa_enabled = false,
$qa_to_content_enabled = false,
) {
if $enabled {
govuk::app { 'finder-frontend':
app_type => 'rack',
port => $port,
sentry_dsn => $sentry_dsn,
health_check_path => '/cma-cases',
log_format_is_json => true,
asset_pipeline => true,
asset_pipeline_prefix => 'finder-frontend',
nagios_memory_warning => $nagios_memory_warning,
nagios_memory_critical => $nagios_memory_critical,
}
}
Govuk::App::Envvar {
app => 'finder-frontend',
}
govuk::app::envvar {
"${title}-EMAIL_ALERT_API_BEARER_TOKEN":
varname => 'EMAIL_ALERT_API_BEARER_TOKEN',
value => $email_alert_api_bearer_token;
"${title}-SECRET_KEY_BASE":
varname => 'SECRET_KEY_BASE',
value => $secret_key_base;
}
if $qa_enabled {
govuk::app::envvar {
"${title}-FINDER_FRONTEND_ENABLE_QA":
varname => 'FINDER_FRONTEND_ENABLE_QA',
value => 'yes';
}
}
if $qa_to_content_enabled {
govuk::app::envvar {
"${title}-FINDER_FRONTEND_ENABLE_QA_TO_CONTENT":
varname => 'FINDER_FRONTEND_ENABLE_QA_TO_CONTENT',
value => 'yes';
}
}
}