diff --git a/sos/report/plugins/frr.py b/sos/report/plugins/frr.py index ccb385a56b..2c5cf214f4 100644 --- a/sos/report/plugins/frr.py +++ b/sos/report/plugins/frr.py @@ -29,7 +29,11 @@ class Frr(Plugin, RedHatPlugin): containers = ('frr',) def setup(self): - self.add_copy_spec("/etc/frr/") + var_ansible_gen = "/var/lib/config-data/ansible-generated/frr" + self.add_copy_spec([ + "/etc/frr/", + var_ansible_gen + "/etc/frr/", + ]) if self.container_exists('frr'): subcmds = [ diff --git a/sos/report/plugins/libvirt.py b/sos/report/plugins/libvirt.py index 60c439ef05..8f5b3ceff9 100644 --- a/sos/report/plugins/libvirt.py +++ b/sos/report/plugins/libvirt.py @@ -6,7 +6,7 @@ # # See the LICENSE file in the source distribution for further information. -from sos.report.plugins import Plugin, IndependentPlugin +from sos.report.plugins import Plugin, IndependentPlugin, RedHatPlugin import glob @@ -15,7 +15,7 @@ class Libvirt(Plugin, IndependentPlugin): short_desc = 'libvirt virtualization API' plugin_name = 'libvirt' - profiles = ('system', 'virt') + profiles = ('system', 'virt', 'openstack_edpm') def setup(self): libvirt_keytab = "/etc/libvirt/krb5.tab" @@ -89,4 +89,20 @@ def postproc(self): for path_exp in libvirt_path_exps: self.do_path_regex_sub(path_exp, match_exp, r"\1******\3") +class RedHatLibvirt(Libvirt, RedHatPlugin): + + def setup(self): + super(RedHatLibvirt, self).setup() + self.add_copy_spec([ + "/var/lib/openstack/config/libvirt", + "/var/lib/openstack/containers/libvirt*.json" + ]) + + if not self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/containers/qemu/*.log*", + ]) + else: + self.add_copy_spec("/var/log/containers/qemu/*") + # vim: set et ts=4 sw=4 : diff --git a/sos/report/plugins/logrotate.py b/sos/report/plugins/logrotate.py index 7874d5ca21..b61579e42f 100644 --- a/sos/report/plugins/logrotate.py +++ b/sos/report/plugins/logrotate.py @@ -17,6 +17,7 @@ class LogRotate(Plugin, IndependentPlugin): profiles = ('system',) var_puppet_gen = "/var/lib/config-data/puppet-generated/crond" + var_ansible_gen = "/var/lib/config-data/ansible-generated/crond" def setup(self): self.add_cmd_output("logrotate --debug /etc/logrotate.conf", @@ -26,7 +27,9 @@ def setup(self): "/var/lib/logrotate.status", "/var/lib/logrotate/logrotate.status", self.var_puppet_gen + "/etc/logrotate-crond.conf", - self.var_puppet_gen + "/var/spool/cron/root" + self.var_puppet_gen + "/var/spool/cron/root", + self.var_ansible_gen + "/etc/logrotate-crond.conf", + self.var_ansible_gen + "/var/spool/cron/root" ]) # vim: set et ts=4 sw=4 : diff --git a/sos/report/plugins/openstack_edpm.py b/sos/report/plugins/openstack_edpm.py new file mode 100644 index 0000000000..63cffb51fb --- /dev/null +++ b/sos/report/plugins/openstack_edpm.py @@ -0,0 +1,37 @@ +# Copyright (C) 2023 Red Hat, Inc., Roberto Alfieri + +# 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. + +from sos.report.plugins import Plugin, RedHatPlugin + + +class OpenStackEDPM(Plugin, RedHatPlugin): + + short_desc = 'Installation information from OpenStack EDPM deployment' + + plugin_name = 'openstack_edpm' + profiles = ('openstack', 'openstack_edpm') + + def setup(self): + # Notes: recursion is max 2 for edpm-config + # Those directories are present on all OpenStack nodes + self.edpm_log_paths = [ + '/var/lib/edpm-config/' + ] + self.add_copy_spec(self.edpm_log_paths) + + def postproc(self): + # Ensures we do not leak passwords from the edpm related locations + # Other locations don't have sensitive data. + regexp = r'(".*(key|password|pass|secret|database_connection))' \ + r'([":\s]+)(.*[^"])([",]+)' + for path in self.edpm_log_paths: + self.do_path_regex_sub(path, regexp, r'\1\3*********\5') + +# vim: set et ts=4 sw=4 : diff --git a/sos/report/plugins/openstack_neutron.py b/sos/report/plugins/openstack_neutron.py index f24dfebef4..88f3701e03 100644 --- a/sos/report/plugins/openstack_neutron.py +++ b/sos/report/plugins/openstack_neutron.py @@ -17,7 +17,7 @@ class OpenStackNeutron(Plugin): short_desc = 'OpenStack Networking' plugin_name = "openstack_neutron" - profiles = ('openstack', 'openstack_controller', 'openstack_compute') + profiles = ('openstack', 'openstack_controller', 'openstack_compute', 'openstack_edpm') var_puppet_gen = "/var/lib/config-data/puppet-generated/neutron" @@ -125,9 +125,15 @@ def setup(self): class RedHatNeutron(OpenStackNeutron, RedHatPlugin): packages = ('openstack-selinux',) + var_ansible_gen = "/var/lib/config-data/ansible-generated/" def setup(self): super(RedHatNeutron, self).setup() - self.add_copy_spec("/etc/sudoers.d/neutron-rootwrap") + self.add_copy_spec([ + "/etc/sudoers.d/neutron-rootwrap", + self.var_ansible.gen + "/neutron-dhcp-agent/", + self.var_ansible.gen + "/neutron-dhcp-ovn/", + self.var_ansible_gen + "/neutron-sriov-agent/" + ]) # vim: set et ts=4 sw=4 : diff --git a/sos/report/plugins/openstack_nova.py b/sos/report/plugins/openstack_nova.py index 15e3ecc129..3e84d6b1c4 100644 --- a/sos/report/plugins/openstack_nova.py +++ b/sos/report/plugins/openstack_nova.py @@ -22,7 +22,7 @@ class OpenStackNova(Plugin): short_desc = 'OpenStack Nova' plugin_name = "openstack_nova" - profiles = ('openstack', 'openstack_controller', 'openstack_compute') + profiles = ('openstack', 'openstack_controller', 'openstack_compute', 'openstack_edpm') containers = ('.*nova_api',) var_puppet_gen = "/var/lib/config-data/puppet-generated/nova" @@ -215,15 +215,19 @@ def setup(self): "/etc/polkit-1/localauthority/50-local.d/50-nova.pkla", "/etc/sudoers.d/nova", "/etc/security/limits.d/91-nova.conf", - "/etc/sysconfig/openstack-nova-novncproxy" + "/etc/sysconfig/openstack-nova-novncproxy", + "/var/lib/openstack/config/nova", + "/var/lib/openstack/containers/nova*.json" ]) if self.get_option("all_logs"): self.add_copy_spec([ "/var/log/httpd/placement*", + "/var/log/containers/nova/*" ]) else: self.add_copy_spec([ "/var/log/httpd/placement*.log", + "/var/log/containers/nova/*.log" ]) # vim: set et ts=4 sw=4 : diff --git a/sos/report/plugins/ovn_host.py b/sos/report/plugins/ovn_host.py index 25c38ccccd..6e61d24d1a 100644 --- a/sos/report/plugins/ovn_host.py +++ b/sos/report/plugins/ovn_host.py @@ -24,7 +24,7 @@ class OVNHost(Plugin): short_desc = 'OVN Controller' plugin_name = "ovn_host" - profiles = ('network', 'virt') + profiles = ('network', 'virt', 'openstack_edpm') def setup(self): if os.environ.get('OVS_RUNDIR'): @@ -56,7 +56,22 @@ def check_enabled(self): class RedHatOVNHost(OVNHost, RedHatPlugin): packages = ('openvswitch-ovn-host', 'ovn.*-host', ) + var_ansible_gen = "/var/lib/config-data/ansible-generated/ovn-bgp-agent" + def setup(self): + super(RedHatOVNHost, self).setup() + self.add_copy_spec([ + self.var_ansible_gen, + ]) + + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/containers/ovn-bgp-agent/", + ]) + else: + self.add_copy_spec([ + "/var/log/containers/ovn-bgp-agent/*.log", + ]) class DebianOVNHost(OVNHost, DebianPlugin, UbuntuPlugin):