Blame SOURCES/sos-redis_collection_of_redis_from_scl.patch

99acac
From d90c3b862dfc26578afe5198bf19d70c394d9951 Mon Sep 17 00:00:00 2001
99acac
From: Jan Jansky <jjansky@redhat.com>
99acac
Date: Mon, 18 May 2020 12:32:14 +0200
99acac
Subject: [PATCH] [redis] Collection of redis from scl
99acac
99acac
As preparation for Satellite 7 configuration and log
99acac
collection adding collection of rh-redis32 from scl.
99acac
99acac
Resolves: #2074
99acac
99acac
Signed-off-by: Jan Jansky <jjansky@redhat.com>
99acac
---
99acac
 sos/plugins/redis.py | 52 ++++++++++++++++++++++++++++------------------------
99acac
 1 file changed, 28 insertions(+), 24 deletions(-)
99acac
99acac
diff --git a/sos/plugins/redis.py b/sos/plugins/redis.py
99acac
index 36d9052..0f01c4e 100644
99acac
--- a/sos/plugins/redis.py
99acac
+++ b/sos/plugins/redis.py
99acac
@@ -9,17 +9,17 @@
99acac
 #
99acac
 # See the LICENSE file in the source distribution for further information.
99acac
 
99acac
-from sos.plugins import Plugin, RedHatPlugin
99acac
+from sos.plugins import Plugin, SCLPlugin
99acac
 
99acac
 
99acac
-class Redis(Plugin, RedHatPlugin):
99acac
+class Redis(Plugin, SCLPlugin):
99acac
     """Redis, in-memory data structure store
99acac
     """
99acac
 
99acac
     plugin_name = 'redis'
99acac
     profiles = ('services',)
99acac
 
99acac
-    packages = ('redis',)
99acac
+    packages = ('redis', 'rh-redis32', 'rh-redis5')
99acac
     var_puppet_gen = "/var/lib/config-data/puppet-generated/redis"
99acac
     files = (
99acac
         '/etc/redis.conf',
99acac
@@ -35,6 +35,17 @@ class Redis(Plugin, RedHatPlugin):
99acac
             self.var_puppet_gen + "/etc/security/limits.d/"
99acac
         ])
99acac
 
99acac
+        for pkg in self.packages[1:]:
99acac
+            scl = pkg.split('rh-redis*-')[0]
99acac
+            self.add_copy_spec_scl(scl, [
99acac
+                '/etc/redis.conf',
99acac
+                '/etc/redis.conf.puppet',
99acac
+                '/etc/redis-sentinel.conf',
99acac
+                '/etc/redis-sentinel.conf.puppet',
99acac
+                '/var/log/redis/sentinel.log',
99acac
+                '/var/log/redis/redis.log'
99acac
+            ])
99acac
+
99acac
         self.add_cmd_output("redis-cli info")
99acac
         if self.get_option("all_logs"):
99acac
             self.add_copy_spec([
99acac
@@ -46,26 +57,19 @@ class Redis(Plugin, RedHatPlugin):
99acac
             ])
99acac
 
99acac
     def postproc(self):
99acac
-        self.do_file_sub(
99acac
-            "/etc/redis.conf",
99acac
-            r"(masterauth\s).*",
99acac
-            r"\1********"
99acac
-        )
99acac
-        self.do_file_sub(
99acac
-            "/etc/redis.conf",
99acac
-            r"(requirepass\s).*",
99acac
-            r"\1********"
99acac
-        )
99acac
-        self.do_path_regex_sub(
99acac
-            self.var_puppet_gen + "/etc/redis.conf*",
99acac
-            r"(masterauth\s).*",
99acac
-            r"\1*********"
99acac
-        )
99acac
-        self.do_path_regex_sub(
99acac
-            self.var_puppet_gen + "/etc/redis.conf*",
99acac
-            r"(requirepass\s).*",
99acac
-            r"\1*********"
99acac
-        )
99acac
-
99acac
+        for path in ["/etc/",
99acac
+                     self.var_puppet_gen + "/etc/",
99acac
+                     "/etc/opt/rh/rh-redis32/",
99acac
+                     "/etc/opt/rh/rh-redis5/"]:
99acac
+            self.do_file_sub(
99acac
+                path + "redis.conf",
99acac
+                r"(masterauth\s).*",
99acac
+                r"\1********"
99acac
+            )
99acac
+            self.do_file_sub(
99acac
+                path + "redis.conf",
99acac
+                r"(requirepass\s).*",
99acac
+                r"requirepass = ********"
99acac
+            )
99acac
 
99acac
 # vim: set et ts=4 sw=4 :
99acac
-- 
99acac
1.8.3.1
99acac