From 99f17199c8312ebb43b6236ef000e1a1baabb46e Mon Sep 17 00:00:00 2001 From: Marek Czernek Date: Fri, 27 Oct 2023 09:49:41 +0200 Subject: [salt] gather more data, e.g. services, grains, pillars, and more Signed-off-by: Marek Czernek --- sos/report/plugins/salt.py | 36 +++++++++++++++++++++++++++++++++--- sos/report/plugins/saltmaster.py | 32 +++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/sos/report/plugins/salt.py b/sos/report/plugins/salt.py index bad5e3a6..b3b113d2 100644 --- a/sos/report/plugins/salt.py +++ b/sos/report/plugins/salt.py @@ -5,6 +5,7 @@ # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution for further information. +import re from sos.report.plugins import Plugin, IndependentPlugin @@ -16,7 +17,7 @@ class Salt(Plugin, IndependentPlugin): plugin_name = 'salt' profiles = ('sysmgmt',) - packages = ('salt', 'salt-minion', 'salt-common',) + packages = ('salt', 'salt-minion', 'venv-salt-minion', 'salt-common',) def setup(self): all_logs = self.get_option("all_logs") @@ -26,12 +27,41 @@ class Salt(Plugin, IndependentPlugin): else: self.add_copy_spec("/var/log/salt") - self.add_copy_spec("/etc/salt") - self.add_forbidden_path("/etc/salt/pki/*/*.pem") + self.add_copy_spec([ + "/var/log/venv-salt-minion.log", + "/var/log/salt-ssh.log", + ]) + + self.add_copy_spec([ + "/etc/salt", + "/etc/venv-salt-minion/", + "/usr/local/etc/salt", + ]) + self.add_forbidden_path([ + "/etc/salt/pki/*/*.pem", + "/etc/venv-salt-minion/pki/*/*.pem", + "/usr/local/etc/salt/pki/*/*.pem", + ]) + + self.add_cmd_output([ + "systemctl --full status salt-minion", + "systemctl --full status venv-salt-minion", + "salt-minion --versions-report", + "venv-salt-minion --versions-report", + "salt-call --local grains.items --out yaml", + "venv-salt-call --local grains.items --out yaml", + ], timeout=30) def postproc(self): regexp = r'(^\s+.*(pass|secret|(?