0360087241353c319f4ef80a9eeaf096725047c7
[mirror/dsa-puppet.git] / modules / hardware / manifests / raid / proliant.pp
1 class hardware::raid::proliant {
2         if $::smartarraycontroller_hpsa or $::smartarraycontroller_cciss {
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                 if $::smartarraycontroller_hpsa {
31                         $cmd = $hostname ? {
32                                 'lobos' => 'dsa-check-hpssacli --no-battery',
33                                 'villa' => 'dsa-check-hpssacli --no-battery',
34                                 'lw08'  => 'dsa-check-hpssacli --no-battery --ignore-cache',
35                                 default => 'dsa-check-hpssacli'
36                         }
37
38                         concat::fragment { 'dsa-puppet-stuff--nagios--dsa-check-hpssacli':
39                                 target => '/etc/cron.d/dsa-puppet-stuff',
40                                 order  => '020',
41                                 content  => @("EOF")
42                                         27 */2 * * * root sleep $(( RANDOM \% 900 )); dsa-wrap-nagios-check ${cmd}
43                                         | EOF
44                         }
45                 }
46                 file { '/etc/cron.d/puppet-nagios-hpsa': ensure => absent, }
47         } else {
48                 site::aptrepo { 'debian.restricted':
49                         ensure => absent,
50                 }
51         }
52 }