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
|
# File 'modules/profile/manifests/mediabackup/new_storage.pp', line 6
class profile::mediabackup::new_storage (
Hash $mediabackup_config = lookup('mediabackup'),
){
$unix_user = 'objectstorage'
$unix_group = 'objectstorage'
$instances = ['00', '01', '02', '03']
class { 'versitygw::storage_common':
unix_user => $unix_user,
unix_group => $unix_group,
config_dir => '/etc/versitygw',
home_dir => '/srv',
}
$tls_paths = profile::pki::get_cert('discovery2026', $facts['networking']['fqdn'], {
'ensure' => 'present',
'owner' => 'objectstorage',
'outdir' => '/etc/versitygw/ssl',
'hosts' => [$facts['networking']['hostname'], $facts['networking']['fqdn'], '127.0.0.1', '::1', 'localhost'],
'require' => [ User[$unix_user], File['/etc/versitygw/ssl']],
})
$instances.each |Integer $index, String $instance| {
$port = $mediabackup_config['storage_port'] + $index
versitygw::storage { "${unix_user}${instance}":
unix_user => $unix_user,
unix_group => $unix_group,
storage_path => "/srv/${unix_user}${instance}",
port => $port,
# console_port => $mediabackup_config['console_port'],
root_user => $mediabackup_config['storage_root_user'],
root_password => $mediabackup_config['storage_root_password'],
cert_path => $tls_paths['chained'],
key_path => $tls_paths['key'],
ca_path => $tls_paths['ca'],
}
# Do not open the firewall to everyone if there are no available worker hosts
if length($mediabackup_config['worker_hosts']) > 0 {
firewall::service { "versitygw-${unix_user}${instance}-mediabackup-workers":
proto => 'tcp',
port => $port,
notrack => true,
srange => $mediabackup_config['worker_hosts'],
}
}
# Monitor TLS cert expiration and port reachability
# Expect only 403: if we get e.g. 200 we should rather alarm
prometheus::blackbox::check::http { "versitygw-${facts['networking']['hostname']}-${port}":
server_name => $facts['networking']['fqdn'],
team => 'data-persistence',
severity => 'task',
path => '/',
port => $port,
force_tls => true,
status_matches => [403],
}
}
}
|