Puppet Class: storj::service

Defined in:
manifests/service.pp

Summary

This class manages service

Overview

Examples:

include storj::service

Parameters:

  • ensure (Variant[Stdlib::Ensure::Service, Enum['absent']]) (defaults to: $storj::service_ensure)

    State ensured from storagenode service.

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

    User running storj.

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

    Group under which storj is running.

  • port (Stdlib::Port) (defaults to: $storj::port)

    Storagenode port (required to be accessible). See documentation.storj.io/dependencies/port-forwarding

  • dashboard_port (Stdlib::Port) (defaults to: $storj::dashboard_port)

    Dashboard port.

  • wallet (String) (defaults to: $storj::wallet)
  • mail (String) (defaults to: $storj::mail)

    Your mail address.

  • host (Stdlib::Host) (defaults to: $storj::host)

    Your node hostname / DNS altname (required to be accessible). See documentation.storj.io/dependencies/port-forwarding

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

    Amount of dedicated storage.

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

    Storj identity node directory. See documentation.storj.io/dependencies/identity

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

    Mounted device location.

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

    Docker inage tag of storj storagenode.

    Default to beta.
    


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']
}