From 0f8d9a7de041e7ab37679cd07b4866c766ee9778 Mon Sep 17 00:00:00 2001 From: Philipp Fruck Date: Fri, 17 Mar 2023 13:24:57 +0000 Subject: [PATCH] vmware_local_role: fix docs for vCenter (#1678) 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 --- plugins/modules/vmware_local_role_info.py | 10 +++---- plugins/modules/vmware_local_role_manager.py | 30 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/plugins/modules/vmware_local_role_info.py b/plugins/modules/vmware_local_role_info.py index 2a1064275..cc9b15f2f 100644 --- a/plugins/modules/vmware_local_role_info.py +++ b/plugins/modules/vmware_local_role_info.py @@ -12,13 +12,13 @@ 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 @@ -26,7 +26,7 @@ ''' 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 }}' @@ -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): diff --git a/plugins/modules/vmware_local_role_manager.py b/plugins/modules/vmware_local_role_manager.py index 6cce7f7ca..e4c672d2c 100644 --- a/plugins/modules/vmware_local_role_manager.py +++ b/plugins/modules/vmware_local_role_manager.py @@ -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: @@ -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 @@ -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 @@ -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 @@ -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: @@ -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):