Defined Type: openiosds::oioblobindexer

Defined in:
manifests/oioblobindexer.pp

Overview

Configure and install an OpenIO oioblobindexer service

Parameters:

  • action (Any) (defaults to: 'create')
  • type (Any) (defaults to: 'oio-blob-indexer')
  • num (Any) (defaults to: '0')
  • ns (Any) (defaults to: undef)
  • volume (Any) (defaults to: undef)
  • report_interval (Any) (defaults to: '5')
  • chunks_per_second (Any) (defaults to: '2')
  • interval (Any) (defaults to: '300')
  • no_exec (Any) (defaults to: false)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
# File 'manifests/oioblobindexer.pp', line 2

define openiosds::oioblobindexer (
  $action            = 'create',
  $type              = 'oio-blob-indexer',
  $num               = '0',

  $ns                = undef,
  $volume            = undef,
  $report_interval   = '5',
  $chunks_per_second = '2',
  $interval          = '300',

  $no_exec           = false,
) {

  if ! defined(Class['openiosds']) {
    include openiosds
  }

  # Validation
  $actions = ['create','remove']
  validate_re($action,$actions,"${action} is invalid.")
  validate_string($type)
  validate_integer($num)
  validate_string($ns)
  if $volume { $_volume = $volume }
  else { $_volume = "${openiosds::sharedstatedir}/${ns}/rawx-${num}" }
  validate_integer($report_interval)
  validate_integer($chunks_per_second)
  validate_integer($interval)

  # Namespace
  if $action == 'create' {
    if ! defined(Openiosds::Namespace[$ns]) {
      fail('You must include the namespace class before using OpenIO defined types.')
    }
  }

  # Service
  openiosds::service {"${ns}-${type}-${num}":
    action => $action,
    type   => $type,
    num    => $num,
    ns     => $ns,
  } ->
  # Configuration files
  file { "${openiosds::sysconfdir}/${ns}/${type}-${num}/${type}-${num}.conf":
    ensure  => $openiosds::file_ensure,
    content => template("openiosds/${type}.conf.erb"),
    mode    => $openiosds::file_mode,
  } ->
  # Init
  gridinit::program { "${ns}-${type}-${num}":
    action  => $action,
    command => "${openiosds::bindir}/${type} ${openiosds::sysconfdir}/${ns}/${type}-${num}/${type}-${num}.conf",
    group   => "${ns},${type},${type}-${num}",
    uid     => $openiosds::user,
    gid     => $openiosds::group,
    no_exec => $no_exec,
  }

}