From 4cd4fc59cb88ec5b37ff71da3bc06781f3bd3a9c Mon Sep 17 00:00:00 2001 From: Rudnei Bertol Junior Date: Tue, 5 Mar 2024 17:57:42 -0300 Subject: [AAP RECEPTOR] Add a new AAP receptor plugin. Adding the file 'aap_receptor.py' for the sos report collects the files used for troubleshooting issues at Ansible Automation Platform Controller/Execution Nodes Related: RH AAP-19657 Signed-off-by: Rudnei Bertol Junior --- sos/report/plugins/aap_receptor.py | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sos/report/plugins/aap_receptor.py diff --git a/sos/report/plugins/aap_receptor.py b/sos/report/plugins/aap_receptor.py new file mode 100644 index 00000000..731b3f87 --- /dev/null +++ b/sos/report/plugins/aap_receptor.py @@ -0,0 +1,53 @@ +# Copyright (c) 2024 Rudnei Bertol Jr + +# This file is part of the sos project: https://github.com/sosreport/sos +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions of +# version 2 of the GNU General Public License. +# +# See the LICENSE file in the source distribution for further information. + +import glob +from sos.report.plugins import Plugin, RedHatPlugin + + +class AAPreceptorPlugin(Plugin, RedHatPlugin): + short_desc = 'AAP receptor plugin' + plugin_name = 'aap_receptor' + profiles = ('sysmgmt', 'ansible') + packages = ('receptor', 'receptorctl') + services = ('receptor',) + + def setup(self): + self.add_copy_spec([ + "/etc/receptor", + "/var/lib/receptor", + ]) + + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/receptor" + ]) + else: + self.add_copy_spec([ + "/var/log/receptor/*.log" + ]) + + self.add_forbidden_path([ + "/etc/receptor/tls", + "/etc/receptor/*key.pem" + ]) + + self.add_cmd_output([ + "ls -llZ /etc/receptor", + "ls -llZ /var/run/receptor", + "ls -llZ /var/run/awx-receptor" + ]) + + for s in glob.glob('/var/run/*receptor/*.sock'): + self.add_cmd_output(f"receptorctl --socket {s} status", + suggest_filename="receptorctl_status") + break + +# vim: set et ts=4 sw=4 : -- cgit