]> git.proxmox.com Git - pmg-api.git/commitdiff
api: certificates: trigger fingerprint update
authorStoiko Ivanov <s.ivanov@proxmox.com>
Mon, 15 Mar 2021 22:01:35 +0000 (23:01 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 16 Mar 2021 18:13:11 +0000 (19:13 +0100)
in clustered systems, so that the cluster-sync remains possible with
the new certificate.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/API2/Certificates.pm

index 5d4036d8e2b2ad066f34da45ac2137ea7c7fe24c..fc1025e24236bb2b75165aa53c17bc11ca306530 100644 (file)
@@ -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);
+       }
     }
 };