Puppet Class: hp_spp::hpsmh

Inherits:
hp_spp::params
Defined in:
manifests/hpsmh.pp

Overview

Class: hp_spp::hpsmh

This class handles installation of the HP Service Pack for ProLiant System Management Homepage.

Parameters:

ensure

Ensure if present or absent. Default: present

autoupgrade

Upgrade package automatically, if there is a newer version. Default: false

service_ensure

Ensure if service is running or stopped. Default: running

service_enable

Start service at boot. Default: true

admin_group

List of OS users to put in the SMH admin group, separated by semicolons. Default: empty

operator_group

List of OS users to put in the SMH operator group, separated by semicolons. Default: empty

user_group

List of OS users to put in the SMH user group, separated by semicolons. Default: empty

allow_default_os_admin

Allow the OS root user to login to SMH. Default: true

anonymous_access

Allow an unauthenticated user to log in to SMH. Default: false

localaccess_enabled

Enable unauthenticated access from localhost. Default: false

localaccess_type

The type of authorization when localaccess_enabled=true. administrator|anonymous Default: Anonymous

trustmode

? TrustByName|TrustByCert|TrustByAll Default: TrustByCert

xenamelist

A list of trusted server hostnames. Default: empty

ip_binding

Bind SMH to a specific IP address on the host? Default: false

ip_binding_list

A list IP addresses and/or IP address/netmask pairs, separated by semicolons. Default: empty

ip_restricted_logins

Restrict logins to SMH via IP address? Default: false

ip_restricted_include

A list of IP addresses, separated by semicolons. Default: empty

ip_restricted_exclude

A list of IP addresses, separated by semicolons. Default: empty

autostart

? Default: false

timeoutsmh

? Default: 30

port2301

Whether to enable unencrypted port 2301 access. Default: true

iconview

? Default: false

box_order

? Default: status

box_item_order

? Default: status

session_timeout

? Default: 15

ui_timeout

? Default: 120

httpd_error_log

? Default: false

multihomed

A list of hostnames and IP addresses, separated by semicolons. Default: empty

rotate_logs_size

? Default: 5

Actions:

Installs and configures the HP System Management Homepage. Installs the HP Array Configuration Utility. Installs the HP Insight Diagnostics.

Requires:

Class Class Class

Authors:

Mike Arnold <mike@razorsedge.org>

Copyright © 2012 Mike Arnold, unless otherwise noted.

Parameters:

  • ensure (Any) (defaults to: 'present')
  • autoupgrade (Any) (defaults to: false)
  • service_ensure (Any) (defaults to: 'running')
  • service_enable (Any) (defaults to: true)
  • admin_group (Any) (defaults to: undef)
  • operator_group (Any) (defaults to: undef)
  • user_group (Any) (defaults to: undef)
  • allow_default_os_admin (Any) (defaults to: 'true')
  • anonymous_access (Any) (defaults to: 'false')
  • localaccess_enabled (Any) (defaults to: 'false')
  • localaccess_type (Any) (defaults to: 'Anonymous')
  • trustmode (Any) (defaults to: 'TrustByCert')
  • xenamelist (Any) (defaults to: undef)
  • ip_binding (Any) (defaults to: 'false')
  • ip_binding_list (Any) (defaults to: undef)
  • ip_restricted_logins (Any) (defaults to: 'false')
  • ip_restricted_include (Any) (defaults to: undef)
  • ip_restricted_exclude (Any) (defaults to: undef)
  • autostart (Any) (defaults to: 'false')
  • timeoutsmh (Any) (defaults to: 30)
  • port2301 (Any) (defaults to: 'true')
  • iconview (Any) (defaults to: 'false')
  • box_order (Any) (defaults to: 'status')
  • box_item_order (Any) (defaults to: 'status')
  • session_timeout (Any) (defaults to: 15)
  • ui_timeout (Any) (defaults to: 120)
  • httpd_error_log (Any) (defaults to: 'false')
  • multihomed (Any) (defaults to: undef)
  • rotate_logs_size (Any) (defaults to: 5)


147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'manifests/hpsmh.pp', line 147

class hp_spp::hpsmh (
  $ensure                 = 'present',
  $autoupgrade            = false,
  $service_ensure         = 'running',
  $service_enable         = true,
  $admin_group            = undef,
  $operator_group         = undef,
  $user_group             = undef,
  $allow_default_os_admin = 'true', # lint:ignore:quoted_booleans
  $anonymous_access       = 'false', # lint:ignore:quoted_booleans
  $localaccess_enabled    = 'false', # lint:ignore:quoted_booleans
  $localaccess_type       = 'Anonymous',
  $trustmode              = 'TrustByCert',
  $xenamelist             = undef,
  $ip_binding             = 'false', # lint:ignore:quoted_booleans
  $ip_binding_list        = undef,
  $ip_restricted_logins   = 'false', # lint:ignore:quoted_booleans
  $ip_restricted_include  = undef,
  $ip_restricted_exclude  = undef,
  $autostart              = 'false', # lint:ignore:quoted_booleans
  $timeoutsmh             = 30,
  $port2301               = 'true', # lint:ignore:quoted_booleans
  $iconview               = 'false', # lint:ignore:quoted_booleans
  $box_order              = 'status',
  $box_item_order         = 'status',
  $session_timeout        = 15,
  $ui_timeout             = 120,
  $httpd_error_log        = 'false', # lint:ignore:quoted_booleans
  $multihomed             = undef,
  $rotate_logs_size       = 5
) inherits hp_spp::params {
  # Validate our booleans
  validate_bool($autoupgrade)
  validate_bool($service_enable)

  case $ensure {
    /(present)/: {
      if $autoupgrade == true {
        $package_ensure = 'latest'
      } else {
        $package_ensure = 'present'
      }
      $file_ensure = 'present'
      $file_ensure_link = 'link'
      if $service_ensure in [ running, stopped ] {
        $service_ensure_real = $service_ensure
        $service_enable_real = $service_enable
      } else {
        fail('service_ensure parameter must be running or stopped')
      }
    }
    /(absent)/: {
      $package_ensure = 'absent'
      $file_ensure = 'absent'
      $file_ensure_link = 'absent'
      $service_ensure_real = 'stopped'
      $service_enable_real = false
    }
    default: {
      fail('ensure parameter must be present or absent')
    }
  }

  case $::manufacturer {
    'HP': {
      #Class['hp_spp'] -> Class['hp_spp::repo'] -> Class['hp_spp::hpsnmp'] ->
      #Class['hp_spp::hpsmh']

      realize Group['hpsmh']
      realize User['hpsmh']

      if $hp_spp::params::arrayweb_package_name {
        package { $hp_spp::params::arrayweb_package_name:
          ensure => $package_ensure,
          notify => Service['hpsmhd'],
        }
      }

      package { 'hpdiags':
        ensure  => $package_ensure,
        require => Package['hpsmh'],
        notify  => Service['hpsmhd'],
      }

      package { 'hp-smh-templates':
        ensure  => $package_ensure,
        require => Package['hpsmh'],
#        require => Package['hp-snmp-agents'],
        notify  => Service['hpsmhd'],
      }

      package { 'hpsmh':
        ensure  => $package_ensure,
      }

      # TODO: Figure out some dynamic way to use hpsmh-cert-host1
      # This file resource installs the cert from the HP SIM server into SMH so
      # that when clicking through to the host from SIM, the user is not
      # prompted for authentication.  Multiple certs can be specified.
#      file { 'hpsmh-cert-host1':
#        ensure  => $file_ensure,
#        mode    => '0644',
#        owner   => 'root',
#        group   => 'root',
#        path    => '/opt/hp/hpsmh/certs/host1.pem',
#        source  => 'puppet:///modules/hp_spp/host1.pem',
#        require => Package['hpsmh'],
#        notify  => Service['hpsmhd'],
#      }

      # TODO: SMH server certs are in /etc/opt/hp/sslshare/{cert,file}.pem

      # TODO: Exec['smhconfig'] or File['hpsmhconfig']?
      file { 'hpsmhconfig':
        ensure  => $file_ensure,
        mode    => '0644',
        owner   => 'root',
        group   => 'root',
        path    => '/opt/hp/hpsmh/conf/smhpd.xml',
        content => template('hp_spp/smhpd.xml.erb'),
        require => Package['hpsmh'],
        notify  => Service['hpsmhd'],
      }
#      exec { 'smhconfig':
#        command => '/opt/hp/hpsmh/sbin/smhconfig --trustmode=TrustByCert',
#        notify  => Service['hpsmhd'],
#      }

      service { 'hpsmhd':
        ensure     => $service_ensure_real,
        enable     => $service_enable_real,
        hasrestart => true,
        hasstatus  => true,
        require    => Package['hpsmh'],
      }

      file { '/var/spool/opt/hp/hpsmh/run/httpd.pid':
        ensure  => $file_ensure_link,
        target  => '/opt/hp/hpsmh/logs/httpd.pid',
        before  => Service['hpsmhd'],
        require => Package['hpsmh'],
      }
    }
    # If we are not on HP hardware, do not do anything.
    default: { }
  }
}