Skip to content
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

recursive flag doesn't show/apply changes when changed in community.vmware.vmware_object_role_permission #2350

Open
willt opened this issue Mar 10, 2025 · 2 comments

Comments

@willt
Copy link

willt commented Mar 10, 2025

SUMMARY

for the community.vmware.vmware_object_role_permission module
setting recursive from false to true or true to false does not show a change

So if at first I run this it sets recursive to false

- name:  Datastore permissions for metaswitch
  community.vmware.vmware_object_role_permission:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    role: Admin
    principal: "VSPHERE.LOCAL\\bob"
    object_type: Datastore
    object_name: my-datastore
    recursive: false
    state: present
  delegate_to: localhost

but then If I change it to this and rerun it doesn't make any changes

- name:  Datastore permissions for metaswitch
  community.vmware.vmware_object_role_permission:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: false
    role: Admin
    principal: "VSPHERE.LOCAL\\bob"
    object_type: Datastore
    object_name: my-datastore
    recursive: true
    state: present
  delegate_to: localhost
@ihumster
Copy link
Collaborator

Nope, the module is written in such a way that if permission is assigned its compliance with the declaration is not checked. Need rework.

As a workaround, I can only offer to do Absent/Present.

@mariolenz
Copy link
Collaborator

I'm not sure, but it might work if we simply match propagate of Permission with recursive here:

def same_permission(self, perm_one, perm_two):
return perm_one.principal.lower() == perm_two.principal.lower() \
and perm_one.roleId == perm_two.roleId

Might be worth a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants