raid: Added Linux software raid tools support.

This commit is contained in:
Timo Makinen 2014-01-31 17:31:28 +02:00
parent 956a224453
commit 532e48ba2c

View file

@ -8,6 +8,9 @@ class raid::tools {
if "smartarray" in $controllers {
include raid::tools::hpacucli
}
if "linux-md" in $controllers {
include raid::tools::mdadm
}
if "megaraid" in $controllers {
include raid::tools::megacli
}
@ -36,6 +39,48 @@ class raid::tools::hpacucli {
}
# Install Linux software raid tools (mdadm).
#
class raid::tools::mdadm {
if $::kernel != "Linux" {
fail("raid::tools::mdadm not supported in ${::operatingsystem}")
}
package { "mdadm":
ensure => installed,
}
case $::operatingsystem {
"centos", "fedora": {
file { "/etc/mdadm.conf":
ensure => present,
content => "MAILADDR root\n",
mode => "0644",
owner => "root",
group => "root",
require => Package["mdadm"],
notify => Service["mdadm"],
}
}
default: { }
}
service { "mdadm":
ensure => running,
name => $::operatingsystem ? {
"centos" => "mdmonitor",
"fedora" => "mdmonitor",
default => "mdadm",
},
enable => true,
hasstatus => true,
require => Package["mdadm"],
}
}
# Install MegaCli.
#
# Download MegaCli RPM from: