4
0

Update vm/create_from_template.sh

This commit is contained in:
Lyanis SOUIDI 2024-09-10 10:58:00 +02:00
parent e88df481f2
commit 189914a3b0

View File

@ -32,7 +32,7 @@ while read -r username; do
USERNAME=$(echo "$line") USERNAME=$(echo "$line")
echo "Creating VM for $username in $POOL_NAME" echo "Creating VM for $username in $POOL_NAME"
qm clone $TEMPLATE_VM_ID $NEXT_VM_ID --name "$username" --full false --pool $POOL_NAME qm clone $TEMPLATE_VM_ID $NEXT_VM_ID --name "$username" --full false --pool $POOL_NAME
qm set $NEXT_VM_ID --args "-fw_cfg name=\"opt/fr.iut-fbleau/hostname\",string=\"vm-$username\" -fw_cfg name=\"opt/fr.iut-fbleau/domain\",string=\"vm.iut-fbleau.fr\"" qm set $NEXT_VM_ID --args "-fw_cfg name=\"opt/fr.iut-fbleau/hostname\",string=\"vm-$username\" -fw_cfg name=\"opt/fr.iut-fbleau/domainname\",string=\"vm.iut-fbleau.fr\""
pvesh set /access/acl --path /vms/$NEXT_VM_ID --roles PVEVMUser --users "$username@arda.lan" pvesh set /access/acl --path /vms/$NEXT_VM_ID --roles PVEVMUser --users "$username@arda.lan"
((NEXT_VM_ID++)) ((NEXT_VM_ID++))
done < "$INPUT_FILE" done < "$INPUT_FILE"