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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
# File 'manifests/webdav/config.pp', line 3
class storm::webdav::config (
$manage_application_file = $storm::webdav::manage_application_file,
$application_file = $storm::webdav::application_file,
$oauth_issuers = $storm::webdav::oauth_issuers,
$manage_storage_areas = $storm::webdav::manage_storage_areas,
$storage_areas_directory = $storm::webdav::storage_areas_directory,
$storage_areas = $storm::webdav::storage_areas,
$hostnames = $storm::webdav::hostnames,
$http_port = $storm::webdav::http_port,
$https_port = $storm::webdav::https_port,
$trust_anchors_refresh_interval = $storm::webdav::trust_anchors_refresh_interval,
$max_concurrent_connections = $storm::webdav::max_concurrent_connections,
$max_queue_size = $storm::webdav::max_queue_size,
$connector_max_idle_time = $storm::webdav::connector_max_idle_time,
$vo_map_files_enable = $storm::webdav::vo_map_files_enable,
$vo_map_files_config_dir = $storm::webdav::vo_map_files_config_dir,
$vo_map_files_refresh_interval = $storm::webdav::vo_map_files_refresh_interval,
$tpc_max_connections = $storm::webdav::tpc_max_connections,
$tpc_verify_checksum = $storm::webdav::tpc_verify_checksum,
$jvm_opts = $storm::webdav::jvm_opts,
$authz_server_enable = $storm::webdav::authz_server_enable,
$authz_server_issuer = $storm::webdav::authz_server_issuer,
$authz_server_max_token_lifetime_sec = $storm::webdav::authz_server_max_token_lifetime_sec,
$authz_server_secret = $storm::webdav::authz_server_secret,
$require_client_cert = $storm::webdav::require_client_cert,
$use_conscrypt = $storm::webdav::use_conscrypt,
$tpc_use_conscrypt = $storm::webdav::tpc_use_conscrypt,
$enable_http2 = $storm::webdav::enable_http2,
$debug = $storm::webdav::debug,
$debug_port = $storm::webdav::debug_port,
$debug_suspend = $storm::webdav::debug_suspend,
$storm_limit_nofile = $storm::webdav::storm_limit_nofile,
) {
file { '/var/lib/storm-webdav/work':
ensure => directory,
owner => 'storm',
group => 'storm',
mode => '0755',
recurse => true,
}
# Service's host credentials directory
file { '/etc/grid-security/storm-webdav':
ensure => directory,
owner => 'storm',
group => 'storm',
mode => '0755',
recurse => true,
}
# Service's hostcert
file { '/etc/grid-security/storm-webdav/hostcert.pem':
ensure => present,
mode => '0644',
owner => 'storm',
group => 'storm',
source => '/etc/grid-security/hostcert.pem',
require => File['/etc/grid-security/storm-webdav'],
}
# Service's hostkey
file { '/etc/grid-security/storm-webdav/hostkey.pem':
ensure => present,
mode => '0400',
owner => 'storm',
group => 'storm',
source => '/etc/grid-security/hostkey.pem',
require => File['/etc/grid-security/storm-webdav'],
}
if $manage_storage_areas {
if $storage_areas_directory.length() > 0 {
## Configure storage areas property files from source directory
file { '/etc/storm/webdav/sa.d':
ensure => directory,
source => $storage_areas_directory,
recurse => 'remote',
owner => 'root',
group => 'storm',
notify => Service['storm-webdav'],
}
} else {
## Use class variables to configure storage areas
if $storage_areas {
$sa_properties_template_file='storm/etc/storm/webdav/sa.d/sa.properties.erb'
$storage_areas.each | $sa | {
# define template variables
# mandatory fields
$name = $sa[name]
$root_path = $sa[root_path]
$access_points = $sa[access_points]
$vos = $sa[vos]
# optional fileds
$orgs = $sa[orgs]
$authenticated_read_enabled = $sa[authenticated_read_enabled]
$anonymous_read_enabled = $sa[anonymous_read_enabled]
$vo_map_enabled = $sa[vo_map_enabled]
$vo_map_grants_write_permission = $sa[vo_map_grants_write_permission]
$orgs_grant_read_permission = $sa[orgs_grant_read_permission]
$orgs_grant_write_permission = $sa[orgs_grant_write_permission]
$wlcg_scope_authz_enabled = $sa[wlcg_scope_authz_enabled]
$fine_grained_authz_enabled = $sa[fine_grained_authz_enabled]
# use template
file { "/etc/storm/webdav/sa.d/${name}.properties":
ensure => present,
content => template($sa_properties_template_file),
owner => 'root',
group => 'storm',
notify => Service['storm-webdav'],
}
}
}
}
}
if $manage_application_file {
$target_application_file='/etc/storm/webdav/config/application.yml'
if $application_file.length() > 0 {
## copy application.yml from source file
# configuration of application.yml
file { $target_application_file:
ensure => present,
source => $application_file,
owner => 'root',
group => 'storm',
mode => '0644',
notify => Service['storm-webdav'],
}
} else {
## generate application.yml from variables
$application_template_file='storm/etc/storm/webdav/config/application.yml.erb'
# configuration of application.yml
file { $target_application_file:
ensure => present,
content => template($application_template_file),
owner => 'root',
group => 'storm',
mode => '0644',
notify => Service['storm-webdav'],
}
}
}
$service_dir='/etc/systemd/system/storm-webdav.service.d'
file { $service_dir:
ensure => directory,
owner => 'root',
group => 'root',
mode => '0644',
}
$limit_template_file='storm/etc/systemd/system/storm-webdav.service.d/filelimit.conf.erb'
$limit_file='/etc/systemd/system/storm-webdav.service.d/filelimit.conf'
# configuration of filelimit.conf
file { $limit_file:
ensure => present,
content => template($limit_template_file),
owner => 'root',
group => 'root',
mode => '0644',
notify => [Exec['webdav-daemon-reload'], Service['storm-webdav']],
require => File[$service_dir],
}
$environment_file='/etc/systemd/system/storm-webdav.service.d/storm-webdav.conf'
$environment_template_file='storm/etc/systemd/system/storm-webdav.service.d/storm-webdav.conf.erb'
file { $environment_file:
ensure => present,
content => template($environment_template_file),
notify => [Exec['webdav-daemon-reload'], Service['storm-webdav']],
require => File[$service_dir],
}
}
|