X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fhardware%2Fmanifests%2Fraid%2Fraidmpt.pp;h=f371c7227a4f4d9623a4193266a0009d009b9909;hb=ccb774315056b41918c7a345194a7ddb1784a72a;hp=c512913ec200daf3b973d345bd3feac021805b9b;hpb=84d0b284fff6d91fc155705191408c8901719ab2;p=mirror%2Fdsa-puppet.git diff --git a/modules/hardware/manifests/raid/raidmpt.pp b/modules/hardware/manifests/raid/raidmpt.pp index c512913ec..f371c7227 100644 --- a/modules/hardware/manifests/raid/raidmpt.pp +++ b/modules/hardware/manifests/raid/raidmpt.pp @@ -7,18 +7,27 @@ # include hardware::raid::raidmpt # class hardware::raid::raidmpt { + if $::mptraid { + package { 'mpt-status': + ensure => installed + } - package { 'mpt-status': - ensure => installed - } + file { '/etc/default/mpt-statusd': + content => "# This file is under puppet control\nRUN_DAEMON=no\n", + notify => Exec['mpt-statusd-stop'], + } - file { '/etc/default/mpt-statusd': - content => "# This file is under puppet control\nRUN_DAEMON=no\n", - notify => Exec['mpt-statusd-stop'], - } + exec { 'mpt-statusd-stop': + command => 'pidfile=/var/run/mpt-statusd.pid; ! [ -e "$pidfile" ] || /sbin/start-stop-daemon --oknodo --stop --signal TERM --quiet --pidfile "$pidfile"; rm -f "$pidfile"; pkill -INT -P 1 -u 0 -f "/usr/bin/daemon /etc/init.d/mpt-statusd check_mpt"', + refreshonly => true, + } + } else { + package { 'mpt-status': + ensure => purged, + } - exec { 'mpt-statusd-stop': - command => 'pidfile=/var/run/mpt-statusd.pid; ! [ -e "$pidfile" ] || /sbin/start-stop-daemon --oknodo --stop --signal TERM --quiet --pidfile "$pidfile"; rm -f "$pidfile"; pkill -INT -P 1 -u 0 -f "/usr/bin/daemon /etc/init.d/mpt-statusd check_mpt"', - refreshonly => true, + file { '/etc/default/mpt-statusd': + ensure => absent, + } } }