diff --git a/raid/manifests/init.pp b/raid/manifests/init.pp index 9472d58..7a3787b 100644 --- a/raid/manifests/init.pp +++ b/raid/manifests/init.pp @@ -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: