Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -132,7 +132,7 @@ final class VmRebuildIpService
|
||||
vcenterHost: $vcenterHost,
|
||||
vcenterUser: $vcenterUser,
|
||||
vcenterPassword: $vcenterPass,
|
||||
guestPassword: VmRebuildService::TEMPLATE_PASSWORD,
|
||||
guestPassword: VmRebuildService::templatePassword(),
|
||||
osFamily: $ctx->osFamily,
|
||||
dns: $dns,
|
||||
guestUser: $guestUser,
|
||||
@@ -174,7 +174,7 @@ final class VmRebuildIpService
|
||||
vcenterHost: $vcenterHost,
|
||||
vcenterUser: $vcenterUser,
|
||||
vcenterPassword: $vcenterPass,
|
||||
guestPassword: VmRebuildService::TEMPLATE_PASSWORD,
|
||||
guestPassword: VmRebuildService::templatePassword(),
|
||||
osFamily: $ctx->osFamily,
|
||||
guestUser: $guestUser,
|
||||
);
|
||||
|
||||
@@ -35,12 +35,11 @@ final class VmRebuildService
|
||||
public const OS_LINUX = 'LINUX';
|
||||
public const OS_WINDOWS = 'WINDOWS';
|
||||
|
||||
/**
|
||||
* Default password baked into rebuild templates. Mirrors the create-flow
|
||||
* template password constant but is duplicated intentionally to keep this
|
||||
* subsystem standalone.
|
||||
*/
|
||||
public const TEMPLATE_PASSWORD = 'TGS@123';
|
||||
/** Default password baked into rebuild templates — shares config with the create flow. */
|
||||
public static function templatePassword(): string
|
||||
{
|
||||
return \App\Services\VmProvisionService::templatePassword();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a fresh RebuildContext from current DB state.
|
||||
|
||||
@@ -35,8 +35,8 @@ class VmModuleService
|
||||
'next_due_date' => $nextDueDate,
|
||||
'next_invoice' => $nextDueDate,
|
||||
'user' => $infra->vmUser,
|
||||
'password' => VmProvisionService::TEMPLATE_PASSWORD,
|
||||
'plain_password' => VmProvisionService::TEMPLATE_PASSWORD,
|
||||
'password' => VmProvisionService::templatePassword(),
|
||||
'plain_password' => VmProvisionService::templatePassword(),
|
||||
'hostname' => $serverName,
|
||||
'vmware_id' => $vmId,
|
||||
'vcenter_id' => $infra->vcenter->id,
|
||||
|
||||
Reference in New Issue
Block a user