Faidon Liambotis has submitted this change and it was merged.

Change subject: raid: vary package installation on the RAID installed
......................................................................


raid: vary package installation on the RAID installed

Installing all RAID controller packages on all hosts is kind of a waste.
Use the newly-written $raid fact to differentiate systems based on what
kind of RAID controller they have installed and install the appropriate
packages.

Bug: T84050
Change-Id: Ia16b7ad8ad281640fe18fe77cb781d2480af54dc
---
M modules/raid/manifests/init.pp
1 file changed, 29 insertions(+), 9 deletions(-)

Approvals:
  Faidon Liambotis: Verified; Looks good to me, approved



diff --git a/modules/raid/manifests/init.pp b/modules/raid/manifests/init.pp
index c8f22eb..5ece243 100644
--- a/modules/raid/manifests/init.pp
+++ b/modules/raid/manifests/init.pp
@@ -9,17 +9,37 @@
 #  include raid
 
 class raid {
-    package { [ 'megacli', 'arcconf', 'mpt-status' ]:
-        ensure => 'latest',
+    # unfortunately, we don't support stringify_facts=false yet; when we
+    # eventually do, the fact should be adjusted to not join with ",", and the
+    # following line should be then removed.
+    $raid = split($::raid, ',')
+
+    if 'megaraid' in $raid {
+        require_package('megacli')
     }
 
-    file { '/etc/default/mpt-statusd':
-        ensure  => present,
-        owner   => 'root',
-        group   => 'root',
-        mode    => '0555',
-        content => "RUN_DAEMON=no\n",
-        before  => Package['mpt-status'],
+    if 'mpt' in $raid {
+        require_package('mpt-status')
+
+        file { '/etc/default/mpt-statusd':
+            ensure  => present,
+            owner   => 'root',
+            group   => 'root',
+            mode    => '0555',
+            content => "RUN_DAEMON=no\n",
+            before  => Package['mpt-status'],
+        }
+    }
+    if 'md' in $raid {
+        # if there is an "md" RAID configured, mdadm is already installed
+    }
+
+    if 'aac' in $raid {
+        require_package('arcconf')
+    }
+
+    if 'twe' in $raid {
+        require_package('tw-cli')
     }
 
     file { '/usr/local/lib/nagios/plugins/check_raid':

-- 
To view, visit https://gerrit.wikimedia.org/r/290999
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia16b7ad8ad281640fe18fe77cb781d2480af54dc
Gerrit-PatchSet: 7
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Volans <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to