Skip to content

Commit

Permalink
vmware_local_role: fix docs for vCenter (#1678)
Browse files Browse the repository at this point in the history
vmware_local_role: fix docs for vCenter

SUMMARY

Other than implied by documentation, the vmware_local_role info and manager modules also work with vCenter.
The documentation has been updated accordingly.

ISSUE TYPE


Docs Pull Request

COMPONENT NAME

vmware_local_role_info
vmware_local_role_manager
ADDITIONAL INFORMATION


Tested on vCenter 7.0 U3

Reviewed-by: Mario Lenz <[email protected]>
  • Loading branch information
p-fruck authored Mar 17, 2023
1 parent 5856865 commit 0f8d9a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions plugins/modules/vmware_local_role_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
DOCUMENTATION = r'''
---
module: vmware_local_role_info
short_description: Gather info about local roles on an ESXi host
short_description: Gather info about local roles on an ESXi host or vCenter
description:
- This module can be used to gather information about local role info on an ESXi host
- This module can be used to gather information about local role info on an ESXi host or vCenter
author:
- Abhijeet Kasurde (@Akasurde)
notes:
- Be sure that the ESXi user used for login, has the appropriate rights to view roles
- Be sure that the user used for login, has the appropriate rights to view roles
- The module returns a list of dict in version 2.8 and above.
extends_documentation_fragment:
- community.vmware.vmware.documentation
'''

EXAMPLES = r'''
- name: Gather info about local role from an ESXi
- name: Gather info about local role from an ESXi (or vCenter)
community.vmware.vmware_local_role_info:
hostname: '{{ esxi_hostname }}'
username: '{{ esxi_username }}'
Expand Down Expand Up @@ -96,7 +96,7 @@ def __init__(self, module):
if self.content.authorizationManager is None:
self.module.fail_json(
msg="Failed to get local authorization manager settings.",
details="It seems that '%s' is a vCenter server instead of an ESXi server" % self.params['hostname']
details="It seems that '%s' does not support this functionality" % self.params['hostname']
)

def gather_local_role_info(self):
Expand Down
30 changes: 15 additions & 15 deletions plugins/modules/vmware_local_role_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
DOCUMENTATION = r'''
---
module: vmware_local_role_manager
short_description: Manage local roles on an ESXi host
short_description: Manage local roles on an ESXi host or vCenter
description:
- This module can be used to manage local roles on an ESXi host.
- This module can be used to manage local roles on an ESXi host or vCenter.
author:
- Abhijeet Kasurde (@Akasurde)
- Christian Kotte (@ckotte)
notes:
- Be sure that the ESXi user used for login, has the appropriate rights to create / delete / edit roles
- Be sure that the user used for login, has the appropriate rights to create / delete / edit roles
options:
local_role_name:
description:
Expand Down Expand Up @@ -70,11 +70,11 @@
state: present
delegate_to: localhost
- name: Add local role with privileges to ESXi
- name: Add local role with privileges to vCenter
community.vmware.vmware_local_role_manager:
hostname: '{{ esxi_hostname }}'
username: '{{ esxi_username }}'
password: '{{ esxi_password }}'
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
local_role_name: vmware_qa
local_privilege_ids: [ 'Folder.Create', 'Folder.Delete']
state: present
Expand All @@ -91,9 +91,9 @@
- name: Add a privilege to an existing local role
community.vmware.vmware_local_role_manager:
hostname: '{{ esxi_hostname }}'
username: '{{ esxi_username }}'
password: '{{ esxi_password }}'
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
local_role_name: vmware_qa
local_privilege_ids: [ 'Folder.Create' ]
action: add
Expand All @@ -111,9 +111,9 @@
- name: Set a privilege to an existing local role
community.vmware.vmware_local_role_manager:
hostname: '{{ esxi_hostname }}'
username: '{{ esxi_username }}'
password: '{{ esxi_password }}'
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
local_role_name: vmware_qa
local_privilege_ids: [ 'Folder.Create' ]
action: set
Expand All @@ -126,7 +126,7 @@
returned: always
type: str
role_id:
description: ESXi generated local role id
description: Generated local role id
returned: always
type: int
privileges:
Expand Down Expand Up @@ -178,7 +178,7 @@ def __init__(self, module):
if self.content.authorizationManager is None:
self.module.fail_json(
msg="Failed to get local authorization manager settings.",
details="It seems that '%s' is a vCenter server instead of an ESXi server" % self.params['hostname']
details="It seems that '%s' does not support this functionality" % self.params['hostname']
)

def process_state(self):
Expand Down

0 comments on commit 0f8d9a7

Please sign in to comment.