From 450df28651f0ae7360699a4ef9e32d2e7f71df9f Mon Sep 17 00:00:00 2001 From: Mario Lenz Date: Sun, 15 Dec 2024 15:26:01 +0100 Subject: [PATCH] Next batch of changes --- plugins/module_utils/vmware.py | 34 ------------------- .../modules/vcenter_domain_user_group_info.py | 7 ++-- plugins/modules/vcenter_extension.py | 7 ++-- plugins/modules/vcenter_extension_info.py | 7 ++-- plugins/modules/vcenter_folder.py | 7 ++-- plugins/modules/vcenter_license.py | 5 +-- .../vcenter_root_password_expiration.py | 6 ++-- .../modules/vcenter_standard_key_provider.py | 7 ++-- plugins/modules/vmware_about_info.py | 7 ++-- plugins/modules/vmware_all_snapshots_info.py | 6 ++-- plugins/modules/vmware_cfg_backup.py | 7 ++-- plugins/modules/vmware_cluster.py | 6 ++-- plugins/modules/vmware_cluster_dpm.py | 6 ++-- plugins/modules/vmware_cluster_drs.py | 6 ++-- .../vmware_cluster_drs_recommendations.py | 6 ++-- plugins/modules/vmware_cluster_ha.py | 6 ++-- plugins/modules/vmware_cluster_info.py | 7 ++-- plugins/modules/vmware_cluster_vcls.py | 6 ++-- plugins/modules/vmware_cluster_vsan.py | 6 ++-- plugins/modules/vmware_custom_attribute.py | 7 ++-- .../vmware_custom_attribute_manager.py | 7 ++-- plugins/modules/vmware_datacenter.py | 7 ++-- plugins/modules/vmware_datacenter_info.py | 7 ++-- plugins/modules/vmware_datastore.py | 6 ++-- plugins/modules/vmware_datastore_cluster.py | 7 ++-- .../vmware_datastore_cluster_manager.py | 7 ++-- plugins/modules/vmware_datastore_info.py | 6 ++-- .../vmware_datastore_maintenancemode.py | 6 ++-- plugins/modules/vmware_deploy_ovf.py | 6 ++-- plugins/modules/vmware_drs_group.py | 6 ++-- plugins/modules/vmware_drs_group_info.py | 7 ++-- plugins/modules/vmware_drs_group_manager.py | 6 ++-- plugins/modules/vmware_drs_override.py | 7 ++-- plugins/modules/vmware_drs_rule_info.py | 7 ++-- plugins/modules/vmware_dvs_host.py | 6 ++-- plugins/modules/vmware_dvs_portgroup.py | 6 ++-- plugins/modules/vmware_dvs_portgroup_find.py | 6 ++-- plugins/modules/vmware_dvs_portgroup_info.py | 6 ++-- plugins/modules/vmware_dvswitch.py | 7 ++-- plugins/modules/vmware_dvswitch_info.py | 7 ++-- plugins/modules/vmware_dvswitch_lacp.py | 7 ++-- plugins/modules/vmware_dvswitch_nioc.py | 6 ++-- plugins/modules/vmware_dvswitch_pvlans.py | 7 ++-- plugins/modules/vmware_dvswitch_uplink_pg.py | 7 ++-- plugins/modules/vmware_evc_mode.py | 6 ++-- plugins/modules/vmware_export_ovf.py | 7 ++-- plugins/modules/vmware_first_class_disk.py | 5 +-- .../modules/vmware_first_class_disk_info.py | 5 +-- plugins/modules/vmware_folder_info.py | 7 ++-- plugins/modules/vmware_guest.py | 6 ++-- plugins/modules/vmware_guest_boot_info.py | 7 ++-- plugins/modules/vmware_guest_boot_manager.py | 7 ++-- plugins/modules/vmware_guest_controller.py | 7 ++-- .../modules/vmware_guest_cross_vc_clone.py | 6 ++-- .../vmware_guest_custom_attribute_defs.py | 7 ++-- .../modules/vmware_guest_custom_attributes.py | 7 ++-- .../vmware_guest_customization_info.py | 7 ++-- plugins/modules/vmware_guest_disk.py | 7 ++-- plugins/modules/vmware_guest_disk_info.py | 7 ++-- .../modules/vmware_guest_file_operation.py | 7 ++-- plugins/modules/vmware_guest_find.py | 7 ++-- plugins/modules/vmware_guest_info.py | 7 ++-- plugins/modules/vmware_guest_instant_clone.py | 6 ++-- plugins/modules/vmware_guest_move.py | 7 ++-- plugins/modules/vmware_guest_network.py | 7 ++-- plugins/modules/vmware_guest_powerstate.py | 7 ++-- .../vmware_guest_register_operation.py | 7 ++-- plugins/modules/vmware_guest_screenshot.py | 7 ++-- plugins/modules/vmware_guest_sendkey.py | 7 ++-- plugins/modules/vmware_guest_serial_port.py | 7 ++-- plugins/modules/vmware_guest_snapshot.py | 7 ++-- plugins/modules/vmware_guest_snapshot_info.py | 7 ++-- .../modules/vmware_guest_storage_policy.py | 7 ++-- plugins/modules/vmware_guest_tools_info.py | 7 ++-- plugins/modules/vmware_guest_tools_upgrade.py | 7 ++-- plugins/modules/vmware_guest_tools_wait.py | 7 ++-- plugins/modules/vmware_guest_tpm.py | 7 ++-- plugins/modules/vmware_guest_vgpu.py | 6 ++-- plugins/modules/vmware_guest_vgpu_info.py | 6 ++-- plugins/modules/vmware_guest_video.py | 7 ++-- plugins/modules/vmware_host.py | 7 ++-- plugins/modules/vmware_host_acceptance.py | 7 ++-- .../modules/vmware_host_acceptance_info.py | 7 ++-- .../modules/vmware_host_active_directory.py | 7 ++-- plugins/modules/vmware_host_auto_start.py | 7 ++-- .../modules/vmware_host_capability_info.py | 7 ++-- plugins/modules/vmware_host_config_info.py | 7 ++-- plugins/modules/vmware_host_config_manager.py | 7 ++-- .../modules/vmware_host_custom_attributes.py | 7 ++-- plugins/modules/vmware_host_datastore.py | 7 ++-- plugins/modules/vmware_host_disk_info.py | 7 ++-- plugins/modules/vmware_host_dns.py | 7 ++-- plugins/modules/vmware_host_dns_info.py | 7 ++-- plugins/modules/vmware_host_facts.py | 6 ++-- plugins/modules/vmware_host_feature_info.py | 7 ++-- plugins/modules/vmware_host_firewall_info.py | 7 ++-- .../modules/vmware_host_firewall_manager.py | 7 ++-- plugins/modules/vmware_host_graphics.py | 7 ++-- plugins/modules/vmware_host_hyperthreading.py | 7 ++-- plugins/modules/vmware_host_ipv6.py | 7 ++-- plugins/modules/vmware_host_iscsi.py | 7 ++-- plugins/modules/vmware_host_iscsi_info.py | 7 ++-- plugins/modules/vmware_host_kernel_manager.py | 7 ++-- plugins/modules/vmware_host_lockdown.py | 7 ++-- .../vmware_host_lockdown_exceptions.py | 7 ++-- plugins/modules/vmware_host_logbundle.py | 7 ++-- plugins/modules/vmware_host_logbundle_info.py | 7 ++-- plugins/modules/vmware_host_ntp.py | 7 ++-- plugins/modules/vmware_host_ntp_info.py | 7 ++-- plugins/modules/vmware_host_package_info.py | 7 ++-- plugins/modules/vmware_host_passthrough.py | 7 ++-- .../modules/vmware_host_powermgmt_policy.py | 7 ++-- plugins/modules/vmware_host_powerstate.py | 7 ++-- plugins/modules/vmware_host_scanhba.py | 7 ++-- plugins/modules/vmware_host_scsidisk_info.py | 7 ++-- plugins/modules/vmware_host_service_info.py | 7 ++-- .../modules/vmware_host_service_manager.py | 7 ++-- plugins/modules/vmware_host_snmp.py | 7 ++-- plugins/modules/vmware_host_sriov.py | 7 ++-- plugins/modules/vmware_host_ssl_info.py | 7 ++-- plugins/modules/vmware_host_tcpip_stacks.py | 7 ++-- plugins/modules/vmware_host_user_manager.py | 7 ++-- plugins/modules/vmware_host_vmhba_info.py | 7 ++-- plugins/modules/vmware_host_vmnic_info.py | 7 ++-- plugins/modules/vmware_local_role_info.py | 7 ++-- plugins/modules/vmware_local_role_manager.py | 7 ++-- plugins/modules/vmware_local_user_info.py | 7 ++-- plugins/modules/vmware_local_user_manager.py | 7 ++-- plugins/modules/vmware_maintenancemode.py | 7 ++-- plugins/modules/vmware_migrate_vmk.py | 7 ++-- .../vmware_object_custom_attributes_info.py | 7 ++-- .../modules/vmware_object_role_permission.py | 7 ++-- .../vmware_object_role_permission_info.py | 6 ++-- plugins/modules/vmware_portgroup.py | 7 ++-- plugins/modules/vmware_portgroup_info.py | 7 ++-- .../modules/vmware_recommended_datastore.py | 6 ++-- plugins/modules/vmware_resource_pool.py | 7 ++-- plugins/modules/vmware_resource_pool_info.py | 7 ++-- .../modules/vmware_sdrs_vm_overrides_info.py | 6 ++-- .../modules/vmware_target_canonical_info.py | 7 ++-- plugins/modules/vmware_vasa.py | 6 ++-- plugins/modules/vmware_vasa_info.py | 6 ++-- plugins/modules/vmware_vcenter_settings.py | 7 ++-- .../modules/vmware_vcenter_settings_info.py | 6 ++-- plugins/modules/vmware_vcenter_statistics.py | 7 ++-- plugins/modules/vmware_vm_config_option.py | 7 ++-- plugins/modules/vmware_vm_host_drs_rule.py | 7 ++-- plugins/modules/vmware_vm_info.py | 7 ++-- plugins/modules/vmware_vm_shell.py | 8 ++--- plugins/modules/vmware_vm_storage_policy.py | 6 ++-- .../modules/vmware_vm_storage_policy_info.py | 6 ++-- plugins/modules/vmware_vm_vm_drs_rule.py | 7 ++-- plugins/modules/vmware_vm_vss_dvs_migrate.py | 7 ++-- plugins/modules/vmware_vmkernel.py | 7 ++-- plugins/modules/vmware_vmkernel_info.py | 7 ++-- plugins/modules/vmware_vmotion.py | 7 ++-- plugins/modules/vmware_vsan_cluster.py | 7 ++-- plugins/modules/vmware_vsan_hcl_db.py | 7 ++-- plugins/modules/vmware_vsan_health_info.py | 7 ++-- .../modules/vmware_vsan_release_catalog.py | 7 ++-- plugins/modules/vmware_vspan_session.py | 7 ++-- plugins/modules/vmware_vswitch.py | 7 ++-- plugins/modules/vmware_vswitch_info.py | 7 ++-- plugins/modules/vsan_health_silent_checks.py | 7 ++-- plugins/modules/vsphere_copy.py | 6 ++-- plugins/modules/vsphere_file.py | 6 ++-- 166 files changed, 620 insertions(+), 527 deletions(-) diff --git a/plugins/module_utils/vmware.py b/plugins/module_utils/vmware.py index 9d545204f7..6810999819 100644 --- a/plugins/module_utils/vmware.py +++ b/plugins/module_utils/vmware.py @@ -673,40 +673,6 @@ def get_vnc_extraconfig(vm): return result -def vmware_argument_spec(): - return dict( - hostname=dict(type='str', - required=False, - fallback=(env_fallback, ['VMWARE_HOST']), - ), - username=dict(type='str', - aliases=['user', 'admin'], - required=False, - fallback=(env_fallback, ['VMWARE_USER'])), - password=dict(type='str', - aliases=['pass', 'pwd'], - required=False, - no_log=True, - fallback=(env_fallback, ['VMWARE_PASSWORD'])), - port=dict(type='int', - default=443, - fallback=(env_fallback, ['VMWARE_PORT'])), - validate_certs=dict(type='bool', - required=False, - default=True, - fallback=(env_fallback, ['VMWARE_VALIDATE_CERTS']) - ), - proxy_host=dict(type='str', - required=False, - default=None, - fallback=(env_fallback, ['VMWARE_PROXY_HOST'])), - proxy_port=dict(type='int', - required=False, - default=None, - fallback=(env_fallback, ['VMWARE_PROXY_PORT'])), - ) - - def connect_to_api(module, disconnect_atexit=True, return_si=False, hostname=None, username=None, password=None, port=None, validate_certs=None, httpProxyHost=None, httpProxyPort=None): if module: diff --git a/plugins/modules/vcenter_domain_user_group_info.py b/plugins/modules/vcenter_domain_user_group_info.py index 9992f00cc8..29e8799b79 100644 --- a/plugins/modules/vcenter_domain_user_group_info.py +++ b/plugins/modules/vcenter_domain_user_group_info.py @@ -51,7 +51,7 @@ type: bool default: true extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -121,7 +121,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VcenterDomainUserGroupInfo(PyVmomi): @@ -169,7 +170,7 @@ def execute(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( domain=dict(type='str', default='vsphere.local'), search_string=dict(type='str', required=True), diff --git a/plugins/modules/vcenter_extension.py b/plugins/modules/vcenter_extension.py index f877d6bfb7..018c4fec32 100644 --- a/plugins/modules/vcenter_extension.py +++ b/plugins/modules/vcenter_extension.py @@ -74,7 +74,7 @@ default: present type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -124,11 +124,12 @@ import datetime from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import connect_to_api, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import connect_to_api +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( extension_key=dict(type='str', required=True, no_log=False), version=dict(type='str', required=True), diff --git a/plugins/modules/vcenter_extension_info.py b/plugins/modules/vcenter_extension_info.py index 222cfb4ea0..b603a5f88c 100644 --- a/plugins/modules/vcenter_extension_info.py +++ b/plugins/modules/vcenter_extension_info.py @@ -18,7 +18,7 @@ author: - Abhijeet Kasurde (@Akasurde) extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -62,7 +62,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareExtManager(PyVmomi): @@ -92,7 +93,7 @@ def gather_plugin_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() module = AnsibleModule( argument_spec=argument_spec, diff --git a/plugins/modules/vcenter_folder.py b/plugins/modules/vcenter_folder.py index 448ad06407..6d5202d60d 100644 --- a/plugins/modules/vcenter_folder.py +++ b/plugins/modules/vcenter_folder.py @@ -62,7 +62,7 @@ choices: [ present, absent ] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -136,7 +136,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi, find_datacenter_by_name, wait_for_task, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_datacenter_by_name, wait_for_task, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -329,7 +330,7 @@ def get_folder(self, folder_name, folder_type, parent_folder=None, recurse=False def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type='str', required=True, aliases=['datacenter_name']), folder_name=dict(type='str', required=True), diff --git a/plugins/modules/vcenter_license.py b/plugins/modules/vcenter_license.py index c7e09d3e5a..97454cacaa 100644 --- a/plugins/modules/vcenter_license.py +++ b/plugins/modules/vcenter_license.py @@ -121,7 +121,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_hostsystem_by_name +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_hostsystem_by_name +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VcenterLicenseMgr(PyVmomi): @@ -145,7 +146,7 @@ def list_keys(self, licenses): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( labels=dict(type='dict', default=dict(source='ansible')), license=dict(type='str', required=True), diff --git a/plugins/modules/vcenter_root_password_expiration.py b/plugins/modules/vcenter_root_password_expiration.py index 7becddfe77..65f352bc91 100644 --- a/plugins/modules/vcenter_root_password_expiration.py +++ b/plugins/modules/vcenter_root_password_expiration.py @@ -43,7 +43,7 @@ type: int required: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -68,7 +68,7 @@ delegate_to: localhost ''' -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware_rest_client import VmwareRestClient @@ -126,7 +126,7 @@ def configure_root_account_password_policy(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( state=dict(default='present', diff --git a/plugins/modules/vcenter_standard_key_provider.py b/plugins/modules/vcenter_standard_key_provider.py index bf00966201..530f6cd1f2 100644 --- a/plugins/modules/vcenter_standard_key_provider.py +++ b/plugins/modules/vcenter_standard_key_provider.py @@ -107,7 +107,7 @@ description: The absolute file path of KMS signed CSR downloaded from O(make_kms_trust_vc.download_client_csr). type: path extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -189,7 +189,8 @@ import os from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -638,7 +639,7 @@ def key_provider_operation(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str', required=True), kms_info=dict( diff --git a/plugins/modules/vmware_about_info.py b/plugins/modules/vmware_about_info.py index 2c92ec9266..386538d1a1 100644 --- a/plugins/modules/vmware_about_info.py +++ b/plugins/modules/vmware_about_info.py @@ -18,7 +18,7 @@ author: - Abhijeet Kasurde (@Akasurde) extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -66,7 +66,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareAboutManager(PyVmomi): @@ -102,7 +103,7 @@ def gather_about_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() module = AnsibleModule( argument_spec=argument_spec, diff --git a/plugins/modules/vmware_all_snapshots_info.py b/plugins/modules/vmware_all_snapshots_info.py index e52f830c23..0c4c363917 100644 --- a/plugins/modules/vmware_all_snapshots_info.py +++ b/plugins/modules/vmware_all_snapshots_info.py @@ -44,7 +44,7 @@ choices: ['exact', 'includes'] default: exact extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -125,9 +125,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, list_snapshots_recursively, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim @@ -185,7 +185,7 @@ def passes_filters(self, snapshot_info, filters, match_type): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(required=True, type="str"), filters=dict(required=False, type="dict", default={}), diff --git a/plugins/modules/vmware_cfg_backup.py b/plugins/modules/vmware_cfg_backup.py index 60a6806411..fbfe3c4dcc 100644 --- a/plugins/modules/vmware_cfg_backup.py +++ b/plugins/modules/vmware_cfg_backup.py @@ -46,7 +46,7 @@ type: str required: true extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -85,7 +85,8 @@ except ImportError: pass -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, get_all_objs, wait_for_task, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import get_all_objs, wait_for_task, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import open_url from ansible.module_utils.six.moves.urllib.error import HTTPError @@ -213,7 +214,7 @@ def exit_maintenance(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict(dest=dict(required=False, type='path'), esxi_hostname=dict(required=False, type='str'), src=dict(required=False, type='path'), diff --git a/plugins/modules/vmware_cluster.py b/plugins/modules/vmware_cluster.py index 45ec4272ee..2bba8c0819 100644 --- a/plugins/modules/vmware_cluster.py +++ b/plugins/modules/vmware_cluster.py @@ -47,7 +47,7 @@ - module: community.vmware.vmware_cluster_ha - module: community.vmware.vmware_cluster_vsan extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -84,8 +84,8 @@ from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, find_datacenter_by_name, - vmware_argument_spec, wait_for_task) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -199,7 +199,7 @@ def check_cluster_configuration(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( cluster_name=dict(type='str', required=True), datacenter=dict(type='str', required=True, aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_cluster_dpm.py b/plugins/modules/vmware_cluster_dpm.py index d976b131ca..edb6472030 100644 --- a/plugins/modules/vmware_cluster_dpm.py +++ b/plugins/modules/vmware_cluster_dpm.py @@ -54,7 +54,7 @@ default: 3 choices: [1, 2, 3, 4, 5] extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -86,9 +86,9 @@ PyVmomi, TaskError, find_datacenter_by_name, - vmware_argument_spec, wait_for_task ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -167,7 +167,7 @@ def configure_dpm(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( cluster_name=dict(type='str', required=True), datacenter=dict(type='str', required=True, aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_cluster_drs.py b/plugins/modules/vmware_cluster_drs.py index 354801d36d..544c32d6a1 100644 --- a/plugins/modules/vmware_cluster_drs.py +++ b/plugins/modules/vmware_cluster_drs.py @@ -77,7 +77,7 @@ type: bool default: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -126,10 +126,10 @@ PyVmomi, TaskError, find_datacenter_by_name, - vmware_argument_spec, wait_for_task, option_diff, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -215,7 +215,7 @@ def configure_drs(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( cluster_name=dict(type='str', required=True), datacenter=dict(type='str', required=True, aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_cluster_drs_recommendations.py b/plugins/modules/vmware_cluster_drs_recommendations.py index c9a131ff5e..b66371cdd1 100644 --- a/plugins/modules/vmware_cluster_drs_recommendations.py +++ b/plugins/modules/vmware_cluster_drs_recommendations.py @@ -35,7 +35,7 @@ required: true aliases: [ datacenter_name ] extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -64,8 +64,8 @@ from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, find_datacenter_by_name, - vmware_argument_spec, wait_for_task) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareCluster(PyVmomi): @@ -104,7 +104,7 @@ def recommendations(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( cluster_name=dict(type='str', required=True), datacenter=dict(type='str', required=True, aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_cluster_ha.py b/plugins/modules/vmware_cluster_ha.py index cad1eb5198..c11d126389 100644 --- a/plugins/modules/vmware_cluster_ha.py +++ b/plugins/modules/vmware_cluster_ha.py @@ -197,7 +197,7 @@ default: 'warning' choices: [ 'disabled', 'warning', 'restartAggressive' ] extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -252,10 +252,10 @@ PyVmomi, TaskError, find_datacenter_by_name, - vmware_argument_spec, wait_for_task, option_diff, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -468,7 +468,7 @@ def configure_ha(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( cluster_name=dict(type='str', required=True), datacenter=dict(type='str', required=True, aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_cluster_info.py b/plugins/modules/vmware_cluster_info.py index 18ac7608bf..276e89ffb4 100644 --- a/plugins/modules/vmware_cluster_info.py +++ b/plugins/modules/vmware_cluster_info.py @@ -63,7 +63,7 @@ type: list elements: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -186,8 +186,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six.moves.urllib.parse import unquote -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_datacenter_by_name, find_cluster_by_name, \ +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_datacenter_by_name, find_cluster_by_name, \ get_parent_datacenter +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vmware_rest_client import VmwareRestClient @@ -322,7 +323,7 @@ def gather_cluster_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type='str'), cluster_name=dict(type='str'), diff --git a/plugins/modules/vmware_cluster_vcls.py b/plugins/modules/vmware_cluster_vcls.py index 830ca9a4bc..de4bb03b34 100644 --- a/plugins/modules/vmware_cluster_vcls.py +++ b/plugins/modules/vmware_cluster_vcls.py @@ -44,7 +44,7 @@ elements: str required: true extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -85,9 +85,9 @@ TaskError, find_datacenter_by_name, find_datastore_by_name, - vmware_argument_spec, wait_for_task, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -189,7 +189,7 @@ def configure_vCLS(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( cluster_name=dict(type='str', required=True), datacenter=dict(type='str', required=True, aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_cluster_vsan.py b/plugins/modules/vmware_cluster_vsan.py index 0f4eb9cad6..2a64d9a5a2 100644 --- a/plugins/modules/vmware_cluster_vsan.py +++ b/plugins/modules/vmware_cluster_vsan.py @@ -72,7 +72,7 @@ type: bool type: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -134,8 +134,8 @@ PyVmomi, TaskError, find_datacenter_by_name, - vmware_argument_spec, wait_for_task) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -249,7 +249,7 @@ def configure_vsan(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( cluster_name=dict(type='str', required=True), datacenter=dict(type='str', required=True, aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_custom_attribute.py b/plugins/modules/vmware_custom_attribute.py index 2d33ba254e..77e535d6db 100644 --- a/plugins/modules/vmware_custom_attribute.py +++ b/plugins/modules/vmware_custom_attribute.py @@ -51,7 +51,7 @@ choices: ['present', 'absent'] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -83,7 +83,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim @@ -139,7 +140,7 @@ def add_custom_def(self, field): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( custom_attribute=dict(type='str', no_log=False, required=True), object_type=dict(type='str', required=True, choices=[ diff --git a/plugins/modules/vmware_custom_attribute_manager.py b/plugins/modules/vmware_custom_attribute_manager.py index 0eef521824..2db2a57a98 100644 --- a/plugins/modules/vmware_custom_attribute_manager.py +++ b/plugins/modules/vmware_custom_attribute_manager.py @@ -65,7 +65,7 @@ choices: ['present', 'absent'] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -121,7 +121,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_obj +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_obj +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class CustomAttributeManager(PyVmomi): @@ -195,7 +196,7 @@ def remove_custom_attributes(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( custom_attributes=dict( type='list', diff --git a/plugins/modules/vmware_datacenter.py b/plugins/modules/vmware_datacenter.py index 8978b59990..4221dd1f5a 100644 --- a/plugins/modules/vmware_datacenter.py +++ b/plugins/modules/vmware_datacenter.py @@ -32,7 +32,7 @@ default: present type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -66,7 +66,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_datacenter_by_name, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_datacenter_by_name, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -146,7 +147,7 @@ def destroy_datacenter(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( datacenter_name=dict(required=True, type='str'), diff --git a/plugins/modules/vmware_datacenter_info.py b/plugins/modules/vmware_datacenter_info.py index 2d5ef87299..f17626c69b 100644 --- a/plugins/modules/vmware_datacenter_info.py +++ b/plugins/modules/vmware_datacenter_info.py @@ -51,7 +51,7 @@ default: false type: bool extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -113,7 +113,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vmware_rest_client import VmwareRestClient @@ -167,7 +168,7 @@ def get_datacenter_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( datacenter=dict(type='str', aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_datastore.py b/plugins/modules/vmware_datastore.py index 9ca1119e84..fd38766f45 100644 --- a/plugins/modules/vmware_datastore.py +++ b/plugins/modules/vmware_datastore.py @@ -57,7 +57,7 @@ type: bool default: true extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -94,9 +94,9 @@ from ansible.module_utils._text import to_native from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, wait_for_task, TaskError) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareDatastore(PyVmomi): @@ -219,7 +219,7 @@ def configure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str', required=True), datacenter=dict(type='str', aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_datastore_cluster.py b/plugins/modules/vmware_datastore_cluster.py index 9922499b41..131c5db439 100644 --- a/plugins/modules/vmware_datastore_cluster.py +++ b/plugins/modules/vmware_datastore_cluster.py @@ -85,7 +85,7 @@ type: bool required: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -136,7 +136,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -259,7 +260,7 @@ def ensure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( datacenter_name=dict(type='str', required=False, aliases=['datacenter']), diff --git a/plugins/modules/vmware_datastore_cluster_manager.py b/plugins/modules/vmware_datastore_cluster_manager.py index cfd7c0ea93..49234c4dd4 100644 --- a/plugins/modules/vmware_datastore_cluster_manager.py +++ b/plugins/modules/vmware_datastore_cluster_manager.py @@ -45,7 +45,7 @@ elements: str required: true extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -95,7 +95,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task, TaskError +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task, TaskError +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -209,7 +210,7 @@ def ensure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( datacenter_name=dict(type='str', required=False, aliases=['datacenter']), diff --git a/plugins/modules/vmware_datastore_info.py b/plugins/modules/vmware_datastore_info.py index 618e929c93..f1ac48a683 100644 --- a/plugins/modules/vmware_datastore_info.py +++ b/plugins/modules/vmware_datastore_info.py @@ -83,7 +83,7 @@ required: false elements: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -171,10 +171,10 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, get_all_objs, find_cluster_by_name, get_parent_datacenter) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vmware_rest_client import VmwareRestClient @@ -309,7 +309,7 @@ def lookup_datastore_by_cluster(self): def main(): """ Main """ - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), datacenter=dict(type='str', aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_datastore_maintenancemode.py b/plugins/modules/vmware_datastore_maintenancemode.py index 079bdbeb45..5fe3dbb2d6 100644 --- a/plugins/modules/vmware_datastore_maintenancemode.py +++ b/plugins/modules/vmware_datastore_maintenancemode.py @@ -46,7 +46,7 @@ required: false type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -106,10 +106,10 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, wait_for_task, find_cluster_by_name, get_all_objs) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -190,7 +190,7 @@ def ensure(self): def main(): - spec = vmware_argument_spec() + spec = base_argument_spec() spec.update(dict( datastore=dict(type='str', required=False), cluster_name=dict(type='str', required=False), diff --git a/plugins/modules/vmware_deploy_ovf.py b/plugins/modules/vmware_deploy_ovf.py index da59cda4d2..31c8f3c243 100644 --- a/plugins/modules/vmware_deploy_ovf.py +++ b/plugins/modules/vmware_deploy_ovf.py @@ -151,7 +151,7 @@ - This requires vmware-tools (vmtoolsd) to properly work after creation. type: bool extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -230,10 +230,10 @@ find_vm_by_name, PyVmomi, gather_vm_facts, - vmware_argument_spec, wait_for_task, wait_for_vm_ip, set_vm_power_state) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from ansible_collections.community.vmware.plugins.module_utils.vmware import vim from pyVmomi import vmodl @@ -812,7 +812,7 @@ def deploy(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update({ 'name': {}, 'datastore': { diff --git a/plugins/modules/vmware_drs_group.py b/plugins/modules/vmware_drs_group.py index ef607072a4..8ad9342a0e 100644 --- a/plugins/modules/vmware_drs_group.py +++ b/plugins/modules/vmware_drs_group.py @@ -17,7 +17,7 @@ description: - "This module can be used to create VM/Host groups in a given cluster. Creates a vm group if O(vms) is set. Creates a host group if O(hosts) is set." extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options module: vmware_drs_group options: @@ -143,11 +143,11 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, wait_for_task, find_cluster_by_name, find_vm_by_id, find_datacenter_by_name) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareDrsGroupManager(PyVmomi): @@ -512,7 +512,7 @@ def main(): Main function """ - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( state=dict(type='str', default='present', choices=['present', 'absent']), diff --git a/plugins/modules/vmware_drs_group_info.py b/plugins/modules/vmware_drs_group_info.py index ff1e0773a0..0ce49a75ef 100644 --- a/plugins/modules/vmware_drs_group_info.py +++ b/plugins/modules/vmware_drs_group_info.py @@ -17,7 +17,7 @@ description: - "This module can be used to gather information about DRS VM/HOST groups from the given cluster." extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options module: vmware_drs_group_info options: @@ -111,7 +111,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi, find_datacenter_by_name, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_datacenter_by_name, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareDrsGroupInfoManager(PyVmomi): @@ -234,7 +235,7 @@ def gather_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type='str', required=False, aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_drs_group_manager.py b/plugins/modules/vmware_drs_group_manager.py index 36d41819a0..79f423b159 100644 --- a/plugins/modules/vmware_drs_group_manager.py +++ b/plugins/modules/vmware_drs_group_manager.py @@ -20,7 +20,7 @@ description: - The module can be used to add VMs / Hosts to or remove them from a DRS group. extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options options: cluster: description: @@ -156,9 +156,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, wait_for_task, find_vm_by_id) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareDrsGroupMemberManager(PyVmomi): @@ -480,7 +480,7 @@ def main(): Main function """ - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( state=dict(type='str', default='present', choices=['present', 'absent']), datacenter=dict(type='str', required=False, aliases=['datacenter_name']), diff --git a/plugins/modules/vmware_drs_override.py b/plugins/modules/vmware_drs_override.py index 5066c3e6a1..8f16c23843 100644 --- a/plugins/modules/vmware_drs_override.py +++ b/plugins/modules/vmware_drs_override.py @@ -24,7 +24,7 @@ default: 'manual' type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options author: - Sergey Goncharov (@svg1007) ''' @@ -58,7 +58,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, wait_for_task, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import wait_for_task, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareDrsOverride(PyVmomi): @@ -104,7 +105,7 @@ def set_drs_override(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( vm_name=dict(type='str', required=True), drs_behavior=dict(type='str', choices=['manual', 'partiallyAutomated', 'fullyAutomated'], default='manual') diff --git a/plugins/modules/vmware_drs_rule_info.py b/plugins/modules/vmware_drs_rule_info.py index df7d9a5a9b..dd765b963d 100644 --- a/plugins/modules/vmware_drs_rule_info.py +++ b/plugins/modules/vmware_drs_rule_info.py @@ -32,7 +32,7 @@ - This is required parameter if O(cluster_name) parameter is not provided. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -107,7 +107,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi, find_datacenter_by_name, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_datacenter_by_name, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareDrsInfoManager(PyVmomi): @@ -232,7 +233,7 @@ def gather_drs_rule_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type='str', required=False), cluster_name=dict(type='str', required=False), diff --git a/plugins/modules/vmware_dvs_host.py b/plugins/modules/vmware_dvs_host.py index 5d4fe27ea6..286ed3ee74 100644 --- a/plugins/modules/vmware_dvs_host.py +++ b/plugins/modules/vmware_dvs_host.py @@ -88,7 +88,7 @@ type: list elements: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -152,8 +152,8 @@ PyVmomi, find_dvs_by_name, find_hostsystem_by_name, - vmware_argument_spec, wait_for_task) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -385,7 +385,7 @@ def check_dvs_host_state(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( esxi_hostname=dict(required=True, type='str'), diff --git a/plugins/modules/vmware_dvs_portgroup.py b/plugins/modules/vmware_dvs_portgroup.py index feae42c965..b2df7976dc 100644 --- a/plugins/modules/vmware_dvs_portgroup.py +++ b/plugins/modules/vmware_dvs_portgroup.py @@ -321,7 +321,7 @@ required: false type: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -423,8 +423,8 @@ find_dvspg_by_name, is_boolean, is_truthy, - vmware_argument_spec, wait_for_task) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareDvsPortgroup(PyVmomi): @@ -882,7 +882,7 @@ def check_dvspg_state(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( portgroup_name=dict(required=True, type='str'), diff --git a/plugins/modules/vmware_dvs_portgroup_find.py b/plugins/modules/vmware_dvs_portgroup_find.py index 1af2eb0d01..bbe56d73ca 100644 --- a/plugins/modules/vmware_dvs_portgroup_find.py +++ b/plugins/modules/vmware_dvs_portgroup_find.py @@ -40,7 +40,7 @@ type: bool default: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -85,8 +85,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - vmware_argument_spec, PyVmomi) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.six.moves.urllib.parse import unquote @@ -181,7 +181,7 @@ def get_dvs_portgroup(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dvswitch=dict(type='str', required=False), vlanid=dict(type='int', required=False), diff --git a/plugins/modules/vmware_dvs_portgroup_info.py b/plugins/modules/vmware_dvs_portgroup_info.py index 437e5ead05..330bc6fbd7 100644 --- a/plugins/modules/vmware_dvs_portgroup_info.py +++ b/plugins/modules/vmware_dvs_portgroup_info.py @@ -60,7 +60,7 @@ type: bool default: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -149,10 +149,10 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - vmware_argument_spec, PyVmomi, get_all_objs, find_dvs_by_name) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.six.moves.urllib.parse import unquote @@ -298,7 +298,7 @@ def gather_dvs_portgroup_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type='str', required=True), show_mac_learning=dict(type='bool', default=True), diff --git a/plugins/modules/vmware_dvswitch.py b/plugins/modules/vmware_dvswitch.py index 21b756235c..27a44b41a1 100644 --- a/plugins/modules/vmware_dvswitch.py +++ b/plugins/modules/vmware_dvswitch.py @@ -231,7 +231,7 @@ 'internal_flows_only': false } extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -338,8 +338,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - PyVmomi, TaskError, find_dvs_by_name, vmware_argument_spec, wait_for_task + PyVmomi, TaskError, find_dvs_by_name, wait_for_task ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareDvSwitch(PyVmomi): @@ -992,7 +993,7 @@ def update_dvswitch(self): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( datacenter_name=dict(aliases=['datacenter']), diff --git a/plugins/modules/vmware_dvswitch_info.py b/plugins/modules/vmware_dvswitch_info.py index 7e3a3b0822..a676e30faf 100644 --- a/plugins/modules/vmware_dvswitch_info.py +++ b/plugins/modules/vmware_dvswitch_info.py @@ -63,7 +63,7 @@ elements: str required: false extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -173,7 +173,8 @@ except ImportError: pass -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_obj, find_object_by_name +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_obj, find_object_by_name +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule @@ -279,7 +280,7 @@ def properties_facts(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( folder=dict(type='str', required=False), switch_name=dict(type='str', required=False, aliases=['switch', 'dvswitch']), diff --git a/plugins/modules/vmware_dvswitch_lacp.py b/plugins/modules/vmware_dvswitch_lacp.py index 8ac7b491dd..482370fa5d 100644 --- a/plugins/modules/vmware_dvswitch_lacp.py +++ b/plugins/modules/vmware_dvswitch_lacp.py @@ -82,7 +82,7 @@ type: list default: [] extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -149,8 +149,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - PyVmomi, TaskError, find_dvs_by_name, vmware_argument_spec, wait_for_task + PyVmomi, TaskError, find_dvs_by_name, wait_for_task ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareDvSwitchLacp(PyVmomi): @@ -409,7 +410,7 @@ def update_lacp_group_config(self, switch_object, lacp_group_spec): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( switch=dict(required=True, aliases=['dvswitch']), diff --git a/plugins/modules/vmware_dvswitch_nioc.py b/plugins/modules/vmware_dvswitch_nioc.py index f526c2d8b3..0fb533c286 100644 --- a/plugins/modules/vmware_dvswitch_nioc.py +++ b/plugins/modules/vmware_dvswitch_nioc.py @@ -84,7 +84,7 @@ default: [] elements: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -143,8 +143,8 @@ from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, find_dvs_by_name, - vmware_argument_spec, wait_for_task) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareDVSwitchNIOC(PyVmomi): @@ -358,7 +358,7 @@ def find_netioc_by_key(self, resource_name): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( diff --git a/plugins/modules/vmware_dvswitch_pvlans.py b/plugins/modules/vmware_dvswitch_pvlans.py index 703a19aff6..246954adab 100644 --- a/plugins/modules/vmware_dvswitch_pvlans.py +++ b/plugins/modules/vmware_dvswitch_pvlans.py @@ -47,7 +47,7 @@ default: [] elements: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -132,8 +132,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - PyVmomi, TaskError, find_dvs_by_name, vmware_argument_spec, wait_for_task + PyVmomi, TaskError, find_dvs_by_name, wait_for_task ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareDvSwitchPvlans(PyVmomi): @@ -505,7 +506,7 @@ def build_change_message(self, operation, changed_list): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( switch=dict(required=True, aliases=['dvswitch']), diff --git a/plugins/modules/vmware_dvswitch_uplink_pg.py b/plugins/modules/vmware_dvswitch_uplink_pg.py index 8d9f308a36..c2e326e85a 100644 --- a/plugins/modules/vmware_dvswitch_uplink_pg.py +++ b/plugins/modules/vmware_dvswitch_uplink_pg.py @@ -117,7 +117,7 @@ type: bool default: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -190,8 +190,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - PyVmomi, TaskError, find_dvs_by_name, vmware_argument_spec, wait_for_task + PyVmomi, TaskError, find_dvs_by_name, wait_for_task ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareDvSwitchUplinkPortgroup(PyVmomi): @@ -449,7 +450,7 @@ def get_lacp_support_mode(mode): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( switch=dict(required=True, aliases=['dvswitch']), diff --git a/plugins/modules/vmware_evc_mode.py b/plugins/modules/vmware_evc_mode.py index 054a27def2..8f681c4349 100644 --- a/plugins/modules/vmware_evc_mode.py +++ b/plugins/modules/vmware_evc_mode.py @@ -44,7 +44,7 @@ default: present type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -87,9 +87,9 @@ from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, find_datacenter_by_name, - vmware_argument_spec, wait_for_task, TaskError) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareEVC(PyVmomi): @@ -204,7 +204,7 @@ def state_disable_evc(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( cluster_name=dict(type='str', required=True, aliases=['cluster']), datacenter_name=dict(type='str', required=True, aliases=['datacenter']), diff --git a/plugins/modules/vmware_export_ovf.py b/plugins/modules/vmware_export_ovf.py index 1c40cdfc3b..23b2b84fa7 100644 --- a/plugins/modules/vmware_export_ovf.py +++ b/plugins/modules/vmware_export_ovf.py @@ -79,7 +79,7 @@ default: 30 type: int extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -109,7 +109,8 @@ from ansible.module_utils.urls import open_url from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_text, to_bytes -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim from pyVim import connect @@ -322,7 +323,7 @@ def export_to_ovf_files(self, vm_obj): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_first_class_disk.py b/plugins/modules/vmware_first_class_disk.py index db224b7f8f..6207b6f6b5 100644 --- a/plugins/modules/vmware_first_class_disk.py +++ b/plugins/modules/vmware_first_class_disk.py @@ -91,7 +91,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, TaskError, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, TaskError, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -238,7 +239,7 @@ def delete(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( datacenter_name=dict(type='str'), diff --git a/plugins/modules/vmware_first_class_disk_info.py b/plugins/modules/vmware_first_class_disk_info.py index dc900bca17..d7835bd0dd 100644 --- a/plugins/modules/vmware_first_class_disk_info.py +++ b/plugins/modules/vmware_first_class_disk_info.py @@ -76,7 +76,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class FirstClassDiskInfo(PyVmomi): @@ -120,7 +121,7 @@ def gather_first_class_disk_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( datacenter_name=dict(type='str'), diff --git a/plugins/modules/vmware_folder_info.py b/plugins/modules/vmware_folder_info.py index 569832fd02..747dc69f19 100644 --- a/plugins/modules/vmware_folder_info.py +++ b/plugins/modules/vmware_folder_info.py @@ -25,7 +25,7 @@ type: str aliases: ['datacenter_name'] extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -131,7 +131,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareFolderInfoManager(PyVmomi): @@ -204,7 +205,7 @@ def build_folder_tree(self, folder, path): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type='str', required=True, aliases=['datacenter_name']) ) diff --git a/plugins/modules/vmware_guest.py b/plugins/modules/vmware_guest.py index 864a8dfc7f..56fb851dcf 100644 --- a/plugins/modules/vmware_guest.py +++ b/plugins/modules/vmware_guest.py @@ -799,7 +799,7 @@ choices: [ 'thin', 'thick', 'eagerzeroedthick' ] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -1114,7 +1114,6 @@ get_all_objs, compile_folder_path_for_object, serialize_spec, - vmware_argument_spec, set_vm_power_state, PyVmomi, find_dvs_by_name, @@ -1122,6 +1121,7 @@ wait_for_vm_ip, quote_obj_name, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vm_device_helper import PyVmomiDeviceHelper from ansible_collections.community.vmware.plugins.module_utils.vmware_spbm import SPBM @@ -3403,7 +3403,7 @@ def wait_for_customization(self, vm, timeout=3600, sleep=10): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( state=dict(type='str', default='present', choices=['absent', 'poweredoff', 'powered-off', diff --git a/plugins/modules/vmware_guest_boot_info.py b/plugins/modules/vmware_guest_boot_info.py index 711488e804..c27aab38fa 100644 --- a/plugins/modules/vmware_guest_boot_info.py +++ b/plugins/modules/vmware_guest_boot_info.py @@ -46,7 +46,7 @@ choices: ['first', 'last'] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -91,7 +91,8 @@ from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_vm_by_id +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_vm_by_id +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim, VmomiSupport @@ -172,7 +173,7 @@ def ensure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_boot_manager.py b/plugins/modules/vmware_guest_boot_manager.py index 2700ff4ba0..1bb9b0f878 100644 --- a/plugins/modules/vmware_guest_boot_manager.py +++ b/plugins/modules/vmware_guest_boot_manager.py @@ -85,7 +85,7 @@ - Choose if EFI secure boot should be enabled. EFI secure boot can only be enabled with boot_firmware = efi type: 'bool' extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -167,7 +167,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_vm_by_id, wait_for_task, TaskError +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_vm_by_id, wait_for_task, TaskError +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim, VmomiSupport @@ -375,7 +376,7 @@ def ensure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_controller.py b/plugins/modules/vmware_guest_controller.py index e9c24bef98..62c62d1a9a 100644 --- a/plugins/modules/vmware_guest_controller.py +++ b/plugins/modules/vmware_guest_controller.py @@ -127,7 +127,7 @@ default: 10 type: int extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -246,7 +246,8 @@ import time from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task, TaskError +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task, TaskError +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vm_device_helper import PyVmomiDeviceHelper @@ -489,7 +490,7 @@ def configure_disk_controllers(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_cross_vc_clone.py b/plugins/modules/vmware_guest_cross_vc_clone.py index 748948c5ec..461a8a2184 100644 --- a/plugins/modules/vmware_guest_cross_vc_clone.py +++ b/plugins/modules/vmware_guest_cross_vc_clone.py @@ -117,7 +117,7 @@ default: 3600 version_added: '3.5.0' extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options author: @@ -199,12 +199,12 @@ find_folder_by_name, find_vm_by_name, connect_to_api, - vmware_argument_spec, gather_vm_facts, find_obj, find_resource_pool_by_name, wait_for_task, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim except ImportError: @@ -344,7 +344,7 @@ def main(): """ Main method """ - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_custom_attribute_defs.py b/plugins/modules/vmware_guest_custom_attribute_defs.py index 9ff05e4126..c3dccd5699 100644 --- a/plugins/modules/vmware_guest_custom_attribute_defs.py +++ b/plugins/modules/vmware_guest_custom_attribute_defs.py @@ -36,7 +36,7 @@ choices: ['present', 'absent'] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -71,7 +71,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim @@ -113,7 +114,7 @@ def add_custom_def(self, field): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( attribute_key=dict(type='str', no_log=False), state=dict(type='str', default='present', choices=['absent', 'present']), diff --git a/plugins/modules/vmware_guest_custom_attributes.py b/plugins/modules/vmware_guest_custom_attributes.py index 7f7566ebd0..4b5d66afcf 100644 --- a/plugins/modules/vmware_guest_custom_attributes.py +++ b/plugins/modules/vmware_guest_custom_attributes.py @@ -76,7 +76,7 @@ type: list elements: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -154,7 +154,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmAttributeManager(PyVmomi): @@ -304,7 +305,7 @@ def check_exists(self, vm, user_fields): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type='str'), name=dict(type='str'), diff --git a/plugins/modules/vmware_guest_customization_info.py b/plugins/modules/vmware_guest_customization_info.py index 5fd637d36d..d8a9788695 100644 --- a/plugins/modules/vmware_guest_customization_info.py +++ b/plugins/modules/vmware_guest_customization_info.py @@ -25,7 +25,7 @@ required: false type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -89,7 +89,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_text -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareCustomSpecManger(PyVmomi): @@ -172,7 +173,7 @@ def gather_custom_spec_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( spec_name=dict(type='str'), ) diff --git a/plugins/modules/vmware_guest_disk.py b/plugins/modules/vmware_guest_disk.py index 960fe89175..487cd4473e 100644 --- a/plugins/modules/vmware_guest_disk.py +++ b/plugins/modules/vmware_guest_disk.py @@ -229,7 +229,7 @@ type: list elements: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -511,8 +511,9 @@ from random import randint from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, \ +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, \ wait_for_task, find_obj, get_all_objs, get_parent_datacenter +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vm_device_helper import PyVmomiDeviceHelper @@ -1137,7 +1138,7 @@ def get_recommended_datastore(self, datastore_cluster_obj, disk_spec_obj): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_disk_info.py b/plugins/modules/vmware_guest_disk_info.py index 2be78c64b2..b0463d8d5d 100644 --- a/plugins/modules/vmware_guest_disk_info.py +++ b/plugins/modules/vmware_guest_disk_info.py @@ -62,7 +62,7 @@ required: true type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -148,12 +148,13 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_text -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vm_device_helper import PyVmomiDeviceHelper def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_file_operation.py b/plugins/modules/vmware_guest_file_operation.py index 487fe1298a..7ce3fcef6a 100644 --- a/plugins/modules/vmware_guest_file_operation.py +++ b/plugins/modules/vmware_guest_file_operation.py @@ -154,7 +154,7 @@ version_added: '3.1.0' extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -234,7 +234,8 @@ from ansible.module_utils._text import to_bytes, to_native from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, find_cluster_by_name, find_datacenter_by_name, - find_vm_by_id, vmware_argument_spec) + find_vm_by_id) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareGuestFileManager(PyVmomi): @@ -453,7 +454,7 @@ def copy(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( datacenter=dict(type='str'), cluster=dict(type='str'), diff --git a/plugins/modules/vmware_guest_find.py b/plugins/modules/vmware_guest_find.py index 64b5b2f3a2..3026417bfe 100644 --- a/plugins/modules/vmware_guest_find.py +++ b/plugins/modules/vmware_guest_find.py @@ -34,7 +34,7 @@ default: false type: bool extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -71,7 +71,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_vm_by_id +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_vm_by_id +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim @@ -113,7 +114,7 @@ def getvm_folder_paths(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_info.py b/plugins/modules/vmware_guest_info.py index 1b2442e9e2..56641d2d7e 100644 --- a/plugins/modules/vmware_guest_info.py +++ b/plugins/modules/vmware_guest_info.py @@ -108,7 +108,7 @@ elements: str required: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -238,7 +238,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_text -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vmware_rest_client import VmwareRestClient try: from com.vmware.vapi.std_client import DynamicID # noqa: F401 @@ -255,7 +256,7 @@ def __init__(self, module): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), name_match=dict(type='str', choices=['first', 'last'], default='first'), diff --git a/plugins/modules/vmware_guest_instant_clone.py b/plugins/modules/vmware_guest_instant_clone.py index 3b8c179729..4932a4080b 100644 --- a/plugins/modules/vmware_guest_instant_clone.py +++ b/plugins/modules/vmware_guest_instant_clone.py @@ -139,7 +139,7 @@ type: int default: 300 extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options author: - Anant Chopra (@Anant99-sys) @@ -274,11 +274,11 @@ find_vm_by_name, find_vm_by_id, connect_to_api, - vmware_argument_spec, find_obj, wait_for_task, set_vm_power_state ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim @@ -517,7 +517,7 @@ def populate_specs(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str', required=True, aliases=['vm_name']), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_move.py b/plugins/modules/vmware_guest_move.py index 2b7e4ae5a5..0c3921b7e0 100644 --- a/plugins/modules/vmware_guest_move.py +++ b/plugins/modules/vmware_guest_move.py @@ -67,7 +67,7 @@ required: true type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -167,7 +167,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -176,7 +177,7 @@ def __init__(self, module): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), name_match=dict( diff --git a/plugins/modules/vmware_guest_network.py b/plugins/modules/vmware_guest_network.py index 799d19d3f3..7f72f36e5d 100644 --- a/plugins/modules/vmware_guest_network.py +++ b/plugins/modules/vmware_guest_network.py @@ -155,7 +155,7 @@ - Return information about current guest network adapters. type: bool extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -289,7 +289,8 @@ import copy from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, TaskError, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, TaskError, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vm_device_helper import PyVmomiDeviceHelper @@ -757,7 +758,7 @@ def _nic_present(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_powerstate.py b/plugins/modules/vmware_guest_powerstate.py index 1391c61811..b59c9aca43 100644 --- a/plugins/modules/vmware_guest_powerstate.py +++ b/plugins/modules/vmware_guest_powerstate.py @@ -126,7 +126,7 @@ type: list elements: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options """ EXAMPLES = r""" @@ -214,13 +214,14 @@ from random import randint from datetime import datetime from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, set_vm_power_state, vmware_argument_spec, \ +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, set_vm_power_state, \ check_answer_question_status, make_answer_response, answer_question, gather_vm_facts +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type='str', default='ha-datacenter'), state=dict(type='str', default='present', diff --git a/plugins/modules/vmware_guest_register_operation.py b/plugins/modules/vmware_guest_register_operation.py index 6873b35d50..05166a9045 100644 --- a/plugins/modules/vmware_guest_register_operation.py +++ b/plugins/modules/vmware_guest_register_operation.py @@ -78,7 +78,7 @@ choices: [ present, absent ] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -138,8 +138,9 @@ from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_resource_pool_by_name, \ +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_resource_pool_by_name, \ wait_for_task, compile_folder_path_for_object, find_cluster_by_name +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule @@ -249,7 +250,7 @@ def execute(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(datacenter=dict(type="str", default="ha-datacenter"), cluster=dict(type="str"), folder=dict(type="str"), diff --git a/plugins/modules/vmware_guest_screenshot.py b/plugins/modules/vmware_guest_screenshot.py index 5ba4eb784a..99fc3bd4ea 100644 --- a/plugins/modules/vmware_guest_screenshot.py +++ b/plugins/modules/vmware_guest_screenshot.py @@ -75,7 +75,7 @@ facts manually.' type: path extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -131,7 +131,8 @@ from ansible.module_utils.six.moves.urllib.parse import urlencode, quote from ansible.module_utils._text import to_native from ansible.module_utils.urls import open_url -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task, get_parent_datacenter +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task, get_parent_datacenter +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec import os @@ -242,7 +243,7 @@ def take_vm_screenshot(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_sendkey.py b/plugins/modules/vmware_guest_sendkey.py index 5340a2da6d..db5a5c2300 100644 --- a/plugins/modules/vmware_guest_sendkey.py +++ b/plugins/modules/vmware_guest_sendkey.py @@ -89,7 +89,7 @@ type: int default: 0 extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -162,7 +162,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -368,7 +369,7 @@ def send_key_to_vm(self, vm_obj): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_serial_port.py b/plugins/modules/vmware_guest_serial_port.py index 8b7a69f0bf..1c7e999191 100644 --- a/plugins/modules/vmware_guest_serial_port.py +++ b/plugins/modules/vmware_guest_serial_port.py @@ -124,7 +124,7 @@ - Required when O(backings[].backing_type=file). type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options author: - Anusha Hegde (@anusha94) ''' @@ -213,7 +213,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native try: from pyVmomi import vim @@ -515,7 +516,7 @@ def main(): """ Main method """ - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_snapshot.py b/plugins/modules/vmware_guest_snapshot.py index cc56098421..e0f9dad91b 100644 --- a/plugins/modules/vmware_guest_snapshot.py +++ b/plugins/modules/vmware_guest_snapshot.py @@ -128,7 +128,7 @@ - Value to change the description of an existing snapshot to. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -286,7 +286,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, list_snapshots, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, list_snapshots +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -435,7 +436,7 @@ def apply_snapshot_op(self, vm): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( state=dict(default='present', choices=['present', 'absent', 'revert', 'remove_all']), name=dict(type='str'), diff --git a/plugins/modules/vmware_guest_snapshot_info.py b/plugins/modules/vmware_guest_snapshot_info.py index 562dd3261c..3a80eea2ba 100644 --- a/plugins/modules/vmware_guest_snapshot_info.py +++ b/plugins/modules/vmware_guest_snapshot_info.py @@ -62,7 +62,7 @@ required: true type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -117,7 +117,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, list_snapshots, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, list_snapshots +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -140,7 +141,7 @@ def gather_guest_snapshot_info(vm_obj=None): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_storage_policy.py b/plugins/modules/vmware_guest_storage_policy.py index 7ae239d851..e3fe8c8c23 100644 --- a/plugins/modules/vmware_guest_storage_policy.py +++ b/plugins/modules/vmware_guest_storage_policy.py @@ -98,7 +98,7 @@ type: str required: true extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -162,7 +162,8 @@ PYVMOMI_IMP_ERR = traceback.format_exc() from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vmware_spbm import SPBM @@ -397,7 +398,7 @@ def ensure_storage_policies(self, vm_obj): def run_module(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_tools_info.py b/plugins/modules/vmware_guest_tools_info.py index 13e41efc3c..ed32a2c587 100644 --- a/plugins/modules/vmware_guest_tools_info.py +++ b/plugins/modules/vmware_guest_tools_info.py @@ -66,7 +66,7 @@ - The datacenter name to which virtual machine belongs to. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -118,7 +118,8 @@ from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -152,7 +153,7 @@ def gather_vmtools_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_tools_upgrade.py b/plugins/modules/vmware_guest_tools_upgrade.py index ed4f54f269..8471c9979f 100644 --- a/plugins/modules/vmware_guest_tools_upgrade.py +++ b/plugins/modules/vmware_guest_tools_upgrade.py @@ -77,7 +77,7 @@ type: str required: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options author: - Mike Klebolt (@MikeKlebolt) @@ -118,7 +118,8 @@ from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -202,7 +203,7 @@ def upgrade_tools(self, vm): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), name_match=dict(type='str', choices=['first', 'last'], default='first'), diff --git a/plugins/modules/vmware_guest_tools_wait.py b/plugins/modules/vmware_guest_tools_wait.py index 13ed6c1649..d46d2320ed 100644 --- a/plugins/modules/vmware_guest_tools_wait.py +++ b/plugins/modules/vmware_guest_tools_wait.py @@ -71,7 +71,7 @@ - The datacenter to search for a virtual machine. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -131,7 +131,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, gather_vm_facts, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, gather_vm_facts +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -158,7 +159,7 @@ def wait_for_tools(self, vm, timeout): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), name_match=dict(type='str', default='first', choices=['first', 'last']), diff --git a/plugins/modules/vmware_guest_tpm.py b/plugins/modules/vmware_guest_tpm.py index 062bf2c5bc..a655faa6fc 100644 --- a/plugins/modules/vmware_guest_tpm.py +++ b/plugins/modules/vmware_guest_tpm.py @@ -65,7 +65,7 @@ choices: ['present', 'absent'] default: 'present' extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -107,7 +107,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vm_device_helper import PyVmomiDeviceHelper @@ -192,7 +193,7 @@ def vtpm_operation(self, vm_obj=None): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_guest_vgpu.py b/plugins/modules/vmware_guest_vgpu.py index b3ecd52444..04fa3a546e 100644 --- a/plugins/modules/vmware_guest_vgpu.py +++ b/plugins/modules/vmware_guest_vgpu.py @@ -88,7 +88,7 @@ - The ESXi hostname where the virtual machine is running. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options """ EXAMPLES = r""" @@ -144,9 +144,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, wait_for_task, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -335,7 +335,7 @@ def _get_vgpu_profiles_name(self, vm_obj, vgpu_prfl): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type="str"), uuid=dict(type="str"), diff --git a/plugins/modules/vmware_guest_vgpu_info.py b/plugins/modules/vmware_guest_vgpu_info.py index 1bdeae6f29..6276f53ca8 100644 --- a/plugins/modules/vmware_guest_vgpu_info.py +++ b/plugins/modules/vmware_guest_vgpu_info.py @@ -62,7 +62,7 @@ default: false type: bool extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options """ EXAMPLES = r""" @@ -103,8 +103,8 @@ from ansible.module_utils._text import to_text from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -134,7 +134,7 @@ def gather_vgpu_profile_facts(self, vm_obj): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type="str"), uuid=dict(type="str"), diff --git a/plugins/modules/vmware_guest_video.py b/plugins/modules/vmware_guest_video.py index 62c3ad9c7b..8aaa696145 100644 --- a/plugins/modules/vmware_guest_video.py +++ b/plugins/modules/vmware_guest_video.py @@ -92,7 +92,7 @@ - The value of 3D Memory must be power of 2 and valid value is from 32 MB to 2048 MB. type: int extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -165,7 +165,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PyVmomiHelper(PyVmomi): @@ -321,7 +322,7 @@ def reconfigure_vm_video(self, vm_obj): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_host.py b/plugins/modules/vmware_host.py index 228a1280c6..851d0cd20c 100644 --- a/plugins/modules/vmware_host.py +++ b/plugins/modules/vmware_host.py @@ -117,7 +117,7 @@ type: bool default: true extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -204,9 +204,10 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - PyVmomi, TaskError, vmware_argument_spec, + PyVmomi, TaskError, wait_for_task, find_host_by_cluster_datacenter, find_hostsystem_by_name ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareHost(PyVmomi): @@ -787,7 +788,7 @@ def disconnect_host(self, host_object): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter_name=dict(type='str', required=True, aliases=['datacenter']), cluster_name=dict(type='str', aliases=['cluster']), diff --git a/plugins/modules/vmware_host_acceptance.py b/plugins/modules/vmware_host_acceptance.py index 92dc983285..309c9b3c95 100644 --- a/plugins/modules/vmware_host_acceptance.py +++ b/plugins/modules/vmware_host_acceptance.py @@ -41,7 +41,7 @@ required: true type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -81,7 +81,8 @@ except ImportError: pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -121,7 +122,7 @@ def set_acceptance_level(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_acceptance_info.py b/plugins/modules/vmware_host_acceptance_info.py index 03308c9756..c129ead6ac 100644 --- a/plugins/modules/vmware_host_acceptance_info.py +++ b/plugins/modules/vmware_host_acceptance_info.py @@ -34,7 +34,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -63,7 +63,8 @@ except ImportError: pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -88,7 +89,7 @@ def gather_acceptance_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_active_directory.py b/plugins/modules/vmware_host_active_directory.py index b6b205c2e5..89e318731c 100644 --- a/plugins/modules/vmware_host_active_directory.py +++ b/plugins/modules/vmware_host_active_directory.py @@ -52,7 +52,7 @@ - This parameter is required if O(esxi_hostname) is not specified. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -103,7 +103,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, TaskError, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, TaskError, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -331,7 +332,7 @@ def get_ad_auth_object(self, host_object): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( ad_domain=dict(type='str', default='', aliases=['domain', 'domain_name']), ad_user=dict(type='str', default=''), diff --git a/plugins/modules/vmware_host_auto_start.py b/plugins/modules/vmware_host_auto_start.py index 4109066de3..d327497ee0 100644 --- a/plugins/modules/vmware_host_auto_start.py +++ b/plugins/modules/vmware_host_auto_start.py @@ -125,7 +125,7 @@ choices: ['no', 'yes', 'systemDefault'] default: systemDefault extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -199,7 +199,8 @@ pass from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule @@ -333,7 +334,7 @@ def execute(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(esxi_hostname=dict(type='str', required=True), name=dict(type='str'), uuid=dict(type='str'), diff --git a/plugins/modules/vmware_host_capability_info.py b/plugins/modules/vmware_host_capability_info.py index ac6030cba8..6728c23d0f 100644 --- a/plugins/modules/vmware_host_capability_info.py +++ b/plugins/modules/vmware_host_capability_info.py @@ -29,7 +29,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -71,7 +71,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class CapabilityInfoManager(PyVmomi): @@ -199,7 +200,7 @@ def gather_host_capability_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_config_info.py b/plugins/modules/vmware_host_config_info.py index 49796818d3..15b4af631d 100644 --- a/plugins/modules/vmware_host_config_info.py +++ b/plugins/modules/vmware_host_config_info.py @@ -29,7 +29,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -69,7 +69,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareConfigInfoManager(PyVmomi): @@ -90,7 +91,7 @@ def gather_host_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_config_manager.py b/plugins/modules/vmware_host_config_manager.py index 1c331631f7..e341bf82a8 100644 --- a/plugins/modules/vmware_host_config_manager.py +++ b/plugins/modules/vmware_host_config_manager.py @@ -38,7 +38,7 @@ default: {} type: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -85,7 +85,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi, is_boolean, is_integer, is_truthy +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, is_boolean, is_integer, is_truthy +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native from ansible.module_utils.six import integer_types, string_types @@ -167,7 +168,7 @@ def set_host_configuration_facts(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_custom_attributes.py b/plugins/modules/vmware_host_custom_attributes.py index 7285e322c0..6bfc2c9ee0 100644 --- a/plugins/modules/vmware_host_custom_attributes.py +++ b/plugins/modules/vmware_host_custom_attributes.py @@ -50,7 +50,7 @@ type: list elements: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -101,7 +101,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class HostAttributeManager(PyVmomi): @@ -150,7 +151,7 @@ def check_exists(self, field): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type='str', required=True), state=dict(type='str', default='present', diff --git a/plugins/modules/vmware_host_datastore.py b/plugins/modules/vmware_host_datastore.py index fa41c0adeb..1b531e4c34 100644 --- a/plugins/modules/vmware_host_datastore.py +++ b/plugins/modules/vmware_host_datastore.py @@ -96,7 +96,7 @@ choices: [ present, absent ] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -192,7 +192,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, find_datastore_by_name, find_obj, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import find_datastore_by_name, find_obj, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vmware_sms import SMS from ansible.module_utils._text import to_native @@ -414,7 +415,7 @@ def mount_vvol_datastore_host(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datastore_name=dict(type='str', required=True), datastore_type=dict(type='str', choices=['nfs', 'nfs41', 'vmfs', 'vvol']), diff --git a/plugins/modules/vmware_host_disk_info.py b/plugins/modules/vmware_host_disk_info.py index 117751d984..769797030c 100644 --- a/plugins/modules/vmware_host_disk_info.py +++ b/plugins/modules/vmware_host_disk_info.py @@ -30,7 +30,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = ''' @@ -85,7 +85,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class HostDiskInfo(PyVmomi): @@ -144,7 +145,7 @@ def gather_host_disk_info(self): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_dns.py b/plugins/modules/vmware_host_dns.py index 287a929f15..babb0283bd 100644 --- a/plugins/modules/vmware_host_dns.py +++ b/plugins/modules/vmware_host_dns.py @@ -71,7 +71,7 @@ - Cannot be used when you connect directly to an ESXi host. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -147,7 +147,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -425,7 +426,7 @@ def get_differt_entries(list1, list2): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( type=dict(required=True, type='str', choices=['dhcp', 'static']), device=dict(type='str'), diff --git a/plugins/modules/vmware_host_dns_info.py b/plugins/modules/vmware_host_dns_info.py index b03c25d427..13d7032c71 100644 --- a/plugins/modules/vmware_host_dns_info.py +++ b/plugins/modules/vmware_host_dns_info.py @@ -29,7 +29,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -73,7 +73,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareDnsInfoManager(PyVmomi): @@ -99,7 +100,7 @@ def gather_dns_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_facts.py b/plugins/modules/vmware_host_facts.py index 1bfd64012f..c038b50217 100644 --- a/plugins/modules/vmware_host_facts.py +++ b/plugins/modules/vmware_host_facts.py @@ -67,7 +67,7 @@ elements: str required: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -231,10 +231,10 @@ from ansible.module_utils.common.text.formatters import bytes_to_human from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, find_obj, ansible_date_time_facts ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec try: from pyVmomi import vim, vmodl @@ -417,7 +417,7 @@ def properties_facts(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type='str', required=False), show_tag=dict(type='bool', default=False), diff --git a/plugins/modules/vmware_host_feature_info.py b/plugins/modules/vmware_host_feature_info.py index dcf885e477..bd353488df 100644 --- a/plugins/modules/vmware_host_feature_info.py +++ b/plugins/modules/vmware_host_feature_info.py @@ -29,7 +29,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -83,7 +83,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class FeatureCapabilityInfoManager(PyVmomi): @@ -112,7 +113,7 @@ def gather_host_feature_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_firewall_info.py b/plugins/modules/vmware_host_firewall_info.py index 05479fe51e..a30139865f 100644 --- a/plugins/modules/vmware_host_firewall_info.py +++ b/plugins/modules/vmware_host_firewall_info.py @@ -29,7 +29,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -87,7 +87,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class FirewallInfoManager(PyVmomi): @@ -134,7 +135,7 @@ def gather_host_firewall_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_firewall_manager.py b/plugins/modules/vmware_host_firewall_manager.py index 3f70a5c8d3..6a3129a185 100644 --- a/plugins/modules/vmware_host_firewall_manager.py +++ b/plugins/modules/vmware_host_firewall_manager.py @@ -75,7 +75,7 @@ elements: str default: [] extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -204,7 +204,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native import socket @@ -392,7 +393,7 @@ def ensure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_graphics.py b/plugins/modules/vmware_host_graphics.py index aa357602f5..413937e4fd 100644 --- a/plugins/modules/vmware_host_graphics.py +++ b/plugins/modules/vmware_host_graphics.py @@ -48,7 +48,7 @@ default: False type: bool extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -90,7 +90,8 @@ HAS_PYVMOMI = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -162,7 +163,7 @@ def ensure(self): def main(): """ Main module method""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str'), esxi_hostname=dict(type='list', elements='str'), diff --git a/plugins/modules/vmware_host_hyperthreading.py b/plugins/modules/vmware_host_hyperthreading.py index 556dc3cd30..9da782cecf 100644 --- a/plugins/modules/vmware_host_hyperthreading.py +++ b/plugins/modules/vmware_host_hyperthreading.py @@ -39,7 +39,7 @@ - This parameter is required if O(esxi_hostname) is not specified. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -92,7 +92,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -227,7 +228,7 @@ def ensure(self): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( state=dict(default='enabled', choices=['enabled', 'disabled']), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_ipv6.py b/plugins/modules/vmware_host_ipv6.py index 8c6cf3cf0a..3bd048121d 100644 --- a/plugins/modules/vmware_host_ipv6.py +++ b/plugins/modules/vmware_host_ipv6.py @@ -37,7 +37,7 @@ - This is required parameter if O(esxi_hostname) is not specified. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -89,7 +89,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -205,7 +206,7 @@ def main(): """ Main """ - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( state=dict(default='enabled', choices=['enabled', 'disabled']), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_iscsi.py b/plugins/modules/vmware_host_iscsi.py index c6e2eced2e..533e4fb9f6 100644 --- a/plugins/modules/vmware_host_iscsi.py +++ b/plugins/modules/vmware_host_iscsi.py @@ -265,7 +265,7 @@ - enabled - disabled extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -378,7 +378,8 @@ pass from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule from copy import deepcopy @@ -851,7 +852,7 @@ def main(): mutual_chap_inherited=dict(type='bool', default=True) ) - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type='str', required=True), iscsi_config=dict(type='dict', diff --git a/plugins/modules/vmware_host_iscsi_info.py b/plugins/modules/vmware_host_iscsi_info.py index d9599a26d9..9a697b7f63 100644 --- a/plugins/modules/vmware_host_iscsi_info.py +++ b/plugins/modules/vmware_host_iscsi_info.py @@ -22,7 +22,7 @@ type: str required: true extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -120,7 +120,8 @@ pass import re -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule @@ -202,7 +203,7 @@ def execute(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type='str', required=True) ) diff --git a/plugins/modules/vmware_host_kernel_manager.py b/plugins/modules/vmware_host_kernel_manager.py index 1fdfec7039..b0a0d71399 100644 --- a/plugins/modules/vmware_host_kernel_manager.py +++ b/plugins/modules/vmware_host_kernel_manager.py @@ -44,7 +44,7 @@ required: true type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -92,7 +92,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -179,7 +180,7 @@ def check_host_configuration_state(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() # add the arguments we're going to use for this module argument_spec.update( cluster_name=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_lockdown.py b/plugins/modules/vmware_host_lockdown.py index a5b1da457a..2b234714f6 100644 --- a/plugins/modules/vmware_host_lockdown.py +++ b/plugins/modules/vmware_host_lockdown.py @@ -46,7 +46,7 @@ choices: [ disabled, normal, strict ] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -124,7 +124,8 @@ HAS_PYVMOMI = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -181,7 +182,7 @@ def ensure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='list', required=False, elements='str'), diff --git a/plugins/modules/vmware_host_lockdown_exceptions.py b/plugins/modules/vmware_host_lockdown_exceptions.py index 709243ee02..d7fd2c3eef 100644 --- a/plugins/modules/vmware_host_lockdown_exceptions.py +++ b/plugins/modules/vmware_host_lockdown_exceptions.py @@ -48,7 +48,7 @@ elements: str required: true extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -89,7 +89,8 @@ HAS_PYVMOMI = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -161,7 +162,7 @@ def ensure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='list', required=False, elements='str'), diff --git a/plugins/modules/vmware_host_logbundle.py b/plugins/modules/vmware_host_logbundle.py index 46e7516c31..c5b61c74e6 100644 --- a/plugins/modules/vmware_host_logbundle.py +++ b/plugins/modules/vmware_host_logbundle.py @@ -113,7 +113,7 @@ type: int default: 5 extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -164,7 +164,8 @@ import xml.etree.ElementTree as ET -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import fetch_url @@ -242,7 +243,7 @@ def get_logbundle(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type='str', required=True), dest=dict(type='str', required=True), diff --git a/plugins/modules/vmware_host_logbundle_info.py b/plugins/modules/vmware_host_logbundle_info.py index e066430ad2..7c94f988d7 100644 --- a/plugins/modules/vmware_host_logbundle_info.py +++ b/plugins/modules/vmware_host_logbundle_info.py @@ -24,7 +24,7 @@ type: str required: true extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -87,7 +87,8 @@ except ImportError: pass -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import fetch_url import xml.etree.ElementTree as ET @@ -127,7 +128,7 @@ def get_listmanifests(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type='str', required=True) ) diff --git a/plugins/modules/vmware_host_ntp.py b/plugins/modules/vmware_host_ntp.py index d04e0820ca..2e45469c9d 100644 --- a/plugins/modules/vmware_host_ntp.py +++ b/plugins/modules/vmware_host_ntp.py @@ -54,7 +54,7 @@ required: false default: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -132,7 +132,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -362,7 +363,7 @@ def get_differt_entries(list1, list2): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_ntp_info.py b/plugins/modules/vmware_host_ntp_info.py index 0bc976d549..4ad62483ea 100644 --- a/plugins/modules/vmware_host_ntp_info.py +++ b/plugins/modules/vmware_host_ntp_info.py @@ -31,7 +31,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -75,7 +75,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareNtpInfoManager(PyVmomi): @@ -105,7 +106,7 @@ def gather_ntp_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_package_info.py b/plugins/modules/vmware_host_package_info.py index fd0a27cd8f..d44563c95b 100644 --- a/plugins/modules/vmware_host_package_info.py +++ b/plugins/modules/vmware_host_package_info.py @@ -31,7 +31,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -65,7 +65,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwarePackageManager(PyVmomi): @@ -98,7 +99,7 @@ def gather_package_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_passthrough.py b/plugins/modules/vmware_host_passthrough.py index 3b8b36633f..0ca00579bd 100644 --- a/plugins/modules/vmware_host_passthrough.py +++ b/plugins/modules/vmware_host_passthrough.py @@ -54,7 +54,7 @@ default: present type: str extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options """ EXAMPLES = r""" @@ -140,7 +140,8 @@ pass import copy -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule @@ -332,7 +333,7 @@ def execute(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster=dict(type='str', aliases=['cluster_name']), esxi_hostname=dict(type='str'), diff --git a/plugins/modules/vmware_host_powermgmt_policy.py b/plugins/modules/vmware_host_powermgmt_policy.py index 4bce439701..23bf1c7e9e 100644 --- a/plugins/modules/vmware_host_powermgmt_policy.py +++ b/plugins/modules/vmware_host_powermgmt_policy.py @@ -35,7 +35,7 @@ - This is required parameter if O(esxi_hostname) is not specified. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -84,7 +84,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -201,7 +202,7 @@ def main(): """ Main """ - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( policy=dict(type='str', default='balanced', choices=['high-performance', 'balanced', 'low-power', 'custom']), diff --git a/plugins/modules/vmware_host_powerstate.py b/plugins/modules/vmware_host_powerstate.py index eaebf83743..22895ad36a 100644 --- a/plugins/modules/vmware_host_powerstate.py +++ b/plugins/modules/vmware_host_powerstate.py @@ -55,7 +55,7 @@ default: 600 type: int extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -105,7 +105,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task, TaskError +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, wait_for_task, TaskError +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -193,7 +194,7 @@ def ensure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( state=dict(type='str', default='shutdown-host', choices=['power-down-to-standby', 'power-up-from-standby', 'shutdown-host', 'reboot-host']), diff --git a/plugins/modules/vmware_host_scanhba.py b/plugins/modules/vmware_host_scanhba.py index 54addd4387..de46551292 100644 --- a/plugins/modules/vmware_host_scanhba.py +++ b/plugins/modules/vmware_host_scanhba.py @@ -51,7 +51,7 @@ default: false type: bool extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -108,7 +108,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareHbaScan(PyVmomi): @@ -146,7 +147,7 @@ def scan(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type='str', required=False), cluster_name=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_scsidisk_info.py b/plugins/modules/vmware_host_scsidisk_info.py index 7619edebe4..1b60bb3fcc 100644 --- a/plugins/modules/vmware_host_scsidisk_info.py +++ b/plugins/modules/vmware_host_scsidisk_info.py @@ -32,7 +32,7 @@ - This parameter is required if O(esxi_hostname) is not specified. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -88,7 +88,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareHostDiskManager(PyVmomi): @@ -151,7 +152,7 @@ def gather_disk_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type='str', required=False), cluster_name=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_service_info.py b/plugins/modules/vmware_host_service_info.py index 21e45ca746..9b58113129 100644 --- a/plugins/modules/vmware_host_service_info.py +++ b/plugins/modules/vmware_host_service_info.py @@ -33,7 +33,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -90,7 +90,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareServiceManager(PyVmomi): @@ -125,7 +126,7 @@ def gather_host_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_service_manager.py b/plugins/modules/vmware_host_service_manager.py index f63a804354..fc80c52cbb 100644 --- a/plugins/modules/vmware_host_service_manager.py +++ b/plugins/modules/vmware_host_service_manager.py @@ -56,7 +56,7 @@ required: true type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -112,7 +112,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -194,7 +195,7 @@ def check_service_state(self, host, service_name): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_snmp.py b/plugins/modules/vmware_host_snmp.py index 095bd9a63e..c2e0fca489 100644 --- a/plugins/modules/vmware_host_snmp.py +++ b/plugins/modules/vmware_host_snmp.py @@ -94,7 +94,7 @@ - System location. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -184,7 +184,8 @@ HAS_PYVMOMI = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_obj +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_obj +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -553,7 +554,7 @@ def check_if_options_are_valid(self, target): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='list', elements='str', required=False), diff --git a/plugins/modules/vmware_host_sriov.py b/plugins/modules/vmware_host_sriov.py index 69e391f136..158db2d6d0 100644 --- a/plugins/modules/vmware_host_sriov.py +++ b/plugins/modules/vmware_host_sriov.py @@ -51,7 +51,7 @@ type: bool required: false extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -149,7 +149,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from time import sleep @@ -342,7 +343,7 @@ def _update_sriov(self, host, sriovEnabled, numVirtualFunction): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type="str", required=False), esxi_hostname=dict(type="str", required=False), diff --git a/plugins/modules/vmware_host_ssl_info.py b/plugins/modules/vmware_host_ssl_info.py index de3162d4be..accee10cff 100644 --- a/plugins/modules/vmware_host_ssl_info.py +++ b/plugins/modules/vmware_host_ssl_info.py @@ -31,7 +31,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -90,7 +90,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareHostSslManager(PyVmomi): @@ -118,7 +119,7 @@ def gather_ssl_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str'), esxi_hostname=dict(type='str'), diff --git a/plugins/modules/vmware_host_tcpip_stacks.py b/plugins/modules/vmware_host_tcpip_stacks.py index c772846d3a..5195b16e77 100644 --- a/plugins/modules/vmware_host_tcpip_stacks.py +++ b/plugins/modules/vmware_host_tcpip_stacks.py @@ -153,7 +153,7 @@ aliases: - nsx_overlay extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -292,7 +292,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_text -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareHostTcpipStack(PyVmomi): @@ -573,7 +574,7 @@ def execute(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type='str', required=True), default=dict(type='dict', diff --git a/plugins/modules/vmware_host_user_manager.py b/plugins/modules/vmware_host_user_manager.py index f2ebaf934e..1f660cefd9 100644 --- a/plugins/modules/vmware_host_user_manager.py +++ b/plugins/modules/vmware_host_user_manager.py @@ -56,7 +56,7 @@ - present - absent extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -114,7 +114,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_text -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareHostUserManager(PyVmomi): @@ -236,7 +237,7 @@ def execute(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( esxi_hostname=dict(type="str", required=True), user_name=dict(type="str", required=True, aliases=["local_user_name"]), diff --git a/plugins/modules/vmware_host_vmhba_info.py b/plugins/modules/vmware_host_vmhba_info.py index 178d806a8e..3d722a9cd9 100644 --- a/plugins/modules/vmware_host_vmhba_info.py +++ b/plugins/modules/vmware_host_vmhba_info.py @@ -33,7 +33,7 @@ - This parameter is required if O(esxi_hostname) is not specified. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -117,7 +117,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class HostVmhbaMgr(PyVmomi): @@ -199,7 +200,7 @@ def format_number(number): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_host_vmnic_info.py b/plugins/modules/vmware_host_vmnic_info.py index af6bfc6f91..491d782444 100644 --- a/plugins/modules/vmware_host_vmnic_info.py +++ b/plugins/modules/vmware_host_vmnic_info.py @@ -50,7 +50,7 @@ - This parameter is required if O(esxi_hostname) is not specified. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -162,7 +162,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class HostVmnicMgr(PyVmomi): @@ -319,7 +320,7 @@ def gather_host_vmnic_info(self): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_local_role_info.py b/plugins/modules/vmware_local_role_info.py index cc9b15f2fc..43b7b1e6de 100644 --- a/plugins/modules/vmware_local_role_info.py +++ b/plugins/modules/vmware_local_role_info.py @@ -21,7 +21,7 @@ - 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 +- community.vmware.base_options ''' @@ -82,7 +82,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareLocalRoleInfo(PyVmomi): @@ -119,7 +120,7 @@ def gather_local_role_info(self): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) diff --git a/plugins/modules/vmware_local_role_manager.py b/plugins/modules/vmware_local_role_manager.py index cebf4000ec..dfc5d7750c 100644 --- a/plugins/modules/vmware_local_role_manager.py +++ b/plugins/modules/vmware_local_role_manager.py @@ -56,7 +56,7 @@ choices: [ add, remove, set ] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -158,7 +158,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareLocalRoleManager(PyVmomi): @@ -381,7 +382,7 @@ def state_update_role(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict(local_role_name=dict(required=True, type='str'), local_privilege_ids=dict(default=[], type='list', elements='str'), force_remove=dict(default=False, type='bool'), diff --git a/plugins/modules/vmware_local_user_info.py b/plugins/modules/vmware_local_user_info.py index d5bf17e35a..a140c87ca6 100644 --- a/plugins/modules/vmware_local_user_info.py +++ b/plugins/modules/vmware_local_user_info.py @@ -21,7 +21,7 @@ - Abhijeet Kasurde (@Akasurde) - Christian Kotte (@ckotte) extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -66,7 +66,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -142,7 +143,7 @@ def get_role_name(role_id, role_list): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) diff --git a/plugins/modules/vmware_local_user_manager.py b/plugins/modules/vmware_local_user_manager.py index 065e8e0a04..42bb7b727a 100644 --- a/plugins/modules/vmware_local_user_manager.py +++ b/plugins/modules/vmware_local_user_manager.py @@ -43,7 +43,7 @@ default: present type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -66,7 +66,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareLocalUserManager(PyVmomi): @@ -163,7 +164,7 @@ def state_exit_unchanged(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict(local_user_name=dict(required=True, type='str'), local_user_password=dict(type='str', no_log=True), local_user_description=dict(type='str'), diff --git a/plugins/modules/vmware_maintenancemode.py b/plugins/modules/vmware_maintenancemode.py index faeda3a312..4ecac7c080 100644 --- a/plugins/modules/vmware_maintenancemode.py +++ b/plugins/modules/vmware_maintenancemode.py @@ -58,7 +58,7 @@ required: false type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -100,7 +100,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, TaskError, vmware_argument_spec, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, TaskError, wait_for_task +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -172,7 +173,7 @@ def ExitMaintenanceMode(self): def main(): - spec = vmware_argument_spec() + spec = base_argument_spec() spec.update(dict(esxi_hostname=dict(type='str', required=True), vsan=dict(type='str', choices=['ensureObjectAccessibility', diff --git a/plugins/modules/vmware_migrate_vmk.py b/plugins/modules/vmware_migrate_vmk.py index b50ba7f5d0..28014f5b7c 100644 --- a/plugins/modules/vmware_migrate_vmk.py +++ b/plugins/modules/vmware_migrate_vmk.py @@ -55,7 +55,7 @@ - Will be ignored when migrating from VSS to VDS type: int extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -81,8 +81,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - vmware_argument_spec, find_dvs_by_name, find_hostsystem_by_name, + find_dvs_by_name, find_hostsystem_by_name, connect_to_api, find_dvspg_by_name) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareMigrateVmk(object): @@ -207,7 +208,7 @@ def check_vmk_current_state(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict(esxi_hostname=dict(required=True, type='str'), device=dict(required=True, type='str'), current_switch_name=dict(required=True, type='str'), diff --git a/plugins/modules/vmware_object_custom_attributes_info.py b/plugins/modules/vmware_object_custom_attributes_info.py index 7d2fa00e50..3a7e40da39 100644 --- a/plugins/modules/vmware_object_custom_attributes_info.py +++ b/plugins/modules/vmware_object_custom_attributes_info.py @@ -46,7 +46,7 @@ - This is required if O(object_name) is not supplied. type: str extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options """ EXAMPLES = r""" @@ -105,7 +105,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_obj +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_obj +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareCustomAttributesInfo(PyVmomi): @@ -175,7 +176,7 @@ def execute(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( object_type=dict(type='str', required=True, choices=[ 'Datacenter', diff --git a/plugins/modules/vmware_object_role_permission.py b/plugins/modules/vmware_object_role_permission.py index f05a3a5ff5..20591b2d44 100644 --- a/plugins/modules/vmware_object_role_permission.py +++ b/plugins/modules/vmware_object_role_permission.py @@ -68,7 +68,7 @@ default: present type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -144,7 +144,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec, find_obj +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, find_obj +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareObjectRolePermission(PyVmomi): @@ -300,7 +301,7 @@ def get_object(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( role=dict(required=True, type='str'), diff --git a/plugins/modules/vmware_object_role_permission_info.py b/plugins/modules/vmware_object_role_permission_info.py index d6049ad7b5..f324ed0f2e 100644 --- a/plugins/modules/vmware_object_role_permission_info.py +++ b/plugins/modules/vmware_object_role_permission_info.py @@ -51,7 +51,7 @@ aliases: ['object_moid'] type: 'str' extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options """ EXAMPLES = r""" @@ -98,9 +98,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, find_obj, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareObjectRolePermission(PyVmomi): @@ -227,7 +227,7 @@ def get_object(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( principal=dict( diff --git a/plugins/modules/vmware_portgroup.py b/plugins/modules/vmware_portgroup.py index c4e569b87a..96f9c41c4c 100644 --- a/plugins/modules/vmware_portgroup.py +++ b/plugins/modules/vmware_portgroup.py @@ -139,7 +139,7 @@ default: present type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -263,7 +263,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -971,7 +972,7 @@ def create_nic_failure_policy(self): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( portgroup=dict(type='str', required=True, aliases=['portgroup_name']), switch=dict(type='str', required=True, aliases=['switch_name', 'vswitch']), diff --git a/plugins/modules/vmware_portgroup_info.py b/plugins/modules/vmware_portgroup_info.py index 6d3fa00ab1..a2d8bda19c 100644 --- a/plugins/modules/vmware_portgroup_info.py +++ b/plugins/modules/vmware_portgroup_info.py @@ -38,7 +38,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -98,7 +98,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class PortgroupInfoManager(PyVmomi): @@ -194,7 +195,7 @@ def gather_host_portgroup_info(self): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_recommended_datastore.py b/plugins/modules/vmware_recommended_datastore.py index 2bf9f30f54..3116222077 100644 --- a/plugins/modules/vmware_recommended_datastore.py +++ b/plugins/modules/vmware_recommended_datastore.py @@ -34,7 +34,7 @@ type: str required: true extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options """ @@ -64,8 +64,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareDatastoreClusterInfo(PyVmomi): @@ -94,7 +94,7 @@ def __init__(self, module): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type="str", required=True), datastore_cluster=dict(type="str", required=True), diff --git a/plugins/modules/vmware_resource_pool.py b/plugins/modules/vmware_resource_pool.py index 319542c544..6b468b6bdd 100644 --- a/plugins/modules/vmware_resource_pool.py +++ b/plugins/modules/vmware_resource_pool.py @@ -120,7 +120,7 @@ - 'absent' type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -197,8 +197,9 @@ HAS_PYVMOMI = False from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import get_all_objs, vmware_argument_spec, find_datacenter_by_name, \ +from ansible_collections.community.vmware.plugins.module_utils.vmware import get_all_objs, find_datacenter_by_name, \ find_cluster_by_name, find_object_by_name, wait_for_task, find_resource_pool_by_name, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule @@ -444,7 +445,7 @@ def check_rp_state(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict(datacenter=dict(required=True, type='str'), cluster=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_resource_pool_info.py b/plugins/modules/vmware_resource_pool_info.py index 82765a3b0e..3a4f71c7a8 100644 --- a/plugins/modules/vmware_resource_pool_info.py +++ b/plugins/modules/vmware_resource_pool_info.py @@ -18,7 +18,7 @@ author: - Abhijeet Kasurde (@Akasurde) extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -76,7 +76,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, get_all_objs +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class ResourcePoolInfoManager(PyVmomi): @@ -122,7 +123,7 @@ def gather_rp_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) vmware_rp_mgr = ResourcePoolInfoManager(module) diff --git a/plugins/modules/vmware_sdrs_vm_overrides_info.py b/plugins/modules/vmware_sdrs_vm_overrides_info.py index 38f72d683f..be6cdaf404 100644 --- a/plugins/modules/vmware_sdrs_vm_overrides_info.py +++ b/plugins/modules/vmware_sdrs_vm_overrides_info.py @@ -25,7 +25,7 @@ required: true type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options """ @@ -62,8 +62,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareDatastoreClusterManager(PyVmomi): @@ -98,7 +98,7 @@ def check_vm_overrides(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( datastore_cluster_name=dict(type="str", required=True), diff --git a/plugins/modules/vmware_target_canonical_info.py b/plugins/modules/vmware_target_canonical_info.py index 8ba7cfbbed..557a7dc164 100644 --- a/plugins/modules/vmware_target_canonical_info.py +++ b/plugins/modules/vmware_target_canonical_info.py @@ -39,7 +39,7 @@ - This parameter is required, if O(cluster_name) is not provided. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -104,7 +104,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class ScsiTargetInfoManager(PyVmomi): @@ -152,7 +153,7 @@ def gather_scsi_device_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( target_id=dict(required=False, type='int'), diff --git a/plugins/modules/vmware_vasa.py b/plugins/modules/vmware_vasa.py index 405cc795a8..67bc173802 100644 --- a/plugins/modules/vmware_vasa.py +++ b/plugins/modules/vmware_vasa.py @@ -54,7 +54,7 @@ seealso: - module: community.vmware.vmware_vasa_info extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -93,7 +93,7 @@ SMS, TaskError, wait_for_sms_task) -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -232,7 +232,7 @@ def check_vasa_configuration(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( vasa_name=dict(type='str', required=True), vasa_url=dict(type='str', required=True), diff --git a/plugins/modules/vmware_vasa_info.py b/plugins/modules/vmware_vasa_info.py index 5d182cf1b2..3c5dcb72aa 100644 --- a/plugins/modules/vmware_vasa_info.py +++ b/plugins/modules/vmware_vasa_info.py @@ -20,7 +20,7 @@ author: - Eugenio Grosso (@genegr) extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -63,7 +63,7 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware_sms import SMS -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class SMSClient(SMS): @@ -104,7 +104,7 @@ def get_vasa_provider_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) diff --git a/plugins/modules/vmware_vcenter_settings.py b/plugins/modules/vmware_vcenter_settings.py index eb7709f864..3c55567f3f 100644 --- a/plugins/modules/vmware_vcenter_settings.py +++ b/plugins/modules/vmware_vcenter_settings.py @@ -228,7 +228,7 @@ default: {} type: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -397,7 +397,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, option_diff, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, option_diff +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -858,7 +859,7 @@ def ensure(self): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( database=dict( type='dict', diff --git a/plugins/modules/vmware_vcenter_settings_info.py b/plugins/modules/vmware_vcenter_settings_info.py index 183a582446..dc30328bdd 100644 --- a/plugins/modules/vmware_vcenter_settings_info.py +++ b/plugins/modules/vmware_vcenter_settings_info.py @@ -37,7 +37,7 @@ type: list elements: str extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options """ EXAMPLES = r""" @@ -105,8 +105,8 @@ from ansible_collections.community.vmware.plugins.module_utils.vmware import ( PyVmomi, - vmware_argument_spec, ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils.basic import AnsibleModule @@ -193,7 +193,7 @@ def ensure(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( schema=dict(type="str", choices=["summary", "vsphere"], default="summary"), properties=dict(type="list", elements="str"), diff --git a/plugins/modules/vmware_vcenter_statistics.py b/plugins/modules/vmware_vcenter_statistics.py index ad3821d1c8..efecfae6b0 100644 --- a/plugins/modules/vmware_vcenter_statistics.py +++ b/plugins/modules/vmware_vcenter_statistics.py @@ -116,7 +116,7 @@ default: 1 type: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -177,7 +177,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -464,7 +465,7 @@ def update_perf_interval(self, perf_manager, statistic): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( interval_past_day=dict( type='dict', diff --git a/plugins/modules/vmware_vm_config_option.py b/plugins/modules/vmware_vm_config_option.py index 9201d27245..eee06fe64c 100644 --- a/plugins/modules/vmware_vm_config_option.py +++ b/plugins/modules/vmware_vm_config_option.py @@ -69,7 +69,7 @@ - The hardware version from the returned list when O(get_hardware_versions=true), e.g., 'vmx-19'. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -111,7 +111,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import find_obj, vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import find_obj, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vm_device_helper import PyVmomiDeviceHelper @@ -289,7 +290,7 @@ def get_config_option_for_guest(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(type='str', default='ha-datacenter'), cluster_name=dict(type='str'), diff --git a/plugins/modules/vmware_vm_host_drs_rule.py b/plugins/modules/vmware_vm_host_drs_rule.py index a63f5f5c28..4442ea22a8 100644 --- a/plugins/modules/vmware_vm_host_drs_rule.py +++ b/plugins/modules/vmware_vm_host_drs_rule.py @@ -16,7 +16,7 @@ description: - "This module can be used to create VM-Host rules in a given cluster." extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options module: vmware_vm_host_drs_rule options: @@ -106,8 +106,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - PyVmomi, vmware_argument_spec, wait_for_task, find_cluster_by_name, + PyVmomi, wait_for_task, find_cluster_by_name, find_datacenter_by_name) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareVmHostRuleDrs(PyVmomi): @@ -377,7 +378,7 @@ def delete(self, rule_name=None): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( state=dict(type='str', default='present', choices=['absent', 'present']), diff --git a/plugins/modules/vmware_vm_info.py b/plugins/modules/vmware_vm_info.py index 7e16e6009e..b2cc87dded 100644 --- a/plugins/modules/vmware_vm_info.py +++ b/plugins/modules/vmware_vm_info.py @@ -113,7 +113,7 @@ - Name of the virtual machine to get related configurations information from. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -289,7 +289,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, \ - get_all_objs, vmware_argument_spec, _get_vm_prop, get_parent_datacenter, find_vm_by_name + get_all_objs, _get_vm_prop, get_parent_datacenter, find_vm_by_name +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vmware_rest_client import VmwareRestClient @@ -449,7 +450,7 @@ def get_virtual_machines(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( vm_type=dict(type='str', choices=['vm', 'all', 'template'], default='all'), show_attribute=dict(type='bool', default='no'), diff --git a/plugins/modules/vmware_vm_shell.py b/plugins/modules/vmware_vm_shell.py index 89163e1399..91ff17aea0 100644 --- a/plugins/modules/vmware_vm_shell.py +++ b/plugins/modules/vmware_vm_shell.py @@ -103,7 +103,7 @@ default: 3600 type: int extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -199,8 +199,8 @@ from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - PyVmomi, find_cluster_by_name, find_datacenter_by_name, find_vm_by_id, - vmware_argument_spec) + PyVmomi, find_cluster_by_name, find_datacenter_by_name, find_vm_by_id) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareShellManager(PyVmomi): @@ -329,7 +329,7 @@ def wait_for_process(self, vm, pid, creds): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( datacenter=dict(type='str'), diff --git a/plugins/modules/vmware_vm_storage_policy.py b/plugins/modules/vmware_vm_storage_policy.py index 7f8eed0136..58858927db 100644 --- a/plugins/modules/vmware_vm_storage_policy.py +++ b/plugins/modules/vmware_vm_storage_policy.py @@ -62,7 +62,7 @@ choices: [ absent, present ] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -110,7 +110,7 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware_spbm import SPBM -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible_collections.community.vmware.plugins.module_utils.vmware_rest_client import VmwareRestClient @@ -341,7 +341,7 @@ def ensure_state(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( name=dict(type='str', required=True), description=dict(type='str', required=False), diff --git a/plugins/modules/vmware_vm_storage_policy_info.py b/plugins/modules/vmware_vm_storage_policy_info.py index 7f2873998a..4e893df9c7 100644 --- a/plugins/modules/vmware_vm_storage_policy_info.py +++ b/plugins/modules/vmware_vm_storage_policy_info.py @@ -21,7 +21,7 @@ author: - Abhijeet Kasurde (@Akasurde) extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -83,7 +83,7 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware_spbm import SPBM -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class SPBMClient(SPBM): @@ -149,7 +149,7 @@ def get_storage_policy_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) diff --git a/plugins/modules/vmware_vm_vm_drs_rule.py b/plugins/modules/vmware_vm_vm_drs_rule.py index e7e44cea16..f06bf88cf3 100644 --- a/plugins/modules/vmware_vm_vm_drs_rule.py +++ b/plugins/modules/vmware_vm_vm_drs_rule.py @@ -69,7 +69,7 @@ choices: [ present, absent ] type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -144,8 +144,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - PyVmomi, vmware_argument_spec, wait_for_task, + PyVmomi, wait_for_task, find_vm_by_id, find_cluster_by_name, find_datacenter_by_name) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmwareDrs(PyVmomi): @@ -367,7 +368,7 @@ def delete(self, rule_name=None): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( state=dict(type='str', default='present', choices=['absent', 'present']), vms=dict(type='list', elements='str'), diff --git a/plugins/modules/vmware_vm_vss_dvs_migrate.py b/plugins/modules/vmware_vm_vss_dvs_migrate.py index 8fd62553ed..fb74cc3ac4 100644 --- a/plugins/modules/vmware_vm_vss_dvs_migrate.py +++ b/plugins/modules/vmware_vm_vss_dvs_migrate.py @@ -29,7 +29,7 @@ required: true type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -53,7 +53,8 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( HAS_PYVMOMI, connect_to_api, get_all_objs, - vmware_argument_spec, wait_for_task) + wait_for_task) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareVmVssDvsMigrate(object): @@ -135,7 +136,7 @@ def check_vm_network_state(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict(vm_name=dict(required=True, type='str'), dvportgroup_name=dict(required=True, type='str'))) diff --git a/plugins/modules/vmware_vmkernel.py b/plugins/modules/vmware_vmkernel.py index 26dbe7b2ba..24713aea3f 100644 --- a/plugins/modules/vmware_vmkernel.py +++ b/plugins/modules/vmware_vmkernel.py @@ -161,7 +161,7 @@ required: true type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -281,9 +281,10 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - PyVmomi, TaskError, vmware_argument_spec, wait_for_task, + PyVmomi, TaskError, wait_for_task, find_dvspg_by_name, find_dvs_by_name, get_all_objs ) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -1090,7 +1091,7 @@ def get_api_net_stack_instance(tcpip_stack): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( esxi_hostname=dict(required=True, type='str'), portgroup_name=dict(required=True, type='str', aliases=['portgroup']), diff --git a/plugins/modules/vmware_vmkernel_info.py b/plugins/modules/vmware_vmkernel_info.py index 9638397dcd..2e57ce74f5 100644 --- a/plugins/modules/vmware_vmkernel_info.py +++ b/plugins/modules/vmware_vmkernel_info.py @@ -31,7 +31,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -89,7 +89,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -173,7 +174,7 @@ def gather_host_vmk_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vmware_vmotion.py b/plugins/modules/vmware_vmotion.py index 7866849251..7d9bafa0d2 100644 --- a/plugins/modules/vmware_vmotion.py +++ b/plugins/modules/vmware_vmotion.py @@ -84,7 +84,7 @@ default: 3600 version_added: '3.4.0' extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -177,7 +177,8 @@ find_resource_pool_by_name, find_datacenter_by_name, find_cluster_by_name, get_all_objs, - vmware_argument_spec, wait_for_task, TaskError) + wait_for_task, TaskError) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VmotionManager(PyVmomi): @@ -523,7 +524,7 @@ def get_vm(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( dict( vm_name=dict(aliases=['vm']), diff --git a/plugins/modules/vmware_vsan_cluster.py b/plugins/modules/vmware_vsan_cluster.py index 451f801d57..ae6e0781d3 100644 --- a/plugins/modules/vmware_vsan_cluster.py +++ b/plugins/modules/vmware_vsan_cluster.py @@ -24,7 +24,7 @@ required: false type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -60,8 +60,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - HAS_PYVMOMI, connect_to_api, get_all_objs, vmware_argument_spec, + HAS_PYVMOMI, connect_to_api, get_all_objs, wait_for_task) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec def create_vsan_cluster(host_system, new_cluster_uuid): @@ -89,7 +90,7 @@ def create_vsan_cluster(host_system, new_cluster_uuid): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict(cluster_uuid=dict(required=False, type='str'))) module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=False) diff --git a/plugins/modules/vmware_vsan_hcl_db.py b/plugins/modules/vmware_vsan_hcl_db.py index 6f0100330c..625a4bc488 100644 --- a/plugins/modules/vmware_vsan_hcl_db.py +++ b/plugins/modules/vmware_vsan_hcl_db.py @@ -29,7 +29,7 @@ type: str required: true extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -65,7 +65,8 @@ HAS_VSANPYTHONSDK = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VsanApi(PyVmomi): @@ -85,7 +86,7 @@ def upload_hcl_db(self, content): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( source=dict(type='str', required=True) diff --git a/plugins/modules/vmware_vsan_health_info.py b/plugins/modules/vmware_vsan_health_info.py index 7a6b687357..6bb6b07ad3 100644 --- a/plugins/modules/vmware_vsan_health_info.py +++ b/plugins/modules/vmware_vsan_health_info.py @@ -35,7 +35,7 @@ requirements: - VMware vSAN Python's SDK extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options author: - Erwan Quelin (@equelin) ''' @@ -121,7 +121,8 @@ HAS_VSANPYTHONSDK = False from ansible.module_utils.basic import AnsibleModule, missing_required_lib -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VSANInfoManager(PyVmomi): @@ -169,7 +170,7 @@ def gather_info(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( datacenter=dict(required=False, type='str', aliases=['datacenter_name']), cluster_name=dict(required=True, type='str'), diff --git a/plugins/modules/vmware_vsan_release_catalog.py b/plugins/modules/vmware_vsan_release_catalog.py index 14a464f2e7..b9db1ff632 100644 --- a/plugins/modules/vmware_vsan_release_catalog.py +++ b/plugins/modules/vmware_vsan_release_catalog.py @@ -29,7 +29,7 @@ type: str required: true extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -56,7 +56,8 @@ HAS_VSANPYTHONSDK = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VsanApi(PyVmomi): @@ -74,7 +75,7 @@ def upload_release_catalog(self, content): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( source=dict(type='str', required=True) diff --git a/plugins/modules/vmware_vspan_session.py b/plugins/modules/vmware_vspan_session.py index d69830f8dc..5ffef65004 100644 --- a/plugins/modules/vmware_vspan_session.py +++ b/plugins/modules/vmware_vspan_session.py @@ -161,7 +161,7 @@ required: false type: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -217,8 +217,9 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.vmware.plugins.module_utils.vmware import ( - vmware_argument_spec, PyVmomi, find_dvs_by_name, + PyVmomi, find_dvs_by_name, find_vm_by_name, wait_for_task) +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VMwareVspanSession(PyVmomi): @@ -613,7 +614,7 @@ def add_vspan_session(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( switch=dict(type='str', required=True, aliases=['switch_name']), name=dict(type='str', required=True), diff --git a/plugins/modules/vmware_vswitch.py b/plugins/modules/vmware_vswitch.py index 619eb5af7b..483344ba31 100644 --- a/plugins/modules/vmware_vswitch.py +++ b/plugins/modules/vmware_vswitch.py @@ -129,7 +129,7 @@ required: false type: dict extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -248,7 +248,8 @@ pass from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec from ansible.module_utils._text import to_native @@ -735,7 +736,7 @@ def update_traffic_shaping_policy(self, spec, results): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( switch=dict(type='str', required=True, aliases=['switch_name']), nics=dict(type='list', aliases=['nic_name'], default=[], elements='str'), diff --git a/plugins/modules/vmware_vswitch_info.py b/plugins/modules/vmware_vswitch_info.py index ff21a7958e..020b9e4d29 100644 --- a/plugins/modules/vmware_vswitch_info.py +++ b/plugins/modules/vmware_vswitch_info.py @@ -39,7 +39,7 @@ - If O(cluster_name) is not given, this parameter is required. type: str extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -106,7 +106,8 @@ ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec, PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VswitchInfoManager(PyVmomi): @@ -183,7 +184,7 @@ def gather_vswitch_info(self): def main(): """Main""" - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update( cluster_name=dict(type='str', required=False), esxi_hostname=dict(type='str', required=False), diff --git a/plugins/modules/vsan_health_silent_checks.py b/plugins/modules/vsan_health_silent_checks.py index eaa6b240a7..d8f7a53043 100644 --- a/plugins/modules/vsan_health_silent_checks.py +++ b/plugins/modules/vsan_health_silent_checks.py @@ -43,7 +43,7 @@ choices: [ 'present', 'absent' ] type: str extends_documentation_fragment: - - community.vmware.vmware.documentation + - community.vmware.base_options ''' EXAMPLES = r''' @@ -84,7 +84,8 @@ HAS_VSANPYTHONSDK = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi, vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware import PyVmomi +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec class VsanApi(PyVmomi): @@ -127,7 +128,7 @@ def process_state(self): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( checks=dict(type='list', elements='str', required=False), diff --git a/plugins/modules/vsphere_copy.py b/plugins/modules/vsphere_copy.py index 670a8e86a8..87206026e3 100644 --- a/plugins/modules/vsphere_copy.py +++ b/plugins/modules/vsphere_copy.py @@ -58,7 +58,7 @@ - "This module ought to be run from a system that can access the vCenter or the ESXi directly and has the file to transfer. It can be the normal remote target or you can change it either by using C(transport: local) or using C(delegate_to)." extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' @@ -121,7 +121,7 @@ from ansible.module_utils.six.moves.urllib.parse import urlencode, quote from ansible.module_utils._text import to_native from ansible.module_utils.urls import open_url -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec def vmware_path(datastore, datacenter, path, diskformat): @@ -142,7 +142,7 @@ def vmware_path(datastore, datacenter, path, diskformat): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( src=dict(required=True, aliases=['name']), datacenter=dict(required=False), diff --git a/plugins/modules/vsphere_file.py b/plugins/modules/vsphere_file.py index 42ddc9b61a..eb06116a38 100644 --- a/plugins/modules/vsphere_file.py +++ b/plugins/modules/vsphere_file.py @@ -52,7 +52,7 @@ notes: - The vSphere folder API does not allow to remove directory objects. extends_documentation_fragment: -- community.vmware.vmware.documentation +- community.vmware.base_options ''' EXAMPLES = r''' @@ -114,7 +114,7 @@ from ansible.module_utils.six.moves.urllib.parse import quote, urlencode from ansible.module_utils.urls import open_url from ansible.module_utils._text import to_native -from ansible_collections.community.vmware.plugins.module_utils.vmware import vmware_argument_spec +from ansible_collections.community.vmware.plugins.module_utils.vmware_argument_spec import base_argument_spec def vmware_path(datastore, datacenter, path): @@ -133,7 +133,7 @@ def vmware_path(datastore, datacenter, path): def main(): - argument_spec = vmware_argument_spec() + argument_spec = base_argument_spec() argument_spec.update(dict( datacenter=dict(type='str', required=True),