Updated anvil-provision-server to wait until the local machine is a full cluster member before proceeding.

Signed-off-by: Digimer <digimer@alteeve.ca>
This commit is contained in:
Digimer 2022-08-15 13:59:35 -04:00
parent 4ecc6097d3
commit 7b1771e498

View File

@ -11,7 +11,7 @@
# TODO: Support cloning; Example # TODO: Support cloning; Example
# - virt-clone --original-xml /mnt/shared/definitions/<source>.xml --name <new_server> --file <new_server's_drbd_path> --check path_exists=off # - virt-clone --original-xml /mnt/shared/definitions/<source>.xml --name <new_server> --file <new_server's_drbd_path> --check path_exists=off
# - Make VNC default # - Make VNC default
# # - Don't provision until in the cluster!
use strict; use strict;
use warnings; use warnings;
@ -168,12 +168,26 @@ sub run_jobs
} }
else else
{ {
$waiting = 0; # Make sure we're actually in the cluster now.
$anvil->Job->update_progress({ if ($anvil->data->{cib}{parsed}{'local'}{ready})
progress => 8, {
message => "job_0276", # We're ready!
}); $waiting = 0;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0276"}); $anvil->Job->update_progress({
progress => 8,
message => "job_0276",
});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0276"});
}
else
{
# Cluster is coming up, but it's not up yet.
$anvil->Job->update_progress({
progress => 6,
message => "job_0278",
});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0278"});
}
} }
} }