From: Stephen Gran Date: Thu, 3 May 2012 06:39:38 +0000 (+0100) Subject: reorder hardware modules X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=commitdiff_plain;h=40ccbb8afd9beaa8f41ee20d19aabe13dcd4f509 reorder hardware modules Signed-off-by: Stephen Gran --- diff --git a/modules/debian-org/manifests/proliant.pp b/modules/debian-org/manifests/proliant.pp deleted file mode 100644 index 28a177b4..00000000 --- a/modules/debian-org/manifests/proliant.pp +++ /dev/null @@ -1,32 +0,0 @@ -class debian-org::proliant { - - site::aptrepo { 'debian.restricted': - url => 'http://db.debian.org/debian-admin', - suite => 'lenny-restricted', - components => 'non-free', - } - - package { 'hpacucli': - ensure => installed, - require => [ - File['/etc/apt/sources.list.d/debian.restricted.list'], - Exec['apt-get update'] - ] - } - package { 'hp-health': - ensure => installed, - require => [ - File['/etc/apt/sources.list.d/debian.restricted.list'], - Exec['apt-get update'] - ] - } - package { 'arrayprobe': - ensure => installed, - } - - if $::debarchitecture == 'amd64' { - package { 'lib32gcc1': - ensure => installed, - } - } -} diff --git a/modules/hardware/manifests/init.pp b/modules/hardware/manifests/init.pp index e87de205..4865c9e4 100644 --- a/modules/hardware/manifests/init.pp +++ b/modules/hardware/manifests/init.pp @@ -1,14 +1,3 @@ class hardware { - if $::smartarraycontroller { - include debian-org::proliant - } - - if $::productname == 'PowerEdge 2850' { - include megactl - } - - if $::mptraid { - include raidmpt - } - + include hardware::raid } diff --git a/modules/hardware/manifests/raid.pp b/modules/hardware/manifests/raid.pp new file mode 100644 index 00000000..3affb898 --- /dev/null +++ b/modules/hardware/manifests/raid.pp @@ -0,0 +1,14 @@ +class hardware::raid { + if $::smartarraycontroller { + include hardware::raid::proliant + } + + if $::productname == 'PowerEdge 2850' { + include hardware::raid::megactl + } + + if $::mptraid { + include hardware::raid::raidmpt + } + +} diff --git a/modules/hardware/manifests/raid/megactl.pp b/modules/hardware/manifests/raid/megactl.pp new file mode 100644 index 00000000..9c7ec4bf --- /dev/null +++ b/modules/hardware/manifests/raid/megactl.pp @@ -0,0 +1,16 @@ +class hardware::raid::megactl { + + package { 'megactl': + ensure => installed, + require => [ + File['/etc/apt/sources.list.d/debian.restricted.list'], + Exec['apt-get update'] + ] + } + + site::aptrepo { 'debian.restricted': + url => 'http://db.debian.org/debian-admin', + suite => 'lenny-restricted', + components => 'non-free', + } +} diff --git a/modules/hardware/manifests/raid/proliant.pp b/modules/hardware/manifests/raid/proliant.pp new file mode 100644 index 00000000..574d601e --- /dev/null +++ b/modules/hardware/manifests/raid/proliant.pp @@ -0,0 +1,32 @@ +class hardware::raid::proliant { + + site::aptrepo { 'debian.restricted': + url => 'http://db.debian.org/debian-admin', + suite => 'lenny-restricted', + components => 'non-free', + } + + package { 'hpacucli': + ensure => installed, + require => [ + File['/etc/apt/sources.list.d/debian.restricted.list'], + Exec['apt-get update'] + ] + } + package { 'hp-health': + ensure => installed, + require => [ + File['/etc/apt/sources.list.d/debian.restricted.list'], + Exec['apt-get update'] + ] + } + package { 'arrayprobe': + ensure => installed, + } + + if $::debarchitecture == 'amd64' { + package { 'lib32gcc1': + ensure => installed, + } + } +} diff --git a/modules/hardware/manifests/raid/raidmpt.pp b/modules/hardware/manifests/raid/raidmpt.pp new file mode 100644 index 00000000..c512913e --- /dev/null +++ b/modules/hardware/manifests/raid/raidmpt.pp @@ -0,0 +1,24 @@ +# = Class: hardware::raid::raidmpt +# +# This class installs mpt-status and ensures the daemon is not running +# +# == Sample Usage: +# +# include hardware::raid::raidmpt +# +class hardware::raid::raidmpt { + + 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'], + } + + 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, + } +} diff --git a/modules/megactl/manifests/init.pp b/modules/megactl/manifests/init.pp deleted file mode 100644 index 252b418e..00000000 --- a/modules/megactl/manifests/init.pp +++ /dev/null @@ -1,15 +0,0 @@ -class megactl { - package { 'megactl': - ensure => installed, - require => [ - File['/etc/apt/sources.list.d/debian.restricted.list'], - Exec['apt-get update'] - ] - } - - site::aptrepo { 'debian.restricted': - url => 'http://db.debian.org/debian-admin', - suite => 'lenny-restricted', - components => 'non-free', - } -} diff --git a/modules/raidmpt/manifests/init.pp b/modules/raidmpt/manifests/init.pp deleted file mode 100644 index 2d84af15..00000000 --- a/modules/raidmpt/manifests/init.pp +++ /dev/null @@ -1,24 +0,0 @@ -# = Class: raidmpt -# -# This class installs mpt-status and ensures the daemon is not running -# -# == Sample Usage: -# -# include raidmpt -# -class raidmpt { - - 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'], - } - - 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, - } -}