run dsa-check-hpssacli out of cron on smartarraycontroller_hpsa hosts
[mirror/dsa-puppet.git] / modules / hardware / manifests / raid / proliant.pp
1 class hardware::raid::proliant {
2         if $::smartarraycontroller {
3                 site::aptrepo { 'debian.restricted':
4                         url        => 'http://db.debian.org/debian-admin',
5                         suite      => "${::lsbdistcodename}-restricted",
6                         components => 'non-free',
7                 }
8
9                 package { 'hpacucli':
10                         ensure  => installed,
11                         tag    => extra_repo,
12                 }
13                 package { 'hpssacli':
14                         ensure  => installed,
15                         tag    => extra_repo,
16                 }
17                 if !("$::systemproductname" in ["ProLiant DL180 G5", "ProLiant DL120 G5", "ProLiant ML150 G5"]) {
18                         package { 'hp-health':
19                                 ensure => installed,
20                                 tag    => extra_repo,
21                         }
22                 }
23
24                 if $::debarchitecture == 'amd64' {
25                         package { 'lib32gcc1':
26                                 ensure => installed,
27                         }
28                 }
29
30                 file { '/etc/cron.d/puppet-nagios-hpsa':
31                         ensure => ($::smartarraycontroller_hpsa) ? {
32                                 true    => 'present',
33                                 default => 'absent'
34                         },
35                         content  => @(EOF)
36                                 SHELL=/bin/bash
37                                 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/nagios/plugins
38                                 42 * * * 0 root sleep $(( $RANDOM \% 900 )); dsa-wrap-nagios-check dsa-check-hpssacli
39                                 | EOF
40
41                 }
42         } else {
43                 site::aptrepo { 'debian.restricted':
44                         ensure => absent,
45                 }
46         }
47 }