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 'manifests/service.pp', line 30
class storj::service (
Variant[Stdlib::Ensure::Service, Enum['absent']] $ensure = $storj::service_ensure,
String $user = $storj::user,
String $group = $storj::group,
Stdlib::Port $port = $storj::port,
Stdlib::Port $dashboard_port = $storj::dashboard_port,
String $wallet = $storj::wallet,
String $mail = $storj::mail,
Stdlib::Host $host = $storj::host,
String $storage = $storj::storage,
Stdlib::Absolutepath $config_dir = $storj::config_dir,
Stdlib::Absolutepath $storage_path = $storj::storage_path,
String $docker_tag = $storj::docker_tag,
) {
$_file_ensure = $ensure ? {
'running' => file,
'stopped' => file,
default => absent,
}
$_service_ensure = $ensure ? {
'running' => running,
default => stopped,
}
file { '/lib/systemd/system/storagenode.service':
ensure => $_file_ensure,
content => template('storj/service.erb'),
notify => Service['storagenode']
}
service { 'storagenode':
ensure => $_service_ensure,
enable => true,
}
File['/lib/systemd/system/storagenode.service'] -> Service['storagenode']
}
|