Skip to content

Commit

Permalink
VMware: Warn user about dvswitch permissions (ansible#58579)
Browse files Browse the repository at this point in the history
Warn user about dvswitch permissions since permissions for
a distributed switch must be defined and managed on either
the datacenter or a folder containing the switch.

Fixes: ansible#55248

Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde authored Jul 5, 2019
1 parent 641f7c4 commit 5e24714
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
- Joseph Andreatta (@vmwjoseph)
notes:
- Tested on ESXi 6.5, vSphere 6.7
- Be sure that the ESXi user used for login, has the appropriate rights to administer permissions
- The ESXi login user must have the appropriate rights to administer permissions.
- Permissions for a distributed switch must be defined and managed on either the datacenter or a folder containing the switch.
requirements:
- "python >= 2.7"
- PyVmomi
Expand Down Expand Up @@ -220,6 +221,12 @@ def get_object(self):
msg="Specified object %s of type %s was not found."
% (self.params['object_name'], self.params['object_type'])
)
if self.params['object_type'] == 'DistributedVirtualSwitch':
msg = "You are applying permissions to a Distributed vSwitch. " \
"This will probably fail, since Distributed vSwitches inherits permissions " \
"from the datacenter or a folder level. " \
"Define permissions on the datacenter or the folder containing the switch."
self.module.warn(msg)


def main():
Expand Down

0 comments on commit 5e24714

Please sign in to comment.