Added new sosreport plugin

New sos report plugin added as separate RPM

Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
This commit is contained in:
Stephen Simpson
2025-02-20 16:16:37 -06:00
committed by Jonathon Anderson
parent 3b3851c6ca
commit 2852cd5e88
6 changed files with 103 additions and 20 deletions

View File

@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added ### Added
- Support Ubuntu-style dracut initrd images. - Support Ubuntu-style dracut initrd images.
- New sos plugin in `warewulf-sos` subpackage.
### Fixed ### Fixed

View File

@@ -234,6 +234,7 @@ install: build docs ## Install Warewulf from source
for f in docs/man/man5/*.5.gz; do install -m 0644 $$f $(DESTDIR)$(MANDIR)/man5/; done for f in docs/man/man5/*.5.gz; do install -m 0644 $$f $(DESTDIR)$(MANDIR)/man5/; done
install -pd -m 0755 $(DESTDIR)$(DRACUTMODDIR)/90wwinit install -pd -m 0755 $(DESTDIR)$(DRACUTMODDIR)/90wwinit
install -m 0644 dracut/modules.d/90wwinit/*.sh $(DESTDIR)$(DRACUTMODDIR)/90wwinit install -m 0644 dracut/modules.d/90wwinit/*.sh $(DESTDIR)$(DRACUTMODDIR)/90wwinit
install -D -m 0644 include/sos/warewulf.py $(DESTDIR)$(SOSPLUGINS)/warewulf.py
.PHONY: installapi .PHONY: installapi
installapi: installapi:

View File

@@ -51,6 +51,7 @@ BASHCOMPDIR ?= /etc/bash_completion.d
FIREWALLDDIR ?= /usr/lib/firewalld/services FIREWALLDDIR ?= /usr/lib/firewalld/services
LOGROTATEDIR ?= /etc/logrotate.d LOGROTATEDIR ?= /etc/logrotate.d
DRACUTMODDIR ?= /usr/lib/dracut/modules.d DRACUTMODDIR ?= /usr/lib/dracut/modules.d
SOSPLUGINS ?= /usr/lib/python3.9/site-packages/sos/report/plugins
ifeq ($(OS),suse) ifeq ($(OS),suse)
TFTPDIR ?= /srv/tftpboot TFTPDIR ?= /srv/tftpboot
endif endif

39
include/sos/warewulf.py Normal file
View File

@@ -0,0 +1,39 @@
from sos.report.plugins import Plugin, IndependentPlugin
class Warewulf(Plugin, IndependentPlugin):
short_desc = 'Warewulf provisioning server'
plugin_name = 'warewulf'
services = ('warewulfd')
packages = ('warewulf')
def setup(self):
self.add_copy_spec([
"/var/lib/warewulf/overlays/",
"/usr/share/warewulf/overlays/",
"/var/log/warewulfd.log",
"/etc/warewulf/",
"/var/lib/dhcpd/",
"/etc/dhcp/",
"/etc/dnsmasq.d",
"/var/lib/dnsmasq/dnsmasq.leases"
])
self.add_forbidden_path([
"/var/lib/warewulf/overlays/wwinit/rootfs/warewulf/wwclient",
"/usr/share/warewulf/overlays/wwinit/rootfs/warewulf/wwclient"
])
self.add_cmd_output([
"wwctl node list",
"wwctl node list -a",
"wwctl container list",
"wwctl profile list",
"wwctl profile list -a",
"wwctl image kernels",
"wwctl version"
])
self.add_journal(units="warewulfd.service")

View File

@@ -2,6 +2,21 @@
Troubleshooting Troubleshooting
=============== ===============
sos
===
The ``warewulf-sos`` package (new in v4.6.1) adds support for gathering Warewulf
server configuration information in an sos report.
.. code-block::
dnf -y install warewulf-sos
sos report # optionally, --enable-plugins=warewulf
.. note::
The ``warewulf-sos`` package is not currently built for SUSE.
warewulfd warewulfd
========= =========

View File

@@ -72,6 +72,7 @@ Requires: dhcp
BuildRequires: git BuildRequires: git
BuildRequires: make BuildRequires: make
BuildRequires: gpgme-devel BuildRequires: gpgme-devel
BuildRequires: python3-devel
%if %{api} %if %{api}
BuildRequires: libassuan-devel BuildRequires: libassuan-devel
%endif %endif
@@ -79,30 +80,11 @@ BuildRequires: libassuan-devel
Recommends: logrotate Recommends: logrotate
Recommends: ipmitool Recommends: ipmitool
%description %description
Warewulf is a stateless and diskless provisioning Warewulf is a stateless and diskless provisioning
system for large clusters of bare metal and/or virtual systems. system for large clusters of bare metal and/or virtual systems.
%package dracut
Summary: dracut module for loading a Warewulf image
BuildArch: noarch
Requires: dracut
%if 0%{?suse_version}
%else
Requires: dracut-network
%endif
Requires: curl
Requires: cpio
Requires: dmidecode
%description dracut
Warewulf is a stateless and diskless provisioning
system for large clusters of bare metal and/or virtual systems.
This subpackage contains a dracut module that can be used to generate
an initramfs that can fetch and boot a Warewulf node image from a
Warewulf server.
%prep %prep
%setup -q -n %{name}-%{version} -b0 %if %{?with_offline:-a2} %setup -q -n %{name}-%{version} -b0 %if %{?with_offline:-a2}
@@ -128,6 +110,7 @@ make defaults \
WWCLIENTDIR=/warewulf \ WWCLIENTDIR=/warewulf \
IPXESOURCE=/usr/share/ipxe \ IPXESOURCE=/usr/share/ipxe \
DRACUTMODDIR=/usr/lib/dracut/modules.d \ DRACUTMODDIR=/usr/lib/dracut/modules.d \
SOSPLUGINS=%{python3_sitelib}/sos/report/plugins \
CACHEDIR=%{_localstatedir}/cache CACHEDIR=%{_localstatedir}/cache
make build make build
%if %{api} %if %{api}
@@ -231,12 +214,55 @@ getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup}
%endif %endif
%package dracut
Summary: dracut module for loading a Warewulf image
BuildArch: noarch
Requires: dracut
%if 0%{?suse_version}
%else
Requires: dracut-network
%endif
Requires: curl
Requires: cpio
Requires: dmidecode
%description dracut
Warewulf is a stateless and diskless provisioning system for large clusters of
bare metal and/or virtual systems.
This subpackage contains a dracut module that can be used to generate an
initramfs that can fetch and boot a Warewulf node image from a Warewulf server.
%files dracut %files dracut
%defattr(-, root, root) %defattr(-, root, root)
%{_prefix}/lib/dracut/modules.d/90wwinit %{_prefix}/lib/dracut/modules.d/90wwinit
%if 0%{?suse_version} || 0%{?sle_version}
%else
%package sos
Summary: sos plugin for Warewulf
BuildArch: noarch
Requires: sos
%description sos
Warewulf is a stateless and diskless provisioning system for large clusters of
bare metal and/or virtual systems.
This subpackage contains an sos module that can be used to include information
about Warewulf in an sos report.
%files sos
%{python3_sitelib}/sos/report/plugins/warewulf.py
%{python3_sitelib}/sos/report/plugins/__pycache__/warewulf.*.pyc
%endif
%changelog %changelog
* Thu Feb 20 2025 Stephen Simpson <ssimpson@ciq.com>
- Added sos plugin
* Sat Feb 1 2025 Jonathon Anderson <janderson@ciq.com> * Sat Feb 1 2025 Jonathon Anderson <janderson@ciq.com>
- Add Recommends: ipmitool - Add Recommends: ipmitool