15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'manifests/config.pp', line 15
class storj::config (
Storj::Authorization_token $authorization_token = $storj::authorization_token,
Stdlib::Absolutepath $bin_dir = $storj::bin_dir,
Stdlib::Absolutepath $config_dir = $storj::config_dir,
String $user = $storj::user,
String $group = $storj::group,
) {
exec { 'Request authorization command':
command => "${bin_dir}/identity authorize storagenode ${authorization_token} --identity-dir ${config_dir} --config-dir ${config_dir}",
onlyif => "/usr/bin/test `grep -c BEGIN ${config_dir}/storagenode/identity.cert` != 3",
user => $group,
group => $user,
logoutput => true,
notify => Service['storagenode'],
}
-> exec { 'Check certs integrity command':
command => "/usr/bin/test `grep -c BEGIN ${config_dir}/storagenode/ca.cert` == 2 &&
/usr/bin/test `grep -c BEGIN ${config_dir}/storagenode/identity.cert` == 3",
logoutput => true,
returns => 0,
}
}
|