Managing group membership as a separate resource #3048
Replies: 3 comments
|
hi, the Proxmox API doesn't allow managing group members through the group itself, so the provider follows that limitation (at least for now). couldn't you manage the users' group membership in the other repo and reference the group in unless I'm missing something. |
|
Hey @giganteous 👋🏼
I think it is possible, and not that hard. @666Goofy666 is right that the group endpoint has no way to manage members, but membership is written through the user endpoint instead: Checked this on PVE 9.2: # pvesh set /access/users/tf-chk@pve --groups tf-chk-a
# pvesh get /access/users/tf-chk@pve --output-format json | jq .groups
["tf-chk-a"]
# pvesh set /access/users/tf-chk@pve --groups tf-chk-b --append 1
# pvesh get /access/users/tf-chk@pve --output-format json | jq .groups
["tf-chk-a","tf-chk-b"]
# pvesh set /access/users/tf-chk@pve --groups tf-chk-a
# pvesh get /access/users/tf-chk@pve --output-format json | jq .groups
["tf-chk-a"]
# pvesh set /access/users/tf-chk@pve --comment x
# pvesh get /access/users/tf-chk@pve --output-format json | jq .groups
["tf-chk-a"]Append is idempotent too, calling it twice with the same group is fine. So something like There is a wrinkle tho: Would you mind opening a feature request for this? Happy to take a PR too if you're up for it 🙂 |
|
I went ahead and opened #3106 to track this. |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'm currently using this provider to create a single or more VMs in a network, and assign rights for (existing) users to be allowed to see the VM by using a
proxmox_aclresource. Each network has a separate repository. The user management is done via another tofu run.In my opion it'd be nicer if I create a new group, then manage only the membership of a (set of) user(s) in that group, and manage a single ACL that grants the group access to the VM.
But since my users are managed outside the "jurisdiction" of this repository.
My question is, would such a resource / feature be possible at all? Would it be hard?
thanks for your thoughts on this.
All reactions