Sync from SUSE:SLFO:Main supportutils-plugin-cloud-init revision 7ef7091e1b2d7902043de6d969707b46

This commit is contained in:
2025-04-29 17:42:25 +02:00
commit 2d55cdb457
4 changed files with 113 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@@ -0,0 +1,13 @@
-------------------------------------------------------------------
Fri Feb 18 15:05:49 UTC 2022 - Andreas Taschner <andreas.taschner@suse.com>
- Script name stripped for dashes and dots,
which made the execution fail (bsc#1195961)
-------------------------------------------------------------------
Thu Aug 12 07:11:21 UTC 2021 - Andreas Taschner <andreas.taschner@suse.com>
- This plugin adds functionality to the supportconfig tool,
making it include logs and status of systemd services
relating to cloud-init in the supportconfig tarballs
(jsc#SLE-19069).

View File

@@ -0,0 +1,56 @@
#
# spec file for package supportutils-plugin-cloud-init
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: supportutils-plugin-cloud-init
Version: 1.1
Release: 0
BuildRequires: supportutils
%define _prefix /opt/gnome
License: GPL-2.0-or-later
Group: Productivity/Networking/Boot/Utilities
URL: https://www.suse.com/
Summary: Include cloud-init related logs and data in supportconfig tarball
Source0: supportutils_plugin_cloud_init
Requires: supportutils
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
Records status of the cloud-init systemd services in cloud-init.txt and adds the tarball produced by 'cloud-init collect-logs' to the supportconfig tarball.
Authors:
--------
Andreas Taschner <ataschner@suse.com>
%clean
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
%prep
cp %{S:0} .
%build
%install
install -Dm 544 supportutils_plugin_cloud_init $RPM_BUILD_ROOT/usr/lib/supportconfig/plugins/supportutils_plugin_cloud_init
%files
%defattr(-,root,root)
/usr/lib/supportconfig/plugins/supportutils_plugin_cloud_init
%changelog

View File

@@ -0,0 +1,21 @@
#!/bin/bash
. /usr/lib/supportconfig/resources/supportconfig.rc
OF=cloud-init.txt
RPM=cloud-init
if rpm_verify $OF $RPM; then
log_cmd $OF "systemctl status cloud-init-local.service"
log_cmd $OF "systemctl status cloud-init.service"
log_cmd $OF "systemctl status cloud-init.target"
conf_files $OF /etc/cloud/cloud.cfg
test -e cloud-init.tar.gz && mv cloud-init.tar.gz cloud-init.tar.gz.supportconfig-save
cloud-init collect-logs
mv cloud-init.tar.gz $LOG/
test -e cloud-init.tar.gz.supportconfig-save && mv cloud-init.tar.gz.supportconfig-save cloud-init.tar.gz
else
log_entry $OF note "cloud-init not installed"
fi
exit 0