[pmg-devel] [PATCH pmg-api 6/6] api: certificates: trigger fingerprint update

Stoiko Ivanov s.ivanov at proxmox.com
Mon Mar 15 23:01:35 CET 2021


in clustered systems, so that the cluster-sync remains possible with
the new certificate.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PMG/API2/Certificates.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/PMG/API2/Certificates.pm b/src/PMG/API2/Certificates.pm
index ca8b75b..5a0f34d 100644
--- a/src/PMG/API2/Certificates.pm
+++ b/src/PMG/API2/Certificates.pm
@@ -43,6 +43,12 @@ my sub restart_after_cert_update : prototype($) {
     if ($type eq 'api') {
 	print "Restarting pmgproxy\n";
 	PVE::Tools::run_command(['systemctl', 'reload-or-restart', 'pmgproxy']);
+
+	my $cinfo = PMG::ClusterConfig->new();
+	if (scalar(keys %{$cinfo->{ids}})) {
+	    print "Notify cluster about new fingerprint\n";
+	    PMG::Cluster::trigger_update_fingerprints($cinfo);
+	}
     }
 };
 
-- 
2.20.1





More information about the pmg-devel mailing list