Split into qemu and proxmox platforms over a shared content tree
platforms/qemu and platforms/proxmox each have their own lab.sh and lab.conf; content/ holds everything shared (roles, seed, site, helpers). The dispatcher, preflight and command implementations are common and take platform differences from the backend. Proxmox backend: qm create with q35/SATA/e1000, ISOs and seed ISOs in an ISO storage, provisioning over qm guest exec (no Python packages needed on the host), template + clone for reset, and peers/ to emit WireGuard configs. The role scripts now ride on the seed ISO, so provisioning transfers nothing. build-bundle.sh produces a self-contained tarball per platform, for hosts that cannot reach the git server. Both configs are generic: no absolute path from this machine remains.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# Norbourg lab — WS01: domain-joined workstation.
|
||||
# Stage 2 runs after the join reboot because local group membership needs the
|
||||
# domain group to resolve.
|
||||
|
||||
. "$PSScriptRoot\..\lib\common.ps1"
|
||||
|
||||
$self = $PSCommandPath
|
||||
Write-LabLog 'ws01: starting'
|
||||
|
||||
try {
|
||||
# Re-running provision must not try to join a machine that already joined.
|
||||
if ((Get-CimInstance Win32_ComputerSystem).Domain -eq '@@DOMAIN@@') {
|
||||
Write-LabLog 'ws01: already joined'
|
||||
Complete-Stage $self 'ok'
|
||||
return
|
||||
}
|
||||
|
||||
$cred = New-Object System.Management.Automation.PSCredential(
|
||||
'@@DOMAIN@@\Administrator',
|
||||
(ConvertTo-SecureString '@@ADMIN_PASSWORD@@' -AsPlainText -Force))
|
||||
|
||||
Write-LabLog 'ws01: joining the domain'
|
||||
Add-Computer -DomainName '@@DOMAIN@@' -Credential $cred `
|
||||
-OUPath 'OU=Ordinateurs,OU=Norbourg,@@BASE_DN@@' -Force
|
||||
|
||||
Complete-Stage $self 'ok reboot'
|
||||
Restart-Computer -Force
|
||||
} catch {
|
||||
Fail-Stage $self $_.Exception.Message
|
||||
}
|
||||
Reference in New Issue
Block a user