Puppet Class: dmlite::disk

Defined in:
manifests/disk.pp

Overview

Parameters:

  • token_password (String)
  • token_id (Enum['ip','id', 'none']) (defaults to: 'ip')
  • mysql_username (Optional[String]) (defaults to: undef)
  • mysql_password (Optional[String]) (defaults to: undef)
  • mysql_host (Optional[Stdlib::Host]) (defaults to: undef)
  • mysql_dir_space_report_depth (Integer) (defaults to: 6)
  • dpmhost (Stdlib::Host) (defaults to: $::fqdn)
  • nshost (Stdlib::Host) (defaults to: $::fqdn)
  • debuginfo (Boolean) (defaults to: false)
  • log_level (Integer) (defaults to: 1)
  • logcomponents (Array[String]) (defaults to: [])
  • enable_space_reporting (Boolean) (defaults to: false)
  • enable_dome (Boolean) (defaults to: false)
  • enable_domeadapter (Boolean) (defaults to: false)
  • headnode_domeurl (Optional[String]) (defaults to: undef)
  • legacy (Boolean) (defaults to: true)
  • host_dn (String) (defaults to: '')


1
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
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
124
125
126
127
128
129
# File 'manifests/disk.pp', line 1

class dmlite::disk (
  String $token_password,
  Enum['ip','id', 'none'] $token_id = 'ip',
  Optional[String] $mysql_username = undef,
  Optional[String] $mysql_password = undef,
  Optional[Stdlib::Host] $mysql_host = undef,
  Integer $mysql_dir_space_report_depth = 6,
  Stdlib::Host $dpmhost = $::fqdn,
  Stdlib::Host $nshost = $::fqdn,
  Boolean $debuginfo = false,
  Integer $log_level = 1,
  Array[String] $logcomponents = [],
  Boolean $enable_space_reporting = false,
  Boolean $enable_dome = false,
  Boolean $enable_domeadapter = false,
  Optional[String] $headnode_domeurl = undef,
  Boolean $legacy = true,
  String $host_dn = '',
) {
  class {'dmlite::config::head':
    log_level     => $log_level,
    logcomponents => $logcomponents
  }
  class{'dmlite::install':
    debuginfo => $debuginfo
  }

  if $headnode_domeurl == undef {
    $_headnode_domeurl = "http://${dpmhost}:1094/domehead"
  }
  else {
    $_headnode_domeurl = $headnode_domeurl
  }

  if $enable_domeadapter and $enable_space_reporting{
    fail("'enable_domeadapter' and 'enable_space_reporting' options are mutual exclusive")
  }

  if $enable_dome  and $enable_domeadapter {
    class{'dmlite::plugins::domeadapter::config::disk':
      token_password => $token_password,
      token_id       => $token_id,
      dome_disk_url  => "http://${::fqdn}:1095/domedisk",
      dome_head_url  => $_headnode_domeurl,
      host_dn        => $host_dn
    }
    class{'dmlite::plugins::domeadapter::install':}

    class{'dmlite::plugins::adapter::install':
      uninstall      => true,
    }
    class{'dmlite::plugins::adapter::config::disk':
      token_password => $token_password,
      token_id       => $token_id,
      empty_conf     => true,
    }
  } else {
    class{'dmlite::plugins::adapter::config::disk':
      token_password => $token_password,
      token_id       => $token_id,
      dpmhost        => $dpmhost,
      nshost         => $nshost
    }
    class{'dmlite::plugins::adapter::install':}

    class{'dmlite::plugins::domeadapter::install':
      uninstall      => true,
    }
    class{'dmlite::plugins::domeadapter::config::disk':
      token_password => $token_password,
      token_id       => $token_id,
      empty_conf     => true,
      host_dn        => $host_dn
    }

  }

  if $enable_dome {
    #install the metapackage for disk
    if !$legacy {
      package{'dmlite-dpmdisk':
        ensure => absent,
      }
      package{'dmlite-dpmdisk-domeonly':
        ensure => present,
      }
    } else {
      package{'dmlite-dpmdisk-domeonly':
        ensure => absent,
      }
      package{'dmlite-dpmdisk':
        ensure => present,
      }
    }

    class{'dmlite::dome::config':
      dome_head                 => false,
      dome_disk                 => true,
      headnode_domeurl          => $_headnode_domeurl,
      restclient_cli_xrdhttpkey => $token_password
    }
    class{'dmlite::dome::install':}
  }

  if $enable_space_reporting {

    if $mysql_username == undef {
      fail("'mysql_username' not defined")
    }
    if $mysql_password == undef {
      fail("'mysql_password' not defined")
    }
    if $mysql_host == undef {
      fail("'mysql_host' not defined")
    }

    class{'dmlite::plugins::mysql::config':
      mysql_host                   => $mysql_host,
      mysql_username               => $mysql_username,
      mysql_password               => $mysql_password,
      dbpool_size                  => 10,
      enable_dpm                   => false,
      enable_ns                    => true,
      enable_io                    => true,
      mysql_dir_space_report_depth => $mysql_dir_space_report_depth,
    }
    class{'dmlite::plugins::mysql::install':}
  }
}