mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
VMware: Restrict vcenter_folder for vCenter
Folder creation API is only supported by vCenter, specifying Standalone ESXi system will raise error. This fix adds an user warning for suggesting this restriction. Fixes: #49938 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
31bec0dd95
commit
6c23a8df66
2 changed files with 6 additions and 0 deletions
changelogs/fragments
lib/ansible/modules/cloud/vmware
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- Restrict vcenter_folder to vCenter only, since folder creation api is not supported on ESXi hostsystem (https://github.com/ansible/ansible/issues/49938).
|
|
@ -19,6 +19,7 @@ module: vcenter_folder
|
|||
short_description: Manage folders on given datacenter
|
||||
description:
|
||||
- This module can be used to create, delete, move and rename folder on then given datacenter.
|
||||
- This module is only supported for vCenter.
|
||||
version_added: '2.5'
|
||||
author:
|
||||
- Abhijeet Kasurde (@Akasurde)
|
||||
|
@ -330,6 +331,9 @@ def main():
|
|||
module.fail_json(msg="Failed to manage folder as folder_name can only contain 80 characters.")
|
||||
|
||||
vcenter_folder_mgr = VmwareFolderManager(module)
|
||||
if not vcenter_folder_mgr.is_vcenter():
|
||||
module.fail_json(msg="Module vcenter_folder is meant for vCenter, hostname %s "
|
||||
"is not vCenter server." % module.params.get('hostname'))
|
||||
vcenter_folder_mgr.ensure()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue