Puppet Class: storj

Defined in:
manifests/init.pp

Summary

This module manages Storj

Overview

Init class of Storj module. It can installes Storj binaries and single Service.

Examples:

include storj

Parameters:

  • authorization_token (Storj::Authorization_token)

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

  • wallet (String)
  • mail (String)

    Your mail address.

  • host (Stdlib::Host)

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

  • storage (String)

    Amount of dedicated storage.

  • storage_path (Stdlib::Absolutepath)

    Mounted device location.

  • version (Pattern[/\d+\.\d+\.\d+/]) (defaults to: '1.1.1')

    Storj release. See github.com/storj/storj/releases

  • os (String) (defaults to: downcase($facts['kernel']))

    Operating system.

  • base_dir (Stdlib::Absolutepath) (defaults to: '/opt')

    Base directory where Storj is extracted.

  • bin_dir (Stdlib::Absolutepath) (defaults to: '/usr/local/bin')

    Directory where binaries are located.

  • base_url (Stdlib::HTTPUrl) (defaults to: 'https://github.com/storj/storj/releases/download')

    Base URL for storj.

  • download_extension (String) (defaults to: 'zip')

    Extension of Storj binaries archive.

  • download_url (Optional[Stdlib::HTTPUrl]) (defaults to: undef)

    Complete URL corresponding to the Storj release, default to undef.

  • extract_command (Optional[String]) (defaults to: undef)

    Custom command passed to the archive resource to extract the downloaded archive.

  • config_dir (Stdlib::Absolutepath) (defaults to: '/etc/storj')

    Directory where configuration are located.

  • manage_user (Boolean) (defaults to: true)

    Whether to create user for storj or rely on external code for that.

  • manage_group (Boolean) (defaults to: true)

    Whether to create user for storj or rely on external code for that.

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

    User running storj.

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

    Group under which storj is running.

  • user_shell (Stdlib::Absolutepath) (defaults to: '/bin/false')

    if requested, we create a user for storj. The default shell is false. It can be overwritten to any valid path.

  • extra_groups (Array[String]) (defaults to: [])

    Add other groups to the managed user.

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

    State ensured from storagenode service.

  • docker_tag (String) (defaults to: 'beta')

    Docker inage tag of storj storagenode.

    Default to beta.
    
  • port (Stdlib::Port) (defaults to: 28967)

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

  • dashboard_port (Stdlib::Port) (defaults to: 14002)

    Dashboard port.

  • manage_docker (Boolean) (defaults to: true)

    Whether to install docker or rely on external code for that. Docker is required to run storagenode image.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'manifests/init.pp', line 61

class storj (
  Storj::Authorization_token                       $authorization_token,
  String                                           $wallet,
  String                                           $mail,
  Stdlib::Host                                     $host,
  String                                           $storage,
  Stdlib::Absolutepath                             $storage_path,
  Pattern[/\d+\.\d+\.\d+/]                         $version            = '1.1.1',
  String                                           $os                 = downcase($facts['kernel']),

  # Installation
  Stdlib::Absolutepath                             $base_dir           = '/opt',
  Stdlib::Absolutepath                             $bin_dir            = '/usr/local/bin',
  Stdlib::HTTPUrl                                  $base_url           = 'https://github.com/storj/storj/releases/download',
  String                                           $download_extension = 'zip',
  Optional[Stdlib::HTTPUrl]                        $download_url       = undef,
  Optional[String]                                 $extract_command    = undef,
  Stdlib::Absolutepath                             $config_dir         = '/etc/storj',

  # User Management
  Boolean                                          $manage_user        = true,
  Boolean                                          $manage_group       = true,
  String                                           $user               = 'storj',
  String                                           $group              = 'storj',
  Stdlib::Absolutepath                             $user_shell         = '/bin/false',
  Array[String]                                    $extra_groups       = [],

  # Service
  Variant[Stdlib::Ensure::Service, Enum['absent']] $service_ensure     = 'running',
  String                                           $docker_tag         = 'beta',
  Stdlib::Port                                     $port               = 28967,
  Stdlib::Port                                     $dashboard_port     = 14002,

  # Extra Management
  Boolean                                          $manage_docker      = true,
) {
  case $facts['architecture'] {
    'x86_64', 'amd64': { $arch = 'amd64' }
    'aarch64'        : { $arch = 'arm64' }
    'armv7l'         : { $arch = 'arm'   }
    default: {
      fail("Unsupported kernel architecture: ${facts['architecture']}")
    }
  }

  if $download_url {
    $real_download_url = $download_url
  } else {
    $real_download_url = "${base_url}/v${version}/identity_${os}_${arch}.${download_extension}"
  }

  include storj::install
  include storj::config
  include storj::service

  Class['storj::install'] -> Class['storj::config'] -> Class['storj::service']

  if $manage_docker {
    include docker

    Class['docker'] -> Class['storj::install']
  }
}