-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permissions required to run nsxt_vm_tags module #499
Comments
I think, you need to add permissions to VM inventory to configure tag |
Hi @alagoutte, I've done some more testing with this. It does not work with a custom role with the VM inventory and Tag full access permissions, nor does it work with a custom role that has full access on all permissions. It will only work if the service account is assigned the built in Enterprise Admin role. |
I would like to use a custom role for creating tags on virtual machines. I analyzed this a bit and as far as I understand, it is currently not possible to use a custom role. ansible-for-nsxt/plugins/modules/nsxt_vm_tags.py Lines 278 to 280 in dfbbd04
According to the API documentation, the feature vm_vm_tags is required to execute this API action: https://dp-downloads.broadcom.com/api-content/apis/API_NTDCRA_001/4.1.2/html/api_includes/method_UpdateVirtualMachineTags.html
This feature is marked as internal and therefore it is not possible to create a custom role through the GUI nor with the API with the required permissions to create tags using the It is only possible to create a custom role with the {
"features" : [ {
"feature" : "policy_vm_vm_tags",
"feature_name" : "Policy Vm Vm Tags",
"feature_description" : "Policy Create and assign tags to VM",
"permission" : "crud",
"is_internal" : false,
"is_execute_recommended" : false
}, {
"feature" : "vm_vm_tags",
"feature_name" : "Vm Vm Tags",
"feature_description" : "Create and assign tags to VM",
"permission" : "none",
"is_internal" : true,
"is_execute_recommended" : false
} ]
} |
I confirm @hulr analysis. I've been able to reproduce it with postman using a limited role (Full-access on tags and VM only). The update of tags raised a 401 FORBIDDEN when using So here is a short proposition (untested) to fix that issue :
|
Signed-off-by: Julien Simbola <[email protected]>
I have made a PR for that bug : #507 Tested, it works fine. However, I don't know if it is a real fix or just a workaround |
Describe the bug
In NSX I have created a custom security role which only has full access to the 'tags' permission. When running the nsxt_vm_tags module as a user that has that role, it fails with error 403 forbidden. The user is able to successfully alter tags through the GUI and API.
Reproduction steps
Expected behavior
User with full access to the tags permission should be able to run this module.
Additional context
No response
The text was updated successfully, but these errors were encountered: