Try to retire the site module: move site::aptrepo to base
[mirror/dsa-puppet.git] / modules / hardware / manifests / raid / proliant.pp
index 574d601..305cfc4 100644 (file)
@@ -1,32 +1,51 @@
 class hardware::raid::proliant {
+       if $::smartarraycontroller_hpsa or $::smartarraycontroller_cciss {
+               base::aptrepo { 'debian.restricted':
+                       ensure => absent,
+               }
+               include debian_org::apt_restricted
 
-       site::aptrepo { 'debian.restricted':
-               url        => 'http://db.debian.org/debian-admin',
-               suite      => 'lenny-restricted',
-               components => 'non-free',
-       }
+               package { 'hpacucli':
+                       ensure  => installed,
+                       tag    => extra_repo,
+               }
+               package { 'hpssacli':
+                       ensure  => installed,
+                       tag    => extra_repo,
+               }
+               if !("$::systemproductname" in ["ProLiant DL180 G5", "ProLiant DL120 G5", "ProLiant ML150 G5"]) {
+                       package { 'hp-health':
+                               ensure => installed,
+                               tag    => extra_repo,
+                       }
+               }
 
-       package { 'hpacucli':
-               ensure  => installed,
-               require => [
-                       File['/etc/apt/sources.list.d/debian.restricted.list'],
-                       Exec['apt-get update']
-               ]
-       }
-       package { 'hp-health':
-               ensure => installed,
-               require => [
-                       File['/etc/apt/sources.list.d/debian.restricted.list'],
-                       Exec['apt-get update']
-               ]
-       }
-       package { 'arrayprobe':
-               ensure => installed,
-       }
+               if $::debarchitecture == 'amd64' {
+                       package { 'lib32gcc1':
+                               ensure => installed,
+                       }
+               }
 
-       if $::debarchitecture == 'amd64' {
-               package { 'lib32gcc1':
-                       ensure => installed,
+               if $::smartarraycontroller_hpsa {
+                       $cmd = $hostname ? {
+                               'lobos' => 'dsa-check-hpssacli --no-battery',
+                               'villa' => 'dsa-check-hpssacli --no-battery',
+                               'lw08'  => 'dsa-check-hpssacli --no-battery --ignore-cache',
+                               default => 'dsa-check-hpssacli'
+                       }
+
+                       concat::fragment { 'dsa-puppet-stuff--nagios--dsa-check-hpssacli':
+                               target => '/etc/cron.d/dsa-puppet-stuff',
+                               order  => '020',
+                               content  => @("EOF")
+                                       27 */2 * * * root sleep $(( RANDOM \% 900 )); dsa-wrap-nagios-check ${cmd}
+                                       | EOF
+                       }
+               }
+               file { '/etc/cron.d/puppet-nagios-hpsa': ensure => absent, }
+       } else {
+               base::aptrepo { 'debian.restricted':
+                       ensure => absent,
                }
        }
 }