4
0

Ajout ACL pour la connexion OpenID Connect via ainur

This commit is contained in:
Lyanis SOUIDI 2024-11-09 21:35:10 +01:00
parent b5c65548d5
commit f660d4731e

View File

@ -53,6 +53,11 @@ while read -r username; do
MAC_ADDRESS=$(grep -Po 'net\d+: virtio=\K[^,]+' /etc/pve/qemu-server/$NEXT_VM_ID.conf)
mariadb --host=gimli.iut-fbleau.fr --user=proxmox --password="..." -e "CALL add_vm('$MAC_ADDRESS', 'vm-$username')" kea
if ! grep -q "^user:$username@ainur.iut-fbleau.fr" /etc/pve/user.cfg; then
pveum user add "$username@ainur.iut-fbleau.fr"
fi
pvesh set /access/acl --path /vms/$NEXT_VM_ID --roles etu --users "$username@arda.lan"
pvesh set /access/acl --path /vms/$NEXT_VM_ID --roles etu --users "$username@ainur.iut-fbleau.fr"
((NEXT_VM_ID++))
done < "$INPUT_FILE"