update mkvm.ps1

This commit is contained in:
florian 2024-01-26 08:56:23 +01:00
parent c086bcdc7f
commit cb1b315819
2 changed files with 23 additions and 3 deletions

View File

@ -81,3 +81,8 @@
name: apache2 name: apache2
state: restarted state: restarted
enabled: yes enabled: yes
- name: 14. Gotify
copy:
src: gotify.sh
dest: /usr/lib/zabbix/alertscripts

View File

@ -11,13 +11,28 @@ $ovafilefog="$HOME\Downloads\debian-bullseye-gsb-${ovafogrelease}.ova"
$vboxmanage="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" $vboxmanage="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
$deletemode=0 $deletemode=0
$vmMem = @{
"r-int" = "512"
"r-ext" = "512"
"s-nas" = "512"
"s-infra" = "768"
"s-backup" = "768"
"s-elk" = "3072"
}
#FONCTIONS #FONCTIONS
function create_vm{ param([string]$nomvm) function create_vm{ param([string]$nomvm)
if ($vmMem.ContainsKey($nomvm)) {
& "$vboxmanage" import "$ovafile" --vsys 0 --vmname "$nomvm" --memory $vmMem[$nomvm]
Write-Host "Machine $nomvm importée"
} else {
#Importation depuis l'ova #Importation depuis l'ova
& "$vboxmanage" import "$ovafile" --vsys 0 --vmname "$nomvm" & "$vboxmanage" import "$ovafile" --vsys 0 --vmname "$nomvm"
Write-Host "Machine $nomvm importée" Write-Host "Machine $nomvm importée"
} }
}
function create_if{ param([string]$nomvm, [string]$nic, [int]$rang, [string]$reseau) function create_if{ param([string]$nomvm, [string]$nic, [int]$rang, [string]$reseau)
#Création d'une interface #Création d'une interface