Puppet Class: storj::config

Defined in:
manifests/config.pp

Summary

This class manages configuration files

Overview

Examples:

include storj::config

Parameters:

  • authorization_token (Storj::Authorization_token) (defaults to: $storj::authorization_token)

    Received personal single-use authorization token. See documentation.storj.io/before-you-begin/auth-token

  • bin_dir (Stdlib::Absolutepath) (defaults to: $storj::bin_dir)

    Directory where binaries are located.

  • config_dir (Stdlib::Absolutepath) (defaults to: $storj::config_dir)

    Directory where configuration are located.

  • user (String) (defaults to: $storj::user)

    User running storj.

  • group (String) (defaults to: $storj::group)

    Group under which storj is running.



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,
  }
}