-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.pp
130 lines (126 loc) · 6.01 KB
/
init.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# == Class storm
#
# === Parameters
#
# TODO: Document each class parameter.
#
# [*config_map*]
# Use this parameter for all other Storm related config options except those that are already exposed as class
# parameters (e.g. `$nimbus_host`, `$local_dir`, `$local_hostname`, `$worker_childopts`).
#
class storm(
$command = $storm::params::command,
$config = $storm::params::config,
$config_map = $storm::params::config_map,
$config_template = $storm::params::config_template,
$gid = $storm::params::gid,
$group = $storm::params::group,
$group_ensure = $storm::params::group_ensure,
$local_dir = $storm::params::local_dir,
$local_hostname = $storm::params::local_hostname,
$log_dir = $storm::params::log_dir,
$logback = $storm::params::logback,
$logback_template = $storm::params::logback_template,
$logviewer_childopts = $storm::params::logviewer_childopts,
$nimbus_host = $storm::params::nimbus_host,
$nimbus_childopts = $storm::params::nimbus_childopts,
$drpc_childopts = $storm::params::drpc_childopts,
$package_name = $storm::params::package_name,
$package_ensure = $storm::params::package_ensure,
$service_autorestart = hiera('storm::service_autorestart', $storm::params::service_autorestart),
$service_enable = hiera('storm::service_enable', $storm::params::service_enable),
$service_ensure = $storm::params::service_ensure,
$service_manage = hiera('storm::service_manage', $storm::params::service_manage),
$service_name_logviewer = $storm::params::service_name_logviewer,
$service_name_nimbus = $storm::params::service_name_nimbus,
$service_name_supervisor = $storm::params::service_name_supervisor,
$service_name_ui = $storm::params::service_name_ui,
$service_name_drpc = $storm::params::service_name_drpc,
$service_retries = $storm::params::service_retries,
$service_startsecs = $storm::params::service_startsecs,
$service_stderr_logfile_keep = $storm::params::service_stderr_logfile_keep,
$service_stderr_logfile_maxsize = $storm::params::service_stderr_logfile_maxsize,
$service_stdout_logfile_keep = $storm::params::service_stdout_logfile_keep,
$service_stdout_logfile_maxsize = $storm::params::service_stdout_logfile_maxsize,
$shell = $storm::params::shell,
$storm_messaging_transport = $storm::params::storm_messaging_transport,
$supervisor_childopts = $storm::params::supervisor_childopts,
$supervisor_slots_ports = $storm::params::supervisor_slots_ports,
$ui_childopts = $storm::params::ui_childopts,
$uid = $storm::params::uid,
$user = $storm::params::user,
$user_description = $storm::params::user_description,
$user_ensure = $storm::params::user_ensure,
$user_home = $storm::params::user_home,
$user_manage = hiera('storm::user_manage', $storm::params::user_manage),
$user_managehome = hiera('storm::user_managehome', $storm::params::user_managehome),
$worker_childopts = $storm::params::worker_childopts,
$zookeeper_servers = $storm::params::zookeeper_servers,
$drpc_servers = $storm::params::drpc_servers,
) inherits storm::params {
validate_string($command)
validate_absolute_path($config)
validate_hash($config_map)
validate_string($config_template)
if !is_integer($gid) { fail('The $gid parameter must be an integer number') }
validate_string($group)
validate_string($group_ensure)
validate_absolute_path($local_dir)
validate_string($local_hostname)
validate_absolute_path($log_dir)
validate_absolute_path($logback)
validate_string($logback_template)
validate_string($logviewer_childopts)
validate_string($nimbus_host)
validate_string($nimbus_childopts)
validate_string($drpc_childopts)
validate_string($package_name)
validate_string($package_ensure)
validate_bool($service_autorestart)
validate_bool($service_enable)
validate_string($service_ensure)
validate_bool($service_manage)
validate_string($service_name_logviewer)
validate_string($service_name_nimbus)
validate_string($service_name_supervisor)
validate_string($service_name_ui)
validate_string($service_name_drpc)
if !is_integer($service_retries) { fail('The $service_retries parameter must be an integer number') }
if !is_integer($service_startsecs) { fail('The $service_startsecs parameter must be an integer number') }
if !is_integer($service_stderr_logfile_keep) {
fail('The $service_stderr_logfile_keep parameter must be an integer number')
}
validate_string($service_stderr_logfile_maxsize)
if !is_integer($service_stdout_logfile_keep) {
fail('The $service_stdout_logfile_keep parameter must be an integer number')
}
validate_string($service_stdout_logfile_maxsize)
validate_absolute_path($shell)
validate_string($storm_messaging_transport)
validate_string($supervisor_childopts)
validate_array($supervisor_slots_ports)
validate_string($ui_childopts)
if !is_integer($uid) { fail('The $uid parameter must be an integer number') }
validate_string($user)
validate_string($user_description)
validate_string($user_ensure)
validate_absolute_path($user_home)
validate_bool($user_manage)
validate_bool($user_managehome)
validate_string($worker_childopts)
validate_array($zookeeper_servers)
validate_array($drpc_servers)
include '::storm::users'
include '::storm::install'
include '::storm::config'
# Anchor this as per #8040 - this ensures that classes won't float off and
# mess everything up. You can read about this at:
# http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues
anchor { 'storm::begin': }
anchor { 'storm::end': }
Anchor['storm::begin']
-> Class['::storm::users']
-> Class['::storm::install']
-> Class['::storm::config']
-> Anchor['storm::end']
}