From: Peter Palfrader Date: Sat, 18 Mar 2017 18:48:38 +0000 (+0100) Subject: And clean out mptraid things if we do not have mptraid X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;ds=sidebyside;h=ccb774315056b41918c7a345194a7ddb1784a72a;p=mirror%2Fdsa-puppet.git And clean out mptraid things if we do not have mptraid --- diff --git a/modules/hardware/manifests/raid.pp b/modules/hardware/manifests/raid.pp index 3affb8983..d682c30b2 100644 --- a/modules/hardware/manifests/raid.pp +++ b/modules/hardware/manifests/raid.pp @@ -7,8 +7,5 @@ class hardware::raid { include hardware::raid::megactl } - if $::mptraid { - include hardware::raid::raidmpt - } - + include hardware::raid::raidmpt } 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, + } } }