feat: implement JSON-based IP configuration scripts for Windows and Linux and integrate service activation in provisioning flow

This commit is contained in:
pbao9
2026-05-15 09:08:44 +07:00
parent 41de3744a8
commit f158a84e8b
7 changed files with 282 additions and 114 deletions
@@ -9,7 +9,6 @@ use App\Models\ModuleVmware;
use App\Models\vCenter;
use App\Services\VmProvisionService;
use App\Services\VsphereHostSshService;
use App\Jobs\VirtualMachine\Provision\AssignIpToGuestJob;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
@@ -88,13 +87,8 @@ class ChangePasswordViaVsphereJob implements ShouldQueue
// [7] Save encrypted + plain password (IP will be set later by AssignIpToGuestJob)
$provision->updatePassword($this->moduleVmwareId, $newPassword);
// [8] Assign real IP into guest OS using the new password
AssignIpToGuestJob::dispatch(
$this->moduleVmwareId,
$this->vmId,
$this->osFamily,
$newPassword, // guest_password — MUST use new password, not template
);
// [8] Send VM credentials email (AssignIpToGuestJob bypassed temporarily)
SendVmCredentialsEmailJob::dispatch($this->moduleVmwareId);
Log::info('ChangePasswordViaVsphereJob: completed', [
'module_vmware_id' => $this->moduleVmwareId,