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

vmware_local_role: fix docs for vCenter #1678

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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