From f660d4731eee4b2b77201c5202d8c061ed264e85 Mon Sep 17 00:00:00 2001 From: Lyanis SOUIDI Date: Sat, 9 Nov 2024 21:35:10 +0100 Subject: [PATCH] Ajout ACL pour la connexion OpenID Connect via ainur --- vm/create_from_template.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vm/create_from_template.sh b/vm/create_from_template.sh index d31d1f7..ff8f27f 100644 --- a/vm/create_from_template.sh +++ b/vm/create_from_template.sh @@ -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"