lobos and villa do not have a battery on their raid controller
[mirror/dsa-puppet.git] / modules / hardware / manifests / raid / proliant.pp
index 410bb5e..fab4520 100644 (file)
@@ -1,26 +1,55 @@
 class hardware::raid::proliant {
+       if $::smartarraycontroller_hpsa or $::smartarraycontroller_cciss {
+               site::aptrepo { 'debian.restricted':
+                       url        => 'http://db.debian.org/debian-admin',
+                       suite      => "${::lsbdistcodename}-restricted",
+                       components => 'non-free',
+               }
 
-       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,
-               tag    => extra_repo,
-       }
-       package { 'hp-health':
-               ensure => installed,
-               tag    => extra_repo,
-       }
-       package { 'arrayprobe':
-               ensure => installed,
-       }
+               if $::debarchitecture == 'amd64' {
+                       package { 'lib32gcc1':
+                               ensure => installed,
+                       }
+               }
 
-       if $::debarchitecture == 'amd64' {
-               package { 'lib32gcc1':
-                       ensure => installed,
+               if $::smartarraycontroller_hpsa {
+                       if $::hostname in [lobos,villa] {
+                               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 dsa-check-hpssacli
+                                               | EOF
+                               }
+                       } else {
+                               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 dsa-check-hpssacli --no-battery
+                                               | EOF
+                               }
+                       }
+               }
+               file { '/etc/cron.d/puppet-nagios-hpsa': ensure => absent, }
+       } else {
+               site::aptrepo { 'debian.restricted':
+                       ensure => absent,
                }
        }
 }