From dd83f688b01e9709050dec66928c410c54ab34b4 Mon Sep 17 00:00:00 2001 From: Mario Lenz Date: Sat, 4 Nov 2023 12:32:04 +0000 Subject: [PATCH] 20231104 Re-generate modules with ansible.content_builder --- changelogs/fragments/regenerate_modules.yaml | 3 + .../modules/appliance_access_consolecli.py | 26 +- .../appliance_access_consolecli_info.py | 25 +- plugins/modules/appliance_access_dcui.py | 26 +- plugins/modules/appliance_access_dcui_info.py | 25 +- plugins/modules/appliance_access_shell.py | 35 +- .../modules/appliance_access_shell_info.py | 28 +- plugins/modules/appliance_access_ssh.py | 27 +- plugins/modules/appliance_access_ssh_info.py | 26 +- .../modules/appliance_health_applmgmt_info.py | 26 +- .../modules/appliance_health_database_info.py | 20 +- .../appliance_health_databasestorage_info.py | 26 +- plugins/modules/appliance_health_load_info.py | 26 +- plugins/modules/appliance_health_mem_info.py | 26 +- .../appliance_health_softwarepackages_info.py | 26 +- .../modules/appliance_health_storage_info.py | 26 +- plugins/modules/appliance_health_swap_info.py | 26 +- .../modules/appliance_health_system_info.py | 26 +- .../modules/appliance_infraprofile_configs.py | 40 +- .../appliance_infraprofile_configs_info.py | 32 +- .../appliance_localaccounts_globalpolicy.py | 26 +- ...pliance_localaccounts_globalpolicy_info.py | 29 +- .../modules/appliance_localaccounts_info.py | 54 +- plugins/modules/appliance_monitoring_info.py | 848 +--------------- plugins/modules/appliance_monitoring_query.py | 51 +- plugins/modules/appliance_networking.py | 32 +- .../appliance_networking_dns_domains.py | 34 +- .../appliance_networking_dns_domains_info.py | 26 +- .../appliance_networking_dns_hostname.py | 34 +- .../appliance_networking_dns_hostname_info.py | 26 +- .../appliance_networking_dns_servers.py | 57 +- .../appliance_networking_dns_servers_info.py | 29 +- .../appliance_networking_firewall_inbound.py | 42 +- ...liance_networking_firewall_inbound_info.py | 26 +- plugins/modules/appliance_networking_info.py | 53 +- .../appliance_networking_interfaces_info.py | 55 +- .../appliance_networking_interfaces_ipv4.py | 39 +- ...pliance_networking_interfaces_ipv4_info.py | 32 +- .../appliance_networking_interfaces_ipv6.py | 36 +- ...pliance_networking_interfaces_ipv6_info.py | 36 +- .../modules/appliance_networking_noproxy.py | 34 +- .../appliance_networking_noproxy_info.py | 28 +- plugins/modules/appliance_networking_proxy.py | 46 +- .../appliance_networking_proxy_info.py | 38 +- plugins/modules/appliance_ntp.py | 42 +- plugins/modules/appliance_ntp_info.py | 30 +- plugins/modules/appliance_services.py | 44 +- plugins/modules/appliance_services_info.py | 34 +- plugins/modules/appliance_shutdown.py | 50 +- plugins/modules/appliance_shutdown_info.py | 33 +- .../modules/appliance_system_globalfips.py | 17 +- .../appliance_system_globalfips_info.py | 17 +- plugins/modules/appliance_system_storage.py | 36 +- .../modules/appliance_system_storage_info.py | 26 +- plugins/modules/appliance_system_time_info.py | 30 +- .../modules/appliance_system_time_timezone.py | 27 +- .../appliance_system_time_timezone_info.py | 26 +- .../modules/appliance_system_version_info.py | 33 +- plugins/modules/appliance_timesync.py | 26 +- plugins/modules/appliance_timesync_info.py | 26 +- plugins/modules/appliance_update_info.py | 28 +- plugins/modules/appliance_vmon_service.py | 41 +- .../modules/appliance_vmon_service_info.py | 406 +------- plugins/modules/content_configuration.py | 35 +- plugins/modules/content_configuration_info.py | 30 +- plugins/modules/content_library_item_info.py | 109 +- plugins/modules/content_locallibrary.py | 951 +----------------- plugins/modules/content_locallibrary_info.py | 253 +---- plugins/modules/content_subscribedlibrary.py | 171 +--- .../modules/content_subscribedlibrary_info.py | 43 +- plugins/modules/vcenter_cluster_info.py | 38 +- plugins/modules/vcenter_datacenter.py | 71 +- plugins/modules/vcenter_datacenter_info.py | 32 +- plugins/modules/vcenter_datastore_info.py | 41 +- plugins/modules/vcenter_folder_info.py | 37 +- plugins/modules/vcenter_host.py | 36 +- plugins/modules/vcenter_host_info.py | 30 +- plugins/modules/vcenter_network_info.py | 40 +- plugins/modules/vcenter_ovf_libraryitem.py | 112 +-- plugins/modules/vcenter_resourcepool.py | 102 +- plugins/modules/vcenter_resourcepool_info.py | 61 +- .../modules/vcenter_storage_policies_info.py | 62 +- plugins/modules/vcenter_vm.py | 294 +----- .../modules/vcenter_vm_guest_customization.py | 44 +- ...vcenter_vm_guest_filesystem_directories.py | 78 +- .../modules/vcenter_vm_guest_identity_info.py | 45 +- .../vcenter_vm_guest_localfilesystem_info.py | 46 +- .../vcenter_vm_guest_networking_info.py | 46 +- ...ter_vm_guest_networking_interfaces_info.py | 42 +- ...vcenter_vm_guest_networking_routes_info.py | 38 +- .../vcenter_vm_guest_operations_info.py | 17 +- plugins/modules/vcenter_vm_guest_power.py | 62 +- .../modules/vcenter_vm_guest_power_info.py | 61 +- plugins/modules/vcenter_vm_hardware.py | 36 +- .../vcenter_vm_hardware_adapter_sata.py | 55 +- .../vcenter_vm_hardware_adapter_sata_info.py | 51 +- .../vcenter_vm_hardware_adapter_scsi.py | 71 +- .../vcenter_vm_hardware_adapter_scsi_info.py | 39 +- plugins/modules/vcenter_vm_hardware_boot.py | 45 +- .../vcenter_vm_hardware_boot_device.py | 40 +- .../vcenter_vm_hardware_boot_device_info.py | 44 +- .../modules/vcenter_vm_hardware_boot_info.py | 42 +- plugins/modules/vcenter_vm_hardware_cdrom.py | 82 +- .../modules/vcenter_vm_hardware_cdrom_info.py | 38 +- plugins/modules/vcenter_vm_hardware_cpu.py | 48 +- .../modules/vcenter_vm_hardware_cpu_info.py | 42 +- plugins/modules/vcenter_vm_hardware_disk.py | 74 +- .../modules/vcenter_vm_hardware_disk_info.py | 58 +- .../modules/vcenter_vm_hardware_ethernet.py | 135 +-- .../vcenter_vm_hardware_ethernet_info.py | 43 +- plugins/modules/vcenter_vm_hardware_floppy.py | 73 +- .../vcenter_vm_hardware_floppy_info.py | 38 +- plugins/modules/vcenter_vm_hardware_info.py | 36 +- plugins/modules/vcenter_vm_hardware_memory.py | 44 +- .../vcenter_vm_hardware_memory_info.py | 40 +- .../modules/vcenter_vm_hardware_parallel.py | 66 +- .../vcenter_vm_hardware_parallel_info.py | 38 +- plugins/modules/vcenter_vm_hardware_serial.py | 102 +- .../vcenter_vm_hardware_serial_info.py | 58 +- plugins/modules/vcenter_vm_info.py | 175 +--- .../modules/vcenter_vm_libraryitem_info.py | 38 +- plugins/modules/vcenter_vm_power.py | 151 +-- plugins/modules/vcenter_vm_power_info.py | 39 +- plugins/modules/vcenter_vm_storage_policy.py | 50 +- .../vcenter_vm_storage_policy_compliance.py | 17 +- ...enter_vm_storage_policy_compliance_info.py | 45 +- .../modules/vcenter_vm_storage_policy_info.py | 39 +- plugins/modules/vcenter_vm_tools.py | 71 +- plugins/modules/vcenter_vm_tools_info.py | 104 +- plugins/modules/vcenter_vm_tools_installer.py | 62 +- .../vcenter_vm_tools_installer_info.py | 60 +- .../vcenter_vmtemplate_libraryitems.py | 128 +-- .../vcenter_vmtemplate_libraryitems_info.py | 17 +- 133 files changed, 1327 insertions(+), 7338 deletions(-) create mode 100644 changelogs/fragments/regenerate_modules.yaml diff --git a/changelogs/fragments/regenerate_modules.yaml b/changelogs/fragments/regenerate_modules.yaml new file mode 100644 index 000000000..ea227c43f --- /dev/null +++ b/changelogs/fragments/regenerate_modules.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: +- "Re-generate modules with ansible.content_builder." diff --git a/plugins/modules/appliance_access_consolecli.py b/plugins/modules/appliance_access_consolecli.py index 3fd8927f6..70e0dcaff 100644 --- a/plugins/modules/appliance_access_consolecli.py +++ b/plugins/modules/appliance_access_consolecli.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -73,7 +70,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -83,18 +80,9 @@ """ EXAMPLES = r""" -- name: Disable the Console CLI - vmware.vmware_rest.appliance_access_consolecli: - enabled: false """ RETURN = r""" -# content generated by the update_return_section callback# task: Disable the Console CLI -value: - description: Disable the Console CLI - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -129,10 +117,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_access_consolecli_info.py b/plugins/modules/appliance_access_consolecli_info.py index ff565ea37..dbb0f33f1 100644 --- a/plugins/modules/appliance_access_consolecli_info.py +++ b/plugins/modules/appliance_access_consolecli_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,17 +69,9 @@ """ EXAMPLES = r""" -- name: Check if the Console CLI is enabled - vmware.vmware_rest.appliance_access_consolecli_info: """ RETURN = r""" -# content generated by the update_return_section callback# task: Check if the Console CLI is enabled -value: - description: Check if the Console CLI is enabled - returned: On success - sample: 1 - type: int """ # This structure describes the format of the data expected by the end-points @@ -114,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_access_dcui.py b/plugins/modules/appliance_access_dcui.py index f6d1f57db..459b5287a 100644 --- a/plugins/modules/appliance_access_dcui.py +++ b/plugins/modules/appliance_access_dcui.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -73,7 +70,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -83,18 +80,9 @@ """ EXAMPLES = r""" -- name: Disable the Direct Console User Interface - vmware.vmware_rest.appliance_access_dcui: - enabled: false """ RETURN = r""" -# content generated by the update_return_section callback# task: Disable the Direct Console User Interface -value: - description: Disable the Direct Console User Interface - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -129,10 +117,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_access_dcui_info.py b/plugins/modules/appliance_access_dcui_info.py index ddb12298b..7f01d0c5f 100644 --- a/plugins/modules/appliance_access_dcui_info.py +++ b/plugins/modules/appliance_access_dcui_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,17 +69,9 @@ """ EXAMPLES = r""" -- name: Check if the Direct Console User Interface is enabled - vmware.vmware_rest.appliance_access_dcui_info: """ RETURN = r""" -# content generated by the update_return_section callback# task: Check if the Direct Console User Interface is enabled -value: - description: Check if the Direct Console User Interface is enabled - returned: On success - sample: 1 - type: int """ # This structure describes the format of the data expected by the end-points @@ -114,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_access_shell.py b/plugins/modules/appliance_access_shell.py index a0170df0a..4d7993b5f 100644 --- a/plugins/modules/appliance_access_shell.py +++ b/plugins/modules/appliance_access_shell.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -81,7 +78,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -91,27 +88,9 @@ """ EXAMPLES = r""" -- name: Disable the Shell - vmware.vmware_rest.appliance_access_shell: - enabled: false - timeout: 600 - -- name: Enable the Shell with a timeout - vmware.vmware_rest.appliance_access_shell: - enabled: true - timeout: 600 - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Disable the Shell -value: - description: Disable the Shell - returned: On success - sample: - enabled: 0 - timeout: 0 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -150,10 +129,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_access_shell_info.py b/plugins/modules/appliance_access_shell_info.py index 6616da852..7f6a87d0b 100644 --- a/plugins/modules/appliance_access_shell_info.py +++ b/plugins/modules/appliance_access_shell_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -64,7 +61,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -74,20 +71,9 @@ """ EXAMPLES = r""" -- name: Check if the Shell is enabled - vmware.vmware_rest.appliance_access_shell_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Check if the Shell is enabled -value: - description: Check if the Shell is enabled - returned: On success - sample: - enabled: 0 - timeout: 0 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -119,10 +105,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_access_ssh.py b/plugins/modules/appliance_access_ssh.py index b89de79a9..2d4c06a10 100644 --- a/plugins/modules/appliance_access_ssh.py +++ b/plugins/modules/appliance_access_ssh.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -73,7 +70,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -83,19 +80,9 @@ """ EXAMPLES = r""" -- name: Ensure the SSH access ie enabled - vmware.vmware_rest.appliance_access_ssh: - enabled: true - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Ensure the SSH access ie enabled -value: - description: Ensure the SSH access ie enabled - returned: On success - sample: 1 - type: int """ # This structure describes the format of the data expected by the end-points @@ -130,10 +117,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_access_ssh_info.py b/plugins/modules/appliance_access_ssh_info.py index 7deb049d7..5f7dc8950 100644 --- a/plugins/modules/appliance_access_ssh_info.py +++ b/plugins/modules/appliance_access_ssh_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Check is the SSH access is enabled - vmware.vmware_rest.appliance_access_ssh_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Check is the SSH access is enabled -value: - description: Check is the SSH access is enabled - returned: On success - sample: 1 - type: int """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_health_applmgmt_info.py b/plugins/modules/appliance_health_applmgmt_info.py index dea883a42..1d2c55044 100644 --- a/plugins/modules/appliance_health_applmgmt_info.py +++ b/plugins/modules/appliance_health_applmgmt_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the health state of applmgmt - vmware.vmware_rest.appliance_health_applmgmt_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the health state of applmgmt -value: - description: Get the health state of applmgmt - returned: On success - sample: green - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_health_database_info.py b/plugins/modules/appliance_health_database_info.py index 926e501a0..a90ea7a4f 100644 --- a/plugins/modules/appliance_health_database_info.py +++ b/plugins/modules/appliance_health_database_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,9 +69,6 @@ """ EXAMPLES = r""" -- name: Get the database heath status - vmware.vmware_rest.appliance_health_database_info: - register: result """ RETURN = r""" @@ -109,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_health_databasestorage_info.py b/plugins/modules/appliance_health_databasestorage_info.py index 15dae4349..4e0f4adb7 100644 --- a/plugins/modules/appliance_health_databasestorage_info.py +++ b/plugins/modules/appliance_health_databasestorage_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the database storage heath status - vmware.vmware_rest.appliance_health_databasestorage_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the database storage heath status -value: - description: Get the database storage heath status - returned: On success - sample: green - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_health_load_info.py b/plugins/modules/appliance_health_load_info.py index 4c9663e6c..5720f3871 100644 --- a/plugins/modules/appliance_health_load_info.py +++ b/plugins/modules/appliance_health_load_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the system load status - vmware.vmware_rest.appliance_health_load_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the system load status -value: - description: Get the system load status - returned: On success - sample: green - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_health_mem_info.py b/plugins/modules/appliance_health_mem_info.py index 403306cef..0aa18fbec 100644 --- a/plugins/modules/appliance_health_mem_info.py +++ b/plugins/modules/appliance_health_mem_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the system mem status - vmware.vmware_rest.appliance_health_mem_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the system mem status -value: - description: Get the system mem status - returned: On success - sample: green - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_health_softwarepackages_info.py b/plugins/modules/appliance_health_softwarepackages_info.py index d544c0645..85092a4f7 100644 --- a/plugins/modules/appliance_health_softwarepackages_info.py +++ b/plugins/modules/appliance_health_softwarepackages_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -67,7 +64,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -77,18 +74,9 @@ """ EXAMPLES = r""" -- name: Get the health of the software package manager - vmware.vmware_rest.appliance_health_softwarepackages_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the health of the software package manager -value: - description: Get the health of the software package manager - returned: On success - sample: green - type: str """ # This structure describes the format of the data expected by the end-points @@ -120,10 +108,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_health_storage_info.py b/plugins/modules/appliance_health_storage_info.py index 9543df0b0..8edb9864d 100644 --- a/plugins/modules/appliance_health_storage_info.py +++ b/plugins/modules/appliance_health_storage_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the health of the storage system - vmware.vmware_rest.appliance_health_storage_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the health of the storage system -value: - description: Get the health of the storage system - returned: On success - sample: green - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_health_swap_info.py b/plugins/modules/appliance_health_swap_info.py index 9c35a5a94..a334bba37 100644 --- a/plugins/modules/appliance_health_swap_info.py +++ b/plugins/modules/appliance_health_swap_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the health of the swap - vmware.vmware_rest.appliance_health_swap_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the health of the swap -value: - description: Get the health of the swap - returned: On success - sample: green - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_health_system_info.py b/plugins/modules/appliance_health_system_info.py index 81c00f0c6..7a8f2118f 100644 --- a/plugins/modules/appliance_health_system_info.py +++ b/plugins/modules/appliance_health_system_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the system health status - vmware.vmware_rest.appliance_health_system_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the system health status -value: - description: Get the system health status - returned: On success - sample: green - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_infraprofile_configs.py b/plugins/modules/appliance_infraprofile_configs.py index 5f7ec0e27..e0ab2d727 100644 --- a/plugins/modules/appliance_infraprofile_configs.py +++ b/plugins/modules/appliance_infraprofile_configs.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -86,7 +83,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -96,32 +93,9 @@ """ EXAMPLES = r""" -- name: Export the ApplianceManagement profile - vmware.vmware_rest.appliance_infraprofile_configs: - state: export - profiles: - - ApplianceManagement - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Export the ApplianceManagement profile -value: - description: Export the ApplianceManagement profile - returned: On success - sample: '{"action":"RESTART_SERVICE","productName":"VMware vCenter Server","creationTime":"2022-11-23T20:11:00+0000","version":"7.0.3.00800","profiles":{"ApplianceManagement":{"action":"RESTART_SERVICE","actionOn":{"VC_SERVICES":["applmgmt"],"SYSTEMD":["sendmail","rsyslog"]},"description":"Appliance - Mangment Service","version":"7.0","config":{"/etc/applmgmt/appliance/appliance.conf":{"Is - shell Enabled":true,"Shell Expiration Time":9,"TimeSync Mode (Host/NTP)":"NTP"},"/etc/ntp.conf":{"Time - servers":"time.nist.gov"},"/etc/shadow":{"root":{"maximumDays":"90","warningDays":"7"},"bin":{"maximumDays":"90","warningDays":"7"},"daemon":{"maximumDays":"90","warningDays":"7"},"messagebus":{"maximumDays":"90","warningDays":"7"},"systemd-bus-proxy":{"maximumDays":"90","warningDays":"7"},"systemd-journal-gateway":{"maximumDays":"90","warningDays":"7"},"systemd-journal-remote":{"maximumDays":"90","warningDays":"7"},"systemd-journal-upload":{"maximumDays":"90","warningDays":"7"},"systemd-network":{"maximumDays":"90","warningDays":"7"},"systemd-resolve":{"maximumDays":"90","warningDays":"7"},"systemd-timesync":{"maximumDays":"90","warningDays":"7"},"nobody":{"maximumDays":"90","warningDays":"7"},"rpc":{"maximumDays":"90","warningDays":"7"},"sshd":{"maximumDays":"90","warningDays":"7"},"ntp":{"maximumDays":"90","warningDays":"7"},"smmsp":{"maximumDays":"90","warningDays":"7"},"apache":{"maximumDays":"90","warningDays":"7"},"tftp":{"maximumDays":"","warningDays":""},"named":{"maximumDays":"","warningDays":""},"vmdird":{"maximumDays":"90","warningDays":"7"},"sso-user":{"maximumDays":"90","warningDays":"7"},"dnsmasq":{"maximumDays":"","warningDays":""},"observability":{"maximumDays":"","warningDays":""},"vdtc":{"maximumDays":"","warningDays":""},"vmafdd-user":{"maximumDays":"90","warningDays":"7"},"vmcad-user":{"maximumDays":"90","warningDays":"7"},"pod":{"maximumDays":"","warningDays":""},"vmonapi":{"maximumDays":"","warningDays":""},"envoy":{"maximumDays":"","warningDays":""},"vpostgres":{"maximumDays":"","warningDays":"7"},"lookupsvc":{"maximumDays":"","warningDays":""},"cis-license":{"maximumDays":"","warningDays":""},"pschealth":{"maximumDays":"","warningDays":""},"netdumper":{"maximumDays":"","warningDays":""},"vapiEndpoint":{"maximumDays":"90","warningDays":"7"},"vpxd-svcs":{"maximumDays":"","warningDays":""},"certauth":{"maximumDays":"90","warningDays":"7"},"certmgr":{"maximumDays":"90","warningDays":"7"},"infraprofile":{"maximumDays":"","warningDays":""},"topologysvc":{"maximumDays":"90","warningDays":"7"},"trustmanagement":{"maximumDays":"","warningDays":""},"vpxd":{"maximumDays":"","warningDays":""},"analytics":{"maximumDays":"","warningDays":""},"eam":{"maximumDays":"90","warningDays":"7"},"sps":{"maximumDays":"","warningDays":""},"deploy":{"maximumDays":"","warningDays":""},"updatemgr":{"maximumDays":"","warningDays":""},"vlcm":{"maximumDays":"90","warningDays":"7"},"vmcam":{"maximumDays":"90","warningDays":"7"},"vsan-health":{"maximumDays":"90","warningDays":"7"},"vsm":{"maximumDays":"90","warningDays":"7"},"vsphere-ui":{"maximumDays":"90","warningDays":"7"},"vtsdbuser":{"maximumDays":"","warningDays":""},"vstatsuser":{"maximumDays":"","warningDays":""},"wcp":{"maximumDays":"","warningDays":"7"},"content-library":{"maximumDays":"90","warningDays":"7"},"imagebuilder":{"maximumDays":"90","warningDays":"7"},"perfcharts":{"maximumDays":"90","warningDays":"7"},"vpgmonusr":{"maximumDays":"","warningDays":"7"},"vtsdbmonusr":{"maximumDays":"","warningDays":"7"},"zuul":{"maximumDays":"90","warningDays":"7"},"Send - Waring before this No of Days.":null,"Password validity (days)":null},"/etc/sysconfig/clock":{"Time - zone":"\"Etc/UTC\"","UTC":"1"},"/usr/bin/systemctl/sshd.service":{"Enable SSH":"true"},"/etc/mail/sendmail.cf":{"SMTP - Port":null,"Mail server":null},"/etc/vmware-syslog/syslog.conf":{"Port [2]":null,"Port - [1]":null,"Port [0]":null,"Protocol [2]":null,"Remote Syslog Host [1]":null,"Protocol - [1]":null,"Remote Syslog Host [0]":null,"Protocol [0]":null,"Remote Syslog Host - [2]":null},"/etc/pam.d/system-auth":{"Deny Login after these many Unsuccessful - Attempts.":null,"Unlock root after (seconds)":null,"On Error Login will be.":null,"Include - Root user for SSH lockout.":null,"Unlock user after (seconds)":null}},"name":"ApplianceManagement"}}}' - type: str """ # This structure describes the format of the data expected by the end-points @@ -164,10 +138,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_infraprofile_configs_info.py b/plugins/modules/appliance_infraprofile_configs_info.py index 6102f5e2d..44c6af92d 100644 --- a/plugins/modules/appliance_infraprofile_configs_info.py +++ b/plugins/modules/appliance_infraprofile_configs_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,24 +69,9 @@ """ EXAMPLES = r""" -- name: List infraprofile configs - vmware.vmware_rest.appliance_infraprofile_configs_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: List infraprofile configs -value: - description: List infraprofile configs - returned: On success - sample: - - info: ApplianceManagement - name: ApplianceManagement - - info: ApplianceNetwork - name: ApplianceNetwork - - info: Authentication & Authorization Management - name: AuthManagement - type: list """ # This structure describes the format of the data expected by the end-points @@ -121,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_localaccounts_globalpolicy.py b/plugins/modules/appliance_localaccounts_globalpolicy.py index 2d6176d76..851cbc667 100644 --- a/plugins/modules/appliance_localaccounts_globalpolicy.py +++ b/plugins/modules/appliance_localaccounts_globalpolicy.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -83,7 +80,7 @@ type: int author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -93,18 +90,9 @@ """ EXAMPLES = r""" -- name: Update the global policy of the local accounts - vmware.vmware_rest.appliance_localaccounts_globalpolicy: - warn_days: 5 """ RETURN = r""" -# content generated by the update_return_section callback# task: Update the global policy of the local accounts -value: - description: Update the global policy of the local accounts - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -147,10 +135,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_localaccounts_globalpolicy_info.py b/plugins/modules/appliance_localaccounts_globalpolicy_info.py index 2a9076571..110ede731 100644 --- a/plugins/modules/appliance_localaccounts_globalpolicy_info.py +++ b/plugins/modules/appliance_localaccounts_globalpolicy_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,21 +69,9 @@ """ EXAMPLES = r""" -- name: Get the global policy of the local accounts - vmware.vmware_rest.appliance_localaccounts_globalpolicy_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the global policy of the local accounts -value: - description: Get the global policy of the local accounts - returned: On success - sample: - max_days: 90 - min_days: 1 - warn_days: 7 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -118,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_localaccounts_info.py b/plugins/modules/appliance_localaccounts_info.py index 556e40b66..0f3d70ddc 100644 --- a/plugins/modules/appliance_localaccounts_info.py +++ b/plugins/modules/appliance_localaccounts_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,46 +73,9 @@ """ EXAMPLES = r""" -- name: List the local accounts - vmware.vmware_rest.appliance_localaccounts_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: List the local accounts -value: - description: List the local accounts - returned: On success - sample: - - enabled: 1 - fullname: root - has_password: 1 - last_password_change: '2022-11-23T00:00:00.000Z' - max_days_between_password_change: 90 - min_days_between_password_change: 0 - password_expires_at: '2023-02-21T00:00:00.000Z' - roles: - - superAdmin - warn_days_before_password_expiration: 7 - - enabled: 0 - has_password: 0 - inactive_at: '2022-12-25T00:00:00.000Z' - last_password_change: '2022-09-26T00:00:00.000Z' - max_days_between_password_change: 90 - min_days_between_password_change: 1 - password_expires_at: '2022-12-25T00:00:00.000Z' - roles: - - '' - warn_days_before_password_expiration: 7 - - enabled: 0 - has_password: 0 - last_password_change: '2022-09-26T00:00:00.000Z' - max_days_between_password_change: -1 - min_days_between_password_change: -1 - roles: - - '' - warn_days_before_password_expiration: -1 - type: list """ # This structure describes the format of the data expected by the end-points @@ -150,10 +110,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_monitoring_info.py b/plugins/modules/appliance_monitoring_info.py index e3e87af6e..cc77e7925 100644 --- a/plugins/modules/appliance_monitoring_info.py +++ b/plugins/modules/appliance_monitoring_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,840 +73,9 @@ """ EXAMPLES = r""" -- name: Get the list of the monitored items - vmware.vmware_rest.appliance_monitoring_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the list of the monitored items -value: - description: Get the list of the monitored items - returned: On success - sample: - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-1 - id: disk.read.rate.dm-1 - instance: dm-1 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-1 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-10 - id: disk.read.rate.dm-10 - instance: dm-10 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-10 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-11 - id: disk.read.rate.dm-11 - instance: dm-11 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-11 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-12 - id: disk.read.rate.dm-12 - instance: dm-12 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-12 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-13 - id: disk.read.rate.dm-13 - instance: dm-13 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-13 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-14 - id: disk.read.rate.dm-14 - instance: dm-14 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-14 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-15 - id: disk.read.rate.dm-15 - instance: dm-15 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-15 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-2 - id: disk.read.rate.dm-2 - instance: dm-2 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-2 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-3 - id: disk.read.rate.dm-3 - instance: dm-3 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-3 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-4 - id: disk.read.rate.dm-4 - instance: dm-4 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-4 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-5 - id: disk.read.rate.dm-5 - instance: dm-5 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-5 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-6 - id: disk.read.rate.dm-6 - instance: dm-6 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-6 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-7 - id: disk.read.rate.dm-7 - instance: dm-7 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-7 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-8 - id: disk.read.rate.dm-8 - instance: dm-8 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-8 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-9 - id: disk.read.rate.dm-9 - instance: dm-9 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-9 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-1 - id: disk.write.rate.dm-1 - instance: dm-1 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-1 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-10 - id: disk.write.rate.dm-10 - instance: dm-10 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-10 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-11 - id: disk.write.rate.dm-11 - instance: dm-11 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-11 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-12 - id: disk.write.rate.dm-12 - instance: dm-12 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-12 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-13 - id: disk.write.rate.dm-13 - instance: dm-13 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-13 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-14 - id: disk.write.rate.dm-14 - instance: dm-14 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-14 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-15 - id: disk.write.rate.dm-15 - instance: dm-15 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-15 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-2 - id: disk.write.rate.dm-2 - instance: dm-2 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-2 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-3 - id: disk.write.rate.dm-3 - instance: dm-3 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-3 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-4 - id: disk.write.rate.dm-4 - instance: dm-4 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-4 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-5 - id: disk.write.rate.dm-5 - instance: dm-5 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-5 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-6 - id: disk.write.rate.dm-6 - instance: dm-6 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-6 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-7 - id: disk.write.rate.dm-7 - instance: dm-7 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-7 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-8 - id: disk.write.rate.dm-8 - instance: dm-8 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-8 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-9 - id: disk.write.rate.dm-9 - instance: dm-9 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-9 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-1 - id: disk.latency.rate.dm-1 - instance: dm-1 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-1 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-10 - id: disk.latency.rate.dm-10 - instance: dm-10 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-10 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-11 - id: disk.latency.rate.dm-11 - instance: dm-11 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-11 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-12 - id: disk.latency.rate.dm-12 - instance: dm-12 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-12 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-13 - id: disk.latency.rate.dm-13 - instance: dm-13 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-13 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-14 - id: disk.latency.rate.dm-14 - instance: dm-14 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-14 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-15 - id: disk.latency.rate.dm-15 - instance: dm-15 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-15 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-2 - id: disk.latency.rate.dm-2 - instance: dm-2 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-2 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-3 - id: disk.latency.rate.dm-3 - instance: dm-3 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-3 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-4 - id: disk.latency.rate.dm-4 - instance: dm-4 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-4 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-5 - id: disk.latency.rate.dm-5 - instance: dm-5 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-5 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-6 - id: disk.latency.rate.dm-6 - instance: dm-6 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-6 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-7 - id: disk.latency.rate.dm-7 - instance: dm-7 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-7 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-8 - id: disk.latency.rate.dm-8 - instance: dm-8 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-8 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-9 - id: disk.latency.rate.dm-9 - instance: dm-9 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-9 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.swap.util - id: swap.util - instance: '' - name: com.vmware.applmgmt.mon.name.swap.util - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.swap - id: storage.used.filesystem.swap - instance: '' - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.swap - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.swap - id: swap - instance: '' - name: com.vmware.applmgmt.mon.name.swap - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.swap - id: storage.totalsize.filesystem.swap - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.swap - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.cpu - description: com.vmware.applmgmt.mon.descr.cpu.totalfrequency - id: cpu.totalfrequency - instance: '' - name: com.vmware.applmgmt.mon.name.cpu.totalfrequency - units: com.vmware.applmgmt.mon.unit.mhz - - category: com.vmware.applmgmt.mon.cat.cpu - description: com.vmware.applmgmt.mon.descr.cpu.systemload - id: cpu.systemload - instance: '' - name: com.vmware.applmgmt.mon.name.cpu.systemload - units: com.vmware.applmgmt.mon.unit.load_per_min - - category: com.vmware.applmgmt.mon.cat.memory - description: com.vmware.applmgmt.mon.descr.mem.util - id: mem.util - instance: '' - name: com.vmware.applmgmt.mon.name.mem.util - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.memory - description: com.vmware.applmgmt.mon.descr.mem.total - id: mem.total - instance: '' - name: com.vmware.applmgmt.mon.name.mem.total - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.memory - description: com.vmware.applmgmt.mon.descr.mem.usage - id: mem.usage - instance: '' - name: com.vmware.applmgmt.mon.name.mem.usage - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.rx.error.eth0 - id: net.rx.error.eth0 - instance: eth0 - name: com.vmware.applmgmt.mon.name.net.rx.error.eth0 - units: com.vmware.applmgmt.mon.unit.errors_per_sample - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.rx.error.lo - id: net.rx.error.lo - instance: lo - name: com.vmware.applmgmt.mon.name.net.rx.error.lo - units: com.vmware.applmgmt.mon.unit.errors_per_sample - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.tx.error.eth0 - id: net.tx.error.eth0 - instance: eth0 - name: com.vmware.applmgmt.mon.name.net.tx.error.eth0 - units: com.vmware.applmgmt.mon.unit.errors_per_sample - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.tx.error.lo - id: net.tx.error.lo - instance: lo - name: com.vmware.applmgmt.mon.name.net.tx.error.lo - units: com.vmware.applmgmt.mon.unit.errors_per_sample - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.directory.vcdb_hourly_stats - id: storage.totalsize.directory.vcdb_hourly_stats - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.directory.vcdb_hourly_stats - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.directory.vcdb_daily_stats - id: storage.totalsize.directory.vcdb_daily_stats - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.directory.vcdb_daily_stats - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.directory.vcdb_monthly_stats - id: storage.totalsize.directory.vcdb_monthly_stats - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.directory.vcdb_monthly_stats - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.directory.vcdb_yearly_stats - id: storage.totalsize.directory.vcdb_yearly_stats - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.directory.vcdb_yearly_stats - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.directory.vcdb_stats - id: storage.totalsize.directory.vcdb_stats - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.directory.vcdb_stats - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.seat - id: storage.totalsize.filesystem.seat - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.seat - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.directory.vcdb_stats - id: storage.util.directory.vcdb_stats - instance: '' - name: com.vmware.applmgmt.mon.name.storage.util.directory.vcdb_stats - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.directory.vcdb_events - id: storage.totalsize.directory.vcdb_events - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.directory.vcdb_events - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.directory.vcdb_events - id: storage.util.directory.vcdb_events - instance: '' - name: com.vmware.applmgmt.mon.name.storage.util.directory.vcdb_events - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.directory.vcdb_alarms - id: storage.totalsize.directory.vcdb_alarms - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.directory.vcdb_alarms - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.directory.vcdb_alarms - id: storage.util.directory.vcdb_alarms - instance: '' - name: com.vmware.applmgmt.mon.name.storage.util.directory.vcdb_alarms - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.directory.vcdb_tasks - id: storage.totalsize.directory.vcdb_tasks - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.directory.vcdb_tasks - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.directory.vcdb_tasks - id: storage.util.directory.vcdb_tasks - instance: '' - name: com.vmware.applmgmt.mon.name.storage.util.directory.vcdb_tasks - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.seat - id: storage.used.filesystem.seat - instance: '' - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.seat - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.seat - id: storage.util.filesystem.seat - instance: '' - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.seat - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.db - id: storage.used.filesystem.db - instance: '' - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.db - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.db - id: storage.totalsize.filesystem.db - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.db - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.db - id: storage.util.filesystem.db - instance: '' - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.db - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.dblog - id: storage.used.filesystem.dblog - instance: '' - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.dblog - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.dblog - id: storage.totalsize.filesystem.dblog - instance: '' - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.dblog - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.dblog - id: storage.util.filesystem.dblog - instance: '' - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.dblog - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.root - id: storage.totalsize.filesystem.root - instance: / - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.root - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.root - id: storage.util.filesystem.root - instance: / - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.root - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.boot - id: storage.totalsize.filesystem.boot - instance: /boot - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.boot - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.boot - id: storage.util.filesystem.boot - instance: /boot - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.boot - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.archive - id: storage.totalsize.filesystem.archive - instance: /storage/archive - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.archive - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.archive - id: storage.util.filesystem.archive - instance: /storage/archive - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.archive - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.autodeploy - id: storage.totalsize.filesystem.autodeploy - instance: /storage/autodeploy - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.autodeploy - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.autodeploy - id: storage.util.filesystem.autodeploy - instance: /storage/autodeploy - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.autodeploy - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.core - id: storage.totalsize.filesystem.core - instance: /storage/core - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.core - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.core - id: storage.util.filesystem.core - instance: /storage/core - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.core - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.imagebuilder - id: storage.totalsize.filesystem.imagebuilder - instance: /storage/imagebuilder - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.imagebuilder - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.imagebuilder - id: storage.util.filesystem.imagebuilder - instance: /storage/imagebuilder - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.imagebuilder - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.lifecycle - id: storage.totalsize.filesystem.lifecycle - instance: /storage/lifecycle - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.lifecycle - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.lifecycle - id: storage.util.filesystem.lifecycle - instance: /storage/lifecycle - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.lifecycle - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.log - id: storage.totalsize.filesystem.log - instance: /storage/log - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.log - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.log - id: storage.util.filesystem.log - instance: /storage/log - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.log - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.lvm_snapshot - id: storage.totalsize.filesystem.lvm_snapshot - instance: /storage/lvm_snapshot - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.lvm_snapshot - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.lvm_snapshot - id: storage.util.filesystem.lvm_snapshot - instance: /storage/lvm_snapshot - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.lvm_snapshot - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.netdump - id: storage.totalsize.filesystem.netdump - instance: /storage/netdump - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.netdump - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.netdump - id: storage.util.filesystem.netdump - instance: /storage/netdump - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.netdump - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.updatemgr - id: storage.totalsize.filesystem.updatemgr - instance: /storage/updatemgr - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.updatemgr - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.updatemgr - id: storage.util.filesystem.updatemgr - instance: /storage/updatemgr - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.updatemgr - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.vtsdb - id: storage.totalsize.filesystem.vtsdb - instance: /storage/vtsdb - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.vtsdb - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.vtsdb - id: storage.util.filesystem.vtsdb - instance: /storage/vtsdb - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.vtsdb - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.totalsize.filesystem.vtsdblog - id: storage.totalsize.filesystem.vtsdblog - instance: /storage/vtsdblog - name: com.vmware.applmgmt.mon.name.storage.totalsize.filesystem.vtsdblog - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.vtsdblog - id: storage.util.filesystem.vtsdblog - instance: /storage/vtsdblog - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.vtsdblog - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.root - id: storage.used.filesystem.root - instance: / - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.root - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.boot - id: storage.used.filesystem.boot - instance: /boot - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.boot - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.archive - id: storage.used.filesystem.archive - instance: /storage/archive - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.archive - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.autodeploy - id: storage.used.filesystem.autodeploy - instance: /storage/autodeploy - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.autodeploy - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.core - id: storage.used.filesystem.core - instance: /storage/core - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.core - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.imagebuilder - id: storage.used.filesystem.imagebuilder - instance: /storage/imagebuilder - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.imagebuilder - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.lifecycle - id: storage.used.filesystem.lifecycle - instance: /storage/lifecycle - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.lifecycle - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.log - id: storage.used.filesystem.log - instance: /storage/log - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.log - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.lvm_snapshot - id: storage.used.filesystem.lvm_snapshot - instance: /storage/lvm_snapshot - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.lvm_snapshot - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.netdump - id: storage.used.filesystem.netdump - instance: /storage/netdump - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.netdump - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.updatemgr - id: storage.used.filesystem.updatemgr - instance: /storage/updatemgr - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.updatemgr - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.vtsdb - id: storage.used.filesystem.vtsdb - instance: /storage/vtsdb - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.vtsdb - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.used.filesystem.vtsdblog - id: storage.used.filesystem.vtsdblog - instance: /storage/vtsdblog - name: com.vmware.applmgmt.mon.name.storage.used.filesystem.vtsdblog - units: com.vmware.applmgmt.mon.unit.kb - - category: com.vmware.applmgmt.mon.cat.cpu - description: com.vmware.applmgmt.mon.descr.cpu.util - id: cpu.util - instance: '' - name: com.vmware.applmgmt.mon.name.cpu.util - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.cpu - description: com.vmware.applmgmt.mon.descr.cpu.steal - id: cpu.steal - instance: '' - name: com.vmware.applmgmt.mon.name.cpu.steal - units: com.vmware.applmgmt.mon.unit.percent - - category: com.vmware.applmgmt.mon.cat.memory - description: com.vmware.applmgmt.mon.descr.swap.pageRate - id: swap.pageRate - instance: '' - name: com.vmware.applmgmt.mon.name.swap.pageRate - units: com.vmware.applmgmt.mon.unit.pages_per_sec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.read.rate.dm-0 - id: disk.read.rate.dm-0 - instance: dm-0 - name: com.vmware.applmgmt.mon.name.disk.read.rate.dm-0 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.write.rate.dm-0 - id: disk.write.rate.dm-0 - instance: dm-0 - name: com.vmware.applmgmt.mon.name.disk.write.rate.dm-0 - units: com.vmware.applmgmt.mon.unit.num_of_io_per_msec - - category: com.vmware.applmgmt.mon.cat.disk - description: com.vmware.applmgmt.mon.descr.disk.latency.rate.dm-0 - id: disk.latency.rate.dm-0 - instance: dm-0 - name: com.vmware.applmgmt.mon.name.disk.latency.rate.dm-0 - units: com.vmware.applmgmt.mon.unit.msec_per_io - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.rx.activity.eth0 - id: net.rx.activity.eth0 - instance: eth0 - name: com.vmware.applmgmt.mon.name.net.rx.activity.eth0 - units: com.vmware.applmgmt.mon.unit.kb_per_sec - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.rx.activity.lo - id: net.rx.activity.lo - instance: lo - name: com.vmware.applmgmt.mon.name.net.rx.activity.lo - units: com.vmware.applmgmt.mon.unit.kb_per_sec - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.rx.packetRate.eth0 - id: net.rx.packetRate.eth0 - instance: eth0 - name: com.vmware.applmgmt.mon.name.net.rx.packetRate.eth0 - units: com.vmware.applmgmt.mon.unit.packets_per_sec - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.rx.packetRate.lo - id: net.rx.packetRate.lo - instance: lo - name: com.vmware.applmgmt.mon.name.net.rx.packetRate.lo - units: com.vmware.applmgmt.mon.unit.packets_per_sec - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.rx.drop.eth0 - id: net.rx.drop.eth0 - instance: eth0 - name: com.vmware.applmgmt.mon.name.net.rx.drop.eth0 - units: com.vmware.applmgmt.mon.unit.drops_per_sample - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.rx.drop.lo - id: net.rx.drop.lo - instance: lo - name: com.vmware.applmgmt.mon.name.net.rx.drop.lo - units: com.vmware.applmgmt.mon.unit.drops_per_sample - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.tx.activity.eth0 - id: net.tx.activity.eth0 - instance: eth0 - name: com.vmware.applmgmt.mon.name.net.tx.activity.eth0 - units: com.vmware.applmgmt.mon.unit.kb_per_sec - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.tx.activity.lo - id: net.tx.activity.lo - instance: lo - name: com.vmware.applmgmt.mon.name.net.tx.activity.lo - units: com.vmware.applmgmt.mon.unit.kb_per_sec - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.tx.packetRate.eth0 - id: net.tx.packetRate.eth0 - instance: eth0 - name: com.vmware.applmgmt.mon.name.net.tx.packetRate.eth0 - units: com.vmware.applmgmt.mon.unit.packets_per_sec - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.tx.packetRate.lo - id: net.tx.packetRate.lo - instance: lo - name: com.vmware.applmgmt.mon.name.net.tx.packetRate.lo - units: com.vmware.applmgmt.mon.unit.packets_per_sec - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.tx.drop.eth0 - id: net.tx.drop.eth0 - instance: eth0 - name: com.vmware.applmgmt.mon.name.net.tx.drop.eth0 - units: com.vmware.applmgmt.mon.unit.drops_per_sample - - category: com.vmware.applmgmt.mon.cat.network - description: com.vmware.applmgmt.mon.descr.net.tx.drop.lo - id: net.tx.drop.lo - instance: lo - name: com.vmware.applmgmt.mon.name.net.tx.drop.lo - units: com.vmware.applmgmt.mon.unit.drops_per_sample - - category: com.vmware.applmgmt.mon.cat.storage - description: com.vmware.applmgmt.mon.descr.storage.util.filesystem.swap - id: storage.util.filesystem.swap - instance: '' - name: com.vmware.applmgmt.mon.name.storage.util.filesystem.swap - units: com.vmware.applmgmt.mon.unit.percent - type: list """ # This structure describes the format of the data expected by the end-points @@ -944,10 +110,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_monitoring_query.py b/plugins/modules/appliance_monitoring_query.py index cdd3b45f3..0688c1366 100644 --- a/plugins/modules/appliance_monitoring_query.py +++ b/plugins/modules/appliance_monitoring_query.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -100,7 +97,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -110,43 +107,9 @@ """ EXAMPLES = r""" -- name: Query the monitoring backend - vmware.vmware_rest.appliance_monitoring_query: - end_time: 2021-04-14 09:34:56+00:00 - start_time: 2021-04-14 08:34:56+00:00 - names: - - mem.total - interval: MINUTES5 - function: AVG - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Query the monitoring backend -value: - description: Query the monitoring backend - returned: On success - sample: - - data: - - '' - - '' - - '' - - '' - - '' - - '' - - '' - - '' - - '' - - '' - - '' - - '' - - '' - end_time: '2021-04-14T09:34:56.000Z' - function: AVG - interval: MINUTES5 - name: mem.total - start_time: '2021-04-14T08:34:56.000Z' - type: list """ # This structure describes the format of the data expected by the end-points @@ -191,10 +154,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking.py b/plugins/modules/appliance_networking.py index a7edfae87..430f77be1 100644 --- a/plugins/modules/appliance_networking.py +++ b/plugins/modules/appliance_networking.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,24 +82,9 @@ """ EXAMPLES = r""" -- name: Set network information - vmware.vmware_rest.appliance_networking: - ipv6_enabled: false - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Set network information -id: - description: moid of the resource - returned: On success - sample: null - type: dict -value: - description: Set network information - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -138,10 +120,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_dns_domains.py b/plugins/modules/appliance_networking_dns_domains.py index 0ea0dc8a3..bb82545cc 100644 --- a/plugins/modules/appliance_networking_dns_domains.py +++ b/plugins/modules/appliance_networking_dns_domains.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -78,7 +75,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -88,26 +85,9 @@ """ EXAMPLES = r""" -- name: Update the domain configuration - vmware.vmware_rest.appliance_networking_dns_domains: - domains: - - foobar - register: result - -- name: Add another domain configuration - vmware.vmware_rest.appliance_networking_dns_domains: - domain: barfoo - state: add - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Add another domain configuration -value: - description: Add another domain configuration - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -143,10 +123,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_dns_domains_info.py b/plugins/modules/appliance_networking_dns_domains_info.py index d4d4a144c..ed72cf48f 100644 --- a/plugins/modules/appliance_networking_dns_domains_info.py +++ b/plugins/modules/appliance_networking_dns_domains_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get DNS domains configuration - vmware.vmware_rest.appliance_networking_dns_domains_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get DNS domains configuration -value: - description: Get DNS domains configuration - returned: On success - sample: [] - type: list """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_dns_hostname.py b/plugins/modules/appliance_networking_dns_hostname.py index 7f6313cdc..d0f7bde0a 100644 --- a/plugins/modules/appliance_networking_dns_hostname.py +++ b/plugins/modules/appliance_networking_dns_hostname.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -74,7 +71,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -84,30 +81,15 @@ """ EXAMPLES = r""" -- name: Test the hostname configuration - vmware.vmware_rest.appliance_networking_dns_hostname: - state: test - name: vcenter.test - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Test the hostname configuration -value: - description: Test the hostname configuration - returned: On success - sample: - messages: - - message: Hostname vcenter.test resolved using DNS to 192.168.123.8. - result: success - status: green - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "test": {"query": {}, "body": {"name": "name"}, "path": {}}, "set": {"query": {}, "body": {"name": "name"}, "path": {}}, + "test": {"query": {}, "body": {"name": "name"}, "path": {}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -137,10 +119,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_dns_hostname_info.py b/plugins/modules/appliance_networking_dns_hostname_info.py index aa3af341d..e14a20b6b 100644 --- a/plugins/modules/appliance_networking_dns_hostname_info.py +++ b/plugins/modules/appliance_networking_dns_hostname_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the hostname configuration - vmware.vmware_rest.appliance_networking_dns_hostname_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the hostname configuration -value: - description: Get the hostname configuration - returned: On success - sample: vcenter.test - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_dns_servers.py b/plugins/modules/appliance_networking_dns_servers.py index 224df1555..6eaca46ec 100644 --- a/plugins/modules/appliance_networking_dns_servers.py +++ b/plugins/modules/appliance_networking_dns_servers.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -88,7 +85,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -98,54 +95,16 @@ """ EXAMPLES = r""" -- name: Set static DNS servers - vmware.vmware_rest.appliance_networking_dns_servers: - servers: - - 1.1.1.1 - mode: is_static - state: set - register: result - -- name: Add another DNS server - vmware.vmware_rest.appliance_networking_dns_servers: - server: 8.8.4.4 - state: add - register: result - -- name: Use the DNS servers from the DHCP - vmware.vmware_rest.appliance_networking_dns_servers: - mode: dhcp - servers: [] - state: set - register: result - -- name: Test the DNS servers - vmware.vmware_rest.appliance_networking_dns_servers: - state: test - servers: - - google.com - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Add another DNS server -value: - description: Add another DNS server - returned: On success - sample: - mode: is_static - servers: - - 1.1.1.1 - - 192.168.123.1 - - 8.8.4.4 - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "test": {"query": {}, "body": {"servers": "servers"}, "path": {}}, "set": {"query": {}, "body": {"mode": "mode", "servers": "servers"}, "path": {}}, "add": {"query": {}, "body": {"server": "server"}, "path": {}}, + "test": {"query": {}, "body": {"servers": "servers"}, "path": {}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -175,10 +134,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_dns_servers_info.py b/plugins/modules/appliance_networking_dns_servers_info.py index 5eebb73d0..2cf525967 100644 --- a/plugins/modules/appliance_networking_dns_servers_info.py +++ b/plugins/modules/appliance_networking_dns_servers_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,21 +69,9 @@ """ EXAMPLES = r""" -- name: Get the DNS servers - vmware.vmware_rest.appliance_networking_dns_servers_info: - register: original_DNS_config """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the DNS servers -value: - description: Get the DNS servers - returned: On success - sample: - mode: dhcp - servers: - - 192.168.123.1 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -118,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_firewall_inbound.py b/plugins/modules/appliance_networking_firewall_inbound.py index 728370b0b..e0e6f2198 100644 --- a/plugins/modules/appliance_networking_firewall_inbound.py +++ b/plugins/modules/appliance_networking_firewall_inbound.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -101,7 +98,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -111,34 +108,9 @@ """ EXAMPLES = r""" -- name: Ensure the rules parameter is mandatory - vmware.vmware_rest.appliance_networking_firewall_inbound: - register: result - failed_when: - - not(result.failed) - - result.msg == 'missing required arguments: rules' - -- name: Set a firewall rule - vmware.vmware_rest.appliance_networking_firewall_inbound: - rules: - - address: 1.2.3.4 - prefix: 32 - policy: ACCEPT - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Ensure the rules parameter is mandatory -failed_when_result: - description: Ensure the rules parameter is mandatory - returned: On success - sample: 0 - type: int -msg: - description: Ensure the rules parameter is mandatory - returned: On success - sample: 'missing required arguments: rules' - type: str """ # This structure describes the format of the data expected by the end-points @@ -173,10 +145,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_firewall_inbound_info.py b/plugins/modules/appliance_networking_firewall_inbound_info.py index 6599f93d9..2d9fbd894 100644 --- a/plugins/modules/appliance_networking_firewall_inbound_info.py +++ b/plugins/modules/appliance_networking_firewall_inbound_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -65,7 +62,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -75,18 +72,9 @@ """ EXAMPLES = r""" -- name: Get the firewall inbound configuration - vmware.vmware_rest.appliance_networking_firewall_inbound_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the firewall inbound configuration -value: - description: Get the firewall inbound configuration - returned: On success - sample: [] - type: list """ # This structure describes the format of the data expected by the end-points @@ -118,10 +106,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_info.py b/plugins/modules/appliance_networking_info.py index 673bf5f39..ddd419934 100644 --- a/plugins/modules/appliance_networking_info.py +++ b/plugins/modules/appliance_networking_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,45 +69,9 @@ """ EXAMPLES = r""" -- name: Get network information - vmware.vmware_rest.appliance_networking_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get network information -value: - description: Get network information - returned: On success - sample: - dns: - hostname: vcenter.test - mode: DHCP - servers: - - 192.168.123.1 - interfaces: - nic0: - ipv4: - address: 192.168.123.8 - configurable: 1 - default_gateway: 192.168.123.1 - mode: STATIC - prefix: 24 - ipv6: - addresses: - - address: fe80::5054:ff:fe70:4823 - origin: OTHER - prefix: 64 - status: PREFERRED - autoconf: 1 - configurable: 1 - default_gateway: '' - dhcp: 0 - mac: 52:54:00:70:48:23 - name: nic0 - status: up - vcenter_base_url: https://vcenter.test:443 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -142,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_interfaces_info.py b/plugins/modules/appliance_networking_interfaces_info.py index 0b9e49599..319552163 100644 --- a/plugins/modules/appliance_networking_interfaces_info.py +++ b/plugins/modules/appliance_networking_interfaces_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,47 +73,9 @@ """ EXAMPLES = r""" -- name: Get a list of the network interfaces - vmware.vmware_rest.appliance_networking_interfaces_info: - register: result - -- name: Get details about one network interfaces - vmware.vmware_rest.appliance_networking_interfaces_info: - interface_name: nic0 - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get details about one network interfaces -id: - description: moid of the resource - returned: On success - sample: nic0 - type: str -value: - description: Get details about one network interfaces - returned: On success - sample: - ipv4: - address: 192.168.123.8 - configurable: 1 - default_gateway: 192.168.123.1 - mode: STATIC - prefix: 24 - ipv6: - addresses: - - address: fe80::5054:ff:fe70:4823 - origin: OTHER - prefix: 64 - status: PREFERRED - autoconf: 1 - configurable: 1 - default_gateway: '' - dhcp: 0 - mac: 52:54:00:70:48:23 - name: nic0 - status: up - type: dict """ # This structure describes the format of the data expected by the end-points @@ -151,10 +110,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_interfaces_ipv4.py b/plugins/modules/appliance_networking_interfaces_ipv4.py index a410b7c47..ae6fba3c5 100644 --- a/plugins/modules/appliance_networking_interfaces_ipv4.py +++ b/plugins/modules/appliance_networking_interfaces_ipv4.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -101,7 +98,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -111,31 +108,9 @@ """ EXAMPLES = r""" -- name: Set the IPv4 network information of nic99 (which does not exist) - vmware.vmware_rest.appliance_networking_interfaces_ipv4: - interface_name: nic99 - config: - address: 10.20.80.191 - prefix: '32' - mode: STATIC - failed_when: - - not(result.failed) - - result.value.messages[0].default_message msg == "The interface is unknown." - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Set the IPv4 network information of nic99 (which does not exist) -failed_when_result: - description: Set the IPv4 network information of nic99 (which does not exist) - returned: On success - sample: 0 - type: int -msg: - description: Set the IPv4 network information of nic99 (which does not exist) - returned: On success - sample: 'missing required arguments: mode' - type: str """ # This structure describes the format of the data expected by the end-points @@ -179,10 +154,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_interfaces_ipv4_info.py b/plugins/modules/appliance_networking_interfaces_ipv4_info.py index 030fd79ff..c6ab12679 100644 --- a/plugins/modules/appliance_networking_interfaces_ipv4_info.py +++ b/plugins/modules/appliance_networking_interfaces_ipv4_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,24 +73,9 @@ """ EXAMPLES = r""" -- name: Collect the IPv4 network information - vmware.vmware_rest.appliance_networking_interfaces_ipv4_info: - interface_name: nic0 - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Collect the IPv4 network information -value: - description: Collect the IPv4 network information - returned: On success - sample: - address: 192.168.123.8 - configurable: 1 - default_gateway: 192.168.123.1 - mode: STATIC - prefix: 24 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -125,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_interfaces_ipv6.py b/plugins/modules/appliance_networking_interfaces_ipv6.py index a460589a5..a246cb829 100644 --- a/plugins/modules/appliance_networking_interfaces_ipv6.py +++ b/plugins/modules/appliance_networking_interfaces_ipv6.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -107,7 +104,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -117,28 +114,9 @@ """ EXAMPLES = r""" -- name: Set the IPv6 network information of nic99 (which does not exist) - vmware.vmware_rest.appliance_networking_interfaces_ipv6: - interface_name: nic99 - mode: DHCP - failed_when: - - not(result.failed) - - result.value.messages[0].default_message msg == "The interface is unknown." - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Set the IPv6 network information of nic99 (which does not exist) -failed_when_result: - description: Set the IPv6 network information of nic99 (which does not exist) - returned: On success - sample: 0 - type: int -msg: - description: Set the IPv6 network information of nic99 (which does not exist) - returned: On success - sample: 'missing required arguments: addresses, autoconf, default_gateway, dhcp' - type: str """ # This structure describes the format of the data expected by the end-points @@ -182,10 +160,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_interfaces_ipv6_info.py b/plugins/modules/appliance_networking_interfaces_ipv6_info.py index f252986a2..5bf244da3 100644 --- a/plugins/modules/appliance_networking_interfaces_ipv6_info.py +++ b/plugins/modules/appliance_networking_interfaces_ipv6_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,28 +73,9 @@ """ EXAMPLES = r""" -- name: Collect the IPv6 network information - vmware.vmware_rest.appliance_networking_interfaces_ipv6_info: - interface_name: nic0 - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Collect the IPv6 network information -value: - description: Collect the IPv6 network information - returned: On success - sample: - addresses: - - address: fe80::5054:ff:fe70:4823 - origin: OTHER - prefix: 64 - status: PREFERRED - autoconf: 1 - configurable: 1 - default_gateway: '' - dhcp: 0 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -129,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_noproxy.py b/plugins/modules/appliance_networking_noproxy.py index 379613bb7..7f392e8af 100644 --- a/plugins/modules/appliance_networking_noproxy.py +++ b/plugins/modules/appliance_networking_noproxy.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -80,7 +77,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -90,26 +87,9 @@ """ EXAMPLES = r""" -- name: Set HTTP noproxy configuration - vmware.vmware_rest.appliance_networking_noproxy: - servers: - - redhat.com - - ansible.com - register: result - -- name: Remove the noproxy entries - vmware.vmware_rest.appliance_networking_noproxy: - servers: [] - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Remove the noproxy entries -value: - description: Remove the noproxy entries - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -144,10 +124,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_noproxy_info.py b/plugins/modules/appliance_networking_noproxy_info.py index b3ae984ef..ba0d77a49 100644 --- a/plugins/modules/appliance_networking_noproxy_info.py +++ b/plugins/modules/appliance_networking_noproxy_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,20 +69,9 @@ """ EXAMPLES = r""" -- name: Get HTTP noproxy configuration - vmware.vmware_rest.appliance_networking_noproxy_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get HTTP noproxy configuration -value: - description: Get HTTP noproxy configuration - returned: On success - sample: - - localhost - - 127.0.0.1 - type: list """ # This structure describes the format of the data expected by the end-points @@ -117,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_proxy.py b/plugins/modules/appliance_networking_proxy.py index 43cdc0762..9e0d48091 100644 --- a/plugins/modules/appliance_networking_proxy.py +++ b/plugins/modules/appliance_networking_proxy.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -128,7 +125,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -138,37 +135,13 @@ """ EXAMPLES = r""" -- name: Set the HTTP proxy configuration - vmware.vmware_rest.appliance_networking_proxy: - enabled: true - server: http://datastore.test - port: 3128 - protocol: http - register: result - -- name: Delete the HTTP proxy configuration - vmware.vmware_rest.appliance_networking_proxy: - protocol: http - state: absent - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Delete the HTTP proxy configuration -value: - description: Delete the HTTP proxy configuration - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "test": { - "query": {}, - "body": {"config": "config", "host": "host"}, - "path": {"protocol": "protocol"}, - }, "set": { "query": {}, "body": { @@ -181,6 +154,11 @@ "path": {"protocol": "protocol"}, }, "delete": {"query": {}, "body": {}, "path": {"protocol": "protocol"}}, + "test": { + "query": {}, + "body": {"config": "config", "host": "host"}, + "path": {"protocol": "protocol"}, + }, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -210,10 +188,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_networking_proxy_info.py b/plugins/modules/appliance_networking_proxy_info.py index 6f348fbec..0cb3c1c89 100644 --- a/plugins/modules/appliance_networking_proxy_info.py +++ b/plugins/modules/appliance_networking_proxy_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,30 +73,9 @@ """ EXAMPLES = r""" -- name: Get the HTTP proxy configuration - vmware.vmware_rest.appliance_networking_proxy_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the HTTP proxy configuration -value: - description: Get the HTTP proxy configuration - returned: On success - sample: - ftp: - enabled: 0 - port: -1 - server: '' - http: - enabled: 0 - port: -1 - server: '' - https: - enabled: 0 - port: -1 - server: '' - type: dict """ # This structure describes the format of the data expected by the end-points @@ -134,10 +110,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_ntp.py b/plugins/modules/appliance_ntp.py index 9704e28f5..22261ac99 100644 --- a/plugins/modules/appliance_ntp.py +++ b/plugins/modules/appliance_ntp.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -79,7 +76,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -89,38 +86,15 @@ """ EXAMPLES = r""" -- name: Adjust the NTP configuration - vmware.vmware_rest.appliance_ntp: - servers: - - time.google.com - -- name: Test the NTP configuration - vmware.vmware_rest.appliance_ntp: - state: test - servers: - - time.google.com - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Test the NTP configuration -value: - description: Test the NTP configuration - returned: On success - sample: - - message: - args: [] - default_message: NTP Server is reachable. - id: com.vmware.appliance.ntp_sync.success - server: time.google.com - status: SERVER_REACHABLE - type: list """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "test": {"query": {}, "body": {"servers": "servers"}, "path": {}}, "set": {"query": {}, "body": {"servers": "servers"}, "path": {}}, + "test": {"query": {}, "body": {"servers": "servers"}, "path": {}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -150,10 +124,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_ntp_info.py b/plugins/modules/appliance_ntp_info.py index 28edca70e..b57795c1d 100644 --- a/plugins/modules/appliance_ntp_info.py +++ b/plugins/modules/appliance_ntp_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,22 +73,9 @@ """ EXAMPLES = r""" -- name: Get the NTP configuration - vmware.vmware_rest.appliance_ntp_info: - -- name: Get the NTP configuration - vmware.vmware_rest.appliance_ntp_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the NTP configuration -value: - description: Get the NTP configuration - returned: On success - sample: - - time.nist.gov - type: list """ # This structure describes the format of the data expected by the end-points @@ -123,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_services.py b/plugins/modules/appliance_services.py index dbcccb119..77c43c018 100644 --- a/plugins/modules/appliance_services.py +++ b/plugins/modules/appliance_services.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,39 +82,16 @@ """ EXAMPLES = r""" -- name: Stop the ntpd service - vmware.vmware_rest.appliance_services: - service: ntpd - state: stop - register: result - -- name: Start the ntpd service - vmware.vmware_rest.appliance_services: - service: ntpd - state: start - register: result - -- name: Restart the ntpd service - vmware.vmware_rest.appliance_services: - service: ntpd - state: restart - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Restart the ntpd service -value: - description: Restart the ntpd service - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "start": {"query": {}, "body": {}, "path": {"service": "service"}}, - "restart": {"query": {}, "body": {}, "path": {"service": "service"}}, "stop": {"query": {}, "body": {}, "path": {"service": "service"}}, + "restart": {"query": {}, "body": {}, "path": {"service": "service"}}, + "start": {"query": {}, "body": {}, "path": {"service": "service"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -147,10 +121,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_services_info.py b/plugins/modules/appliance_services_info.py index 5bbed2649..4e4399736 100644 --- a/plugins/modules/appliance_services_info.py +++ b/plugins/modules/appliance_services_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,26 +73,9 @@ """ EXAMPLES = r""" -- name: Get information about ntpd - vmware.vmware_rest.appliance_services_info: - service: ntpd - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get information about ntpd -id: - description: moid of the resource - returned: On success - sample: ntpd - type: str -value: - description: Get information about ntpd - returned: On success - sample: - description: ntpd.service - state: STARTED - type: dict """ # This structure describes the format of the data expected by the end-points @@ -130,10 +110,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_shutdown.py b/plugins/modules/appliance_shutdown.py index 187de8b45..8a39bffd9 100644 --- a/plugins/modules/appliance_shutdown.py +++ b/plugins/modules/appliance_shutdown.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -79,7 +76,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -89,49 +86,20 @@ """ EXAMPLES = r""" -- name: Shutdown the appliance - vmware.vmware_rest.appliance_shutdown: - state: poweroff - reason: this is an example - delay: 600 - register: result - -- name: Abort the shutdown of the appliance - vmware.vmware_rest.appliance_shutdown: - state: cancel - register: result - -- name: Reboot the appliance - vmware.vmware_rest.appliance_shutdown: - state: reboot - reason: this is an example - delay: 600 - register: result - -- name: Abort the reboot - vmware.vmware_rest.appliance_shutdown: - state: cancel - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Abort the reboot -value: - description: Abort the reboot - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "cancel": {"query": {}, "body": {}, "path": {}}, - "reboot": {"query": {}, "body": {"delay": "delay", "reason": "reason"}, "path": {}}, "poweroff": { "query": {}, "body": {"delay": "delay", "reason": "reason"}, "path": {}, }, + "cancel": {"query": {}, "body": {}, "path": {}}, + "reboot": {"query": {}, "body": {"delay": "delay", "reason": "reason"}, "path": {}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -161,10 +129,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_shutdown_info.py b/plugins/modules/appliance_shutdown_info.py index 646fae32d..16cc31159 100644 --- a/plugins/modules/appliance_shutdown_info.py +++ b/plugins/modules/appliance_shutdown_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,25 +69,9 @@ """ EXAMPLES = r""" -- name: Ensure there is no ongoing shutdown - vmware.vmware_rest.appliance_shutdown_info: - register: result - -- name: Get the ongoing shutdown - vmware.vmware_rest.appliance_shutdown_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the ongoing shutdown -value: - description: Get the ongoing shutdown - returned: On success - sample: - action: reboot - reason: this is an example - shutdown_time: '2022-11-24T06:12:16.000Z' - type: dict """ # This structure describes the format of the data expected by the end-points @@ -122,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_system_globalfips.py b/plugins/modules/appliance_system_globalfips.py index 0409b4667..7077f39de 100644 --- a/plugins/modules/appliance_system_globalfips.py +++ b/plugins/modules/appliance_system_globalfips.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -73,7 +70,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -117,10 +114,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_system_globalfips_info.py b/plugins/modules/appliance_system_globalfips_info.py index 99b4882f2..42b6b3527 100644 --- a/plugins/modules/appliance_system_globalfips_info.py +++ b/plugins/modules/appliance_system_globalfips_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -106,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_system_storage.py b/plugins/modules/appliance_system_storage.py index 8bf8613c4..fcb46ec7f 100644 --- a/plugins/modules/appliance_system_storage.py +++ b/plugins/modules/appliance_system_storage.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -69,7 +66,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -79,28 +76,9 @@ """ EXAMPLES = r""" -- name: Resize the first partition and return the state of the partition before and after the operation - vmware.vmware_rest.appliance_system_storage: - state: resize_ex - register: result - -- name: Resize the first partition - vmware.vmware_rest.appliance_system_storage: - state: resize - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Resize the first partition and return the state of the partition before and after the operation -value: - description: Resize the first partition and return the state of the partition before - and after the operation - returned: On success - sample: - lv_root_0: - new_size: 104312832 - old_size: 53985280 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -136,10 +114,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_system_storage_info.py b/plugins/modules/appliance_system_storage_info.py index 33135181a..562b44a80 100644 --- a/plugins/modules/appliance_system_storage_info.py +++ b/plugins/modules/appliance_system_storage_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the appliance storage information - vmware.vmware_rest.appliance_system_storage_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the appliance storage information -value: - description: Get the appliance storage information - returned: On success - sample: [] - type: list """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_system_time_info.py b/plugins/modules/appliance_system_time_info.py index b7f29836c..535610751 100644 --- a/plugins/modules/appliance_system_time_info.py +++ b/plugins/modules/appliance_system_time_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,22 +69,9 @@ """ EXAMPLES = r""" -- name: Get the current time - vmware.vmware_rest.appliance_system_time_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the current time -value: - description: Get the current time - returned: On success - sample: - date: Wed 11-23-2022 - seconds_since_epoch: null - time: 08:12:27 PM - timezone: UTC - type: dict """ # This structure describes the format of the data expected by the end-points @@ -119,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_system_time_timezone.py b/plugins/modules/appliance_system_time_timezone.py index 5c7ca39e4..056b7a069 100644 --- a/plugins/modules/appliance_system_time_timezone.py +++ b/plugins/modules/appliance_system_time_timezone.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -73,7 +70,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -83,19 +80,9 @@ """ EXAMPLES = r""" -- name: Use the UTC timezone - vmware.vmware_rest.appliance_system_time_timezone: - name: UTC - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Use the UTC timezone -value: - description: Use the UTC timezone - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -130,10 +117,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_system_time_timezone_info.py b/plugins/modules/appliance_system_time_timezone_info.py index 8ca42dc9f..c01b26ebf 100644 --- a/plugins/modules/appliance_system_time_timezone_info.py +++ b/plugins/modules/appliance_system_time_timezone_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get the timezone configuration - vmware.vmware_rest.appliance_system_time_timezone_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the timezone configuration -value: - description: Get the timezone configuration - returned: On success - sample: Etc/UTC - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_system_version_info.py b/plugins/modules/appliance_system_version_info.py index 3ffe68432..21f049956 100644 --- a/plugins/modules/appliance_system_version_info.py +++ b/plugins/modules/appliance_system_version_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,25 +69,9 @@ """ EXAMPLES = r""" -- name: Get the VCSA version - vmware.vmware_rest.appliance_system_version_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the VCSA version -value: - description: Get the VCSA version - returned: On success - sample: - build: '20150588' - install_time: '2022-09-26T19:22:25.765Z' - product: VMware vCenter Server - releasedate: July 23, 2022 - summary: Patch for VMware vCenter Server 7.0 - type: vCenter Server with an embedded Platform Services Controller - version: 7.0.3.00800 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -122,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_timesync.py b/plugins/modules/appliance_timesync.py index 53ec12aeb..04c37b4c3 100644 --- a/plugins/modules/appliance_timesync.py +++ b/plugins/modules/appliance_timesync.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -78,7 +75,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -88,18 +85,9 @@ """ EXAMPLES = r""" -- name: Ensure we use NTP - vmware.vmware_rest.appliance_timesync: - mode: NTP """ RETURN = r""" -# content generated by the update_return_section callback# task: Ensure we use NTP -value: - description: Ensure we use NTP - returned: On success - sample: NTP - type: str """ # This structure describes the format of the data expected by the end-points @@ -134,10 +122,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_timesync_info.py b/plugins/modules/appliance_timesync_info.py index 38a46f08c..df4457c2c 100644 --- a/plugins/modules/appliance_timesync_info.py +++ b/plugins/modules/appliance_timesync_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,18 +69,9 @@ """ EXAMPLES = r""" -- name: Get information regarding the clock synchronization - vmware.vmware_rest.appliance_timesync_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get information regarding the clock synchronization -value: - description: Get information regarding the clock synchronization - returned: On success - sample: NTP - type: str """ # This structure describes the format of the data expected by the end-points @@ -115,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_update_info.py b/plugins/modules/appliance_update_info.py index 06777d431..3a4b0106c 100644 --- a/plugins/modules/appliance_update_info.py +++ b/plugins/modules/appliance_update_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,20 +69,9 @@ """ EXAMPLES = r""" -- name: Check if the system is up to date - vmware.vmware_rest.appliance_update_info: - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Check if the system is up to date -value: - description: Check if the system is up to date - returned: On success - sample: - state: UP_TO_DATE - version: 7.0.3.00800 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -117,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_vmon_service.py b/plugins/modules/appliance_vmon_service.py index bec481fb4..7b86186fc 100644 --- a/plugins/modules/appliance_vmon_service.py +++ b/plugins/modules/appliance_vmon_service.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -87,7 +84,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -97,38 +94,22 @@ """ EXAMPLES = r""" -- name: Adjust vpxd configuration - vmware.vmware_rest.appliance_vmon_service: - service: vpxd - startup_type: AUTOMATIC - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Adjust vpxd configuration -id: - description: moid of the resource - returned: On success - sample: vpxd - type: str -value: - description: Adjust vpxd configuration - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { + "stop": {"query": {}, "body": {}, "path": {"service": "service"}}, + "restart": {"query": {}, "body": {}, "path": {"service": "service"}}, + "list_details": {"query": {}, "body": {}, "path": {}}, + "start": {"query": {}, "body": {}, "path": {"service": "service"}}, "update": { "query": {}, "body": {"startup_type": "spec/startup_type"}, "path": {"service": "service"}, }, - "stop": {"query": {}, "body": {}, "path": {"service": "service"}}, - "list_details": {"query": {}, "body": {}, "path": {}}, - "restart": {"query": {}, "body": {}, "path": {"service": "service"}}, - "start": {"query": {}, "body": {}, "path": {"service": "service"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -158,10 +139,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/appliance_vmon_service_info.py b/plugins/modules/appliance_vmon_service_info.py index 18e2d588c..87afc7e87 100644 --- a/plugins/modules/appliance_vmon_service_info.py +++ b/plugins/modules/appliance_vmon_service_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -68,7 +65,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -78,398 +75,9 @@ """ EXAMPLES = r""" -- name: Get information about a VMON service - vmware.vmware_rest.appliance_vmon_service_info: - service: vpxd - register: result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get information about a VMON service -value: - description: Get information about a VMON service - returned: On success - sample: - - key: analytics - value: - description_key: cis.analytics.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.analytics.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: applmgmt - value: - description_key: cis.applmgmt.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.applmgmt.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: certificateauthority - value: - description_key: cis.certificateauthority.ServiceDescription - health: HEALTHY - health_messages: - - args: - - GREEN - default_message: Health is GREEN - id: certificateathority.health.statuscode - name_key: cis.certificateauthority.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: certificatemanagement - value: - description_key: cis.certificatemanagement.ServiceDescription - health: HEALTHY - health_messages: - - args: - - GREEN - default_message: Health is GREEN - id: certificatemanagement.health.statuscode - name_key: cis.certificatemanagement.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: cis-license - value: - description_key: cis.cis-license.ServiceDescription - health: HEALTHY - health_messages: - - args: [] - default_message: The License Service is operational. - id: cis.license.health.ok - name_key: cis.cis-license.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: content-library - value: - description_key: cis.content-library.ServiceDescription - health: HEALTHY - health_messages: - - args: [] - default_message: Database server connection is GREEN. - id: com.vmware.vdcs.vsphere-cs-lib.db_health_green - name_key: cis.content-library.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: eam - value: - description_key: cis.eam.ServiceDescription - health: HEALTHY - health_messages: - - args: [] - default_message: '' - id: cis.eam.statusOK - name_key: cis.eam.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: envoy - value: - description_key: cis.envoy.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.envoy.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: hvc - value: - description_key: cis.hvc.ServiceDescription - health: HEALTHY - health_messages: - - args: - - GREEN - default_message: Health is GREEN - id: hvc.health.statuscode - name_key: cis.hvc.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: imagebuilder - value: - description_key: cis.imagebuilder.ServiceDescription - name_key: cis.imagebuilder.ServiceName - startup_type: MANUAL - state: STOPPED - - key: infraprofile - value: - description_key: cis.infraprofile.ServiceDescription - health: HEALTHY - health_messages: - - args: - - GREEN - default_message: Health is GREEN - id: infraprofile.health.statuscode - name_key: cis.infraprofile.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: lookupsvc - value: - description_key: cis.lookupsvc.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.lookupsvc.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: netdumper - value: - description_key: cis.netdumper.ServiceDescription - name_key: cis.netdumper.ServiceName - startup_type: MANUAL - state: STOPPED - - key: observability-vapi - value: - description_key: cis.observability-vapi.ServiceDescription - health: HEALTHY - health_messages: - - args: - - GREEN - default_message: Health is GREEN - id: observability.health.statuscode - name_key: cis.observability-vapi.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: perfcharts - value: - description_key: cis.perfcharts.ServiceDescription - health: HEALTHY_WITH_WARNINGS - health_messages: - - args: [] - default_message: health.statsReoptInitalizer.illegalStateEx - id: health.statsReoptInitalizer.illegalStateEx - name_key: cis.perfcharts.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: pschealth - value: - description_key: cis.pschealth.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.pschealth.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: rbd - value: - description_key: cis.rbd.ServiceDescription - name_key: cis.rbd.ServiceName - startup_type: MANUAL - state: STOPPED - - key: rhttpproxy - value: - description_key: cis.rhttpproxy.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.rhttpproxy.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: sca - value: - description_key: cis.sca.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.sca.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: sps - value: - description_key: cis.sps.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.sps.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: statsmonitor - value: - description_key: cis.statsmonitor.ServiceDescription - health: HEALTHY - health_messages: - - args: [] - default_message: Appliance monitoring service is healthy. - id: com.vmware.applmgmt.mon.health.healthy - name_key: cis.statsmonitor.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: sts - value: - description_key: cis.sts.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.sts.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: topologysvc - value: - description_key: cis.topologysvc.ServiceDescription - health: HEALTHY - health_messages: - - args: - - GREEN - default_message: Health is GREEN - id: topologysvc.health.statuscode - name_key: cis.topologysvc.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: trustmanagement - value: - description_key: cis.trustmanagement.ServiceDescription - health: HEALTHY - health_messages: - - args: - - GREEN - default_message: Health is GREEN - id: trustmanagement.health.statuscode - name_key: cis.trustmanagement.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: updatemgr - value: - description_key: cis.updatemgr.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.updatemgr.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vapi-endpoint - value: - description_key: cis.vapi-endpoint.ServiceDescription - health: HEALTHY - health_messages: - - args: - - 2022-11-23T20:10:44UTC - - 2022-11-23T20:10:46UTC - default_message: Configuration health status is created between 2022-11-23T20:10:44UTC - and 2022-11-23T20:10:46UTC. - id: com.vmware.vapi.endpoint.healthStatusProducedTimes - name_key: cis.vapi-endpoint.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vcha - value: - description_key: cis.vcha.ServiceDescription - name_key: cis.vcha.ServiceName - startup_type: DISABLED - state: STOPPED - - key: vlcm - value: - description_key: cis.vlcm.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.vlcm.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vmcam - value: - description_key: cis.vmcam.ServiceDescription - name_key: cis.vmcam.ServiceName - startup_type: MANUAL - state: STOPPED - - key: vmonapi - value: - description_key: cis.vmonapi.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.vmonapi.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vmware-postgres-archiver - value: - description_key: cis.vmware-postgres-archiver.ServiceDescription - health: HEALTHY - health_messages: - - args: [] - default_message: VMware Archiver service is healthy. - id: cis.vmware-postgres-archiver.health.healthy - name_key: cis.vmware-postgres-archiver.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vmware-vpostgres - value: - description_key: cis.vmware-vpostgres.ServiceDescription - health: HEALTHY - health_messages: - - args: [] - default_message: Service vmware-vpostgres is healthy. - id: cis.vmware-vpostgres.health.healthy - name_key: cis.vmware-vpostgres.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vpxd - value: - description_key: cis.vpxd.ServiceDescription - health: HEALTHY - health_messages: - - args: - - vCenter Server - - GREEN - default_message: '{0} health is {1}' - id: vc.health.statuscode - - args: - - VirtualCenter Database - - GREEN - default_message: '{0} health is {1}' - id: vc.health.statuscode - name_key: cis.vpxd.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vpxd-svcs - value: - description_key: cis.vpxd-svcs.ServiceDescription - health: HEALTHY - health_messages: - - args: [] - default_message: Tagging service is in a healthy state - id: cis.tagging.health.status - name_key: cis.vpxd-svcs.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vsan-health - value: - description_key: cis.vsan-health.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.vsan-health.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vsm - value: - description_key: cis.vsm.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.vsm.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vsphere-ui - value: - description_key: cis.vsphere-ui.ServiceDescription - name_key: cis.vsphere-ui.ServiceName - startup_type: AUTOMATIC - state: STOPPED - - key: vstats - value: - description_key: cis.vstats.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.vstats.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: vtsdb - value: - description_key: cis.vtsdb.ServiceDescription - health: HEALTHY - health_messages: - - args: [] - default_message: Service vtsdb is healthy. - id: cis.vtsdb.health.healthy - name_key: cis.vtsdb.ServiceName - startup_type: AUTOMATIC - state: STARTED - - key: wcp - value: - description_key: cis.wcp.ServiceDescription - health: HEALTHY - health_messages: [] - name_key: cis.wcp.ServiceName - startup_type: AUTOMATIC - state: STARTED - type: list """ # This structure describes the format of the data expected by the end-points @@ -501,10 +109,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/content_configuration.py b/plugins/modules/content_configuration.py index 7dc0e7eb4..44aad72b7 100644 --- a/plugins/modules/content_configuration.py +++ b/plugins/modules/content_configuration.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -99,7 +96,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -109,27 +106,9 @@ """ EXAMPLES = r""" -- name: Turn on the autmatic syncrhronization - vmware.vmware_rest.content_configuration: - automatic_sync_enabled: true """ RETURN = r""" -# content generated by the update_return_section callback# task: Turn on the autmatic syncrhronization -id: - description: moid of the resource - returned: On success - sample: null - type: dict -value: - description: Turn on the autmatic syncrhronization - returned: On success - sample: - automatic_sync_enabled: 1 - automatic_sync_start_hour: 20 - automatic_sync_stop_hour: 7 - maximum_concurrent_item_syncs: 5 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -170,10 +149,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/content_configuration_info.py b/plugins/modules/content_configuration_info.py index a85d733e9..8129593a8 100644 --- a/plugins/modules/content_configuration_info.py +++ b/plugins/modules/content_configuration_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -62,7 +59,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -72,22 +69,9 @@ """ EXAMPLES = r""" -- name: Get the vSphere content syncrhronization configuration - vmware.vmware_rest.content_configuration_info: - register: current_content_configuration """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the vSphere content syncrhronization configuration -value: - description: Get the vSphere content syncrhronization configuration - returned: On success - sample: - automatic_sync_enabled: 1 - automatic_sync_start_hour: 20 - automatic_sync_stop_hour: 7 - maximum_concurrent_item_syncs: 5 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -119,10 +103,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/content_library_item_info.py b/plugins/modules/content_library_item_info.py index b88ffe542..563c23d3a 100644 --- a/plugins/modules/content_library_item_info.py +++ b/plugins/modules/content_library_item_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -71,7 +68,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -81,101 +78,9 @@ """ EXAMPLES = r""" -- name: Create a content library pointing on a NFS share - vmware.vmware_rest.content_locallibrary: - name: my_library_on_nfs - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - state: present - register: nfs_lib - -- name: Get the list of items of the NFS library - vmware.vmware_rest.content_library_item_info: - library_id: '{{ nfs_lib.id }}' - register: lib_items - -- name: Get the list of items of the NFS library - vmware.vmware_rest.content_library_item_info: - library_id: '{{ nfs_lib.id }}' - register: result - -- name: Create a new local content library - vmware.vmware_rest.content_locallibrary: - name: local_library_001 - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}" - type: DATASTORE - state: present - register: ds_lib - -- name: Get the (empty) list of items of the library - vmware.vmware_rest.content_library_item_info: - library_id: '{{ ds_lib.id }}' - register: result - -- name: Create subscribed library - vmware.vmware_rest.content_subscribedlibrary: - name: sub_lib - subscription_info: - subscription_url: '{{ nfs_lib.value.publish_info.publish_url }}' - authentication_method: NONE - automatic_sync_enabled: false - on_demand: true - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}" - type: DATASTORE - register: sub_lib - -- name: Ensure the OVF is here - vmware.vmware_rest.content_library_item_info: - library_id: '{{ sub_lib.id }}' - register: result - -- name: Create a content library based on a DataStore - vmware.vmware_rest.content_locallibrary: - name: my_library_on_datastore - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - type: DATASTORE - state: present - register: nfs_lib """ RETURN = r""" -# content generated by the update_return_section callback# task: Ensure the OVF is here -value: - description: Ensure the OVF is here - returned: On success - sample: - - cached: 0 - content_version: '2' - creation_time: '2022-11-23T20:06:05.707Z' - description: an OVF example - id: f6618d6b-301b-4202-aa9c-12eb0c7536b1 - last_modified_time: '2022-11-23T20:06:06.062Z' - last_sync_time: '2022-11-23T20:06:06.061Z' - library_id: 8b4e355e-a463-44f1-9b04-d0786a49cc7d - metadata_version: '1' - name: golden_image - security_compliance: 1 - size: 0 - source_id: 636ef270-b556-4972-924f-0d21b0f3bfce - type: ovf - version: '1' - type: list """ # This structure describes the format of the data expected by the end-points @@ -210,10 +115,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/content_locallibrary.py b/plugins/modules/content_locallibrary.py index 1a8c06438..09ba0dc1f 100644 --- a/plugins/modules/content_locallibrary.py +++ b/plugins/modules/content_locallibrary.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -305,7 +302,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -315,936 +312,15 @@ """ EXAMPLES = r""" -- name: Create a content library pointing on a NFS share - vmware.vmware_rest.content_locallibrary: - name: my_library_on_nfs - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - state: present - register: nfs_lib - -- name: Create some more content libraries - vmware.vmware_rest.content_locallibrary: - name: my_library_on_nfs_{{ item }} - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - state: present - with_sequence: 0-10 - -- name: Create a new local content library - vmware.vmware_rest.content_locallibrary: - name: local_library_001 - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}" - type: DATASTORE - state: present - register: ds_lib - -- name: Create a content library based on a DataStore - vmware.vmware_rest.content_locallibrary: - name: my_library_on_datastore - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - type: DATASTORE - state: present - register: nfs_lib """ RETURN = r""" -# content generated by the update_return_section callback# task: Delete all the local libraries -msg: - description: Delete all the local libraries - returned: On success - sample: All items completed - type: str -results: - description: Delete all the local libraries - returned: On success - sample: - - _ansible_item_label: - creation_time: '2022-11-23T20:02:22.940Z' - description: automated - id: a66d5c73-57f8-4a3a-9361-292a55f68516 - last_modified_time: '2022-11-23T20:02:22.940Z' - name: my_library_on_nfs - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/a66d5c73-57f8-4a3a-9361-292a55f68516/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: a66d5c73-57f8-4a3a-9361-292a55f68516 - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:22.940Z' - description: automated - id: a66d5c73-57f8-4a3a-9361-292a55f68516 - last_modified_time: '2022-11-23T20:02:22.940Z' - name: my_library_on_nfs - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/a66d5c73-57f8-4a3a-9361-292a55f68516/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:25.134Z' - description: automated - id: 3393956a-43ed-4e7f-bd96-eb39bd604445 - last_modified_time: '2022-11-23T20:02:25.134Z' - name: my_library_on_nfs_0 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/3393956a-43ed-4e7f-bd96-eb39bd604445/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: 3393956a-43ed-4e7f-bd96-eb39bd604445 - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:25.134Z' - description: automated - id: 3393956a-43ed-4e7f-bd96-eb39bd604445 - last_modified_time: '2022-11-23T20:02:25.134Z' - name: my_library_on_nfs_0 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/3393956a-43ed-4e7f-bd96-eb39bd604445/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:26.342Z' - description: automated - id: 87f66f86-c046-45a7-9563-d59ea220babf - last_modified_time: '2022-11-23T20:02:26.342Z' - name: my_library_on_nfs_1 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/87f66f86-c046-45a7-9563-d59ea220babf/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: 87f66f86-c046-45a7-9563-d59ea220babf - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:26.342Z' - description: automated - id: 87f66f86-c046-45a7-9563-d59ea220babf - last_modified_time: '2022-11-23T20:02:26.342Z' - name: my_library_on_nfs_1 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/87f66f86-c046-45a7-9563-d59ea220babf/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:27.504Z' - description: automated - id: f6c590c4-ae6d-4ad0-9362-378196e98a3c - last_modified_time: '2022-11-23T20:02:27.504Z' - name: my_library_on_nfs_2 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/f6c590c4-ae6d-4ad0-9362-378196e98a3c/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: f6c590c4-ae6d-4ad0-9362-378196e98a3c - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:27.504Z' - description: automated - id: f6c590c4-ae6d-4ad0-9362-378196e98a3c - last_modified_time: '2022-11-23T20:02:27.504Z' - name: my_library_on_nfs_2 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/f6c590c4-ae6d-4ad0-9362-378196e98a3c/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:28.821Z' - description: automated - id: e8917499-2a4c-4b70-b39b-ae0caaef89c3 - last_modified_time: '2022-11-23T20:02:28.821Z' - name: my_library_on_nfs_3 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/e8917499-2a4c-4b70-b39b-ae0caaef89c3/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: e8917499-2a4c-4b70-b39b-ae0caaef89c3 - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:28.821Z' - description: automated - id: e8917499-2a4c-4b70-b39b-ae0caaef89c3 - last_modified_time: '2022-11-23T20:02:28.821Z' - name: my_library_on_nfs_3 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/e8917499-2a4c-4b70-b39b-ae0caaef89c3/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:30.085Z' - description: automated - id: 630ebdfe-8913-45d3-aaa8-9c2fdecbb76b - last_modified_time: '2022-11-23T20:02:30.085Z' - name: my_library_on_nfs_4 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/630ebdfe-8913-45d3-aaa8-9c2fdecbb76b/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: 630ebdfe-8913-45d3-aaa8-9c2fdecbb76b - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:30.085Z' - description: automated - id: 630ebdfe-8913-45d3-aaa8-9c2fdecbb76b - last_modified_time: '2022-11-23T20:02:30.085Z' - name: my_library_on_nfs_4 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/630ebdfe-8913-45d3-aaa8-9c2fdecbb76b/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:31.482Z' - description: automated - id: a046e2e5-bd55-4d04-9443-750a2ab35a6d - last_modified_time: '2022-11-23T20:02:31.482Z' - name: my_library_on_nfs_5 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/a046e2e5-bd55-4d04-9443-750a2ab35a6d/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: a046e2e5-bd55-4d04-9443-750a2ab35a6d - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:31.482Z' - description: automated - id: a046e2e5-bd55-4d04-9443-750a2ab35a6d - last_modified_time: '2022-11-23T20:02:31.482Z' - name: my_library_on_nfs_5 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/a046e2e5-bd55-4d04-9443-750a2ab35a6d/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:32.846Z' - description: automated - id: b94383b1-7877-4dbd-8c33-51abc39451ff - last_modified_time: '2022-11-23T20:02:32.846Z' - name: my_library_on_nfs_6 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/b94383b1-7877-4dbd-8c33-51abc39451ff/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: b94383b1-7877-4dbd-8c33-51abc39451ff - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:32.846Z' - description: automated - id: b94383b1-7877-4dbd-8c33-51abc39451ff - last_modified_time: '2022-11-23T20:02:32.846Z' - name: my_library_on_nfs_6 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/b94383b1-7877-4dbd-8c33-51abc39451ff/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:34.218Z' - description: automated - id: 8e3efb68-cb84-4ce0-a65a-6c94cc6e6e00 - last_modified_time: '2022-11-23T20:02:34.218Z' - name: my_library_on_nfs_7 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/8e3efb68-cb84-4ce0-a65a-6c94cc6e6e00/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: 8e3efb68-cb84-4ce0-a65a-6c94cc6e6e00 - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:34.218Z' - description: automated - id: 8e3efb68-cb84-4ce0-a65a-6c94cc6e6e00 - last_modified_time: '2022-11-23T20:02:34.218Z' - name: my_library_on_nfs_7 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/8e3efb68-cb84-4ce0-a65a-6c94cc6e6e00/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:35.922Z' - description: automated - id: 0b12c0b3-6c6d-448d-9033-e054a70183e7 - last_modified_time: '2022-11-23T20:02:35.922Z' - name: my_library_on_nfs_8 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/0b12c0b3-6c6d-448d-9033-e054a70183e7/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: 0b12c0b3-6c6d-448d-9033-e054a70183e7 - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:35.922Z' - description: automated - id: 0b12c0b3-6c6d-448d-9033-e054a70183e7 - last_modified_time: '2022-11-23T20:02:35.922Z' - name: my_library_on_nfs_8 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/0b12c0b3-6c6d-448d-9033-e054a70183e7/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:37.796Z' - description: automated - id: 46454797-bbe0-415a-9fe9-3cf2f74a14db - last_modified_time: '2022-11-23T20:02:37.796Z' - name: my_library_on_nfs_9 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/46454797-bbe0-415a-9fe9-3cf2f74a14db/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: 46454797-bbe0-415a-9fe9-3cf2f74a14db - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:37.796Z' - description: automated - id: 46454797-bbe0-415a-9fe9-3cf2f74a14db - last_modified_time: '2022-11-23T20:02:37.796Z' - name: my_library_on_nfs_9 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/46454797-bbe0-415a-9fe9-3cf2f74a14db/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:02:38.976Z' - description: automated - id: 209926aa-e3fe-46a5-95f2-501e82a5139b - last_modified_time: '2022-11-23T20:02:38.976Z' - name: my_library_on_nfs_10 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/209926aa-e3fe-46a5-95f2-501e82a5139b/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: 209926aa-e3fe-46a5-95f2-501e82a5139b - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:02:38.976Z' - description: automated - id: 209926aa-e3fe-46a5-95f2-501e82a5139b - last_modified_time: '2022-11-23T20:02:38.976Z' - name: my_library_on_nfs_10 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/209926aa-e3fe-46a5-95f2-501e82a5139b/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - value: {} - - _ansible_item_label: - creation_time: '2022-11-23T20:06:02.958Z' - description: automated - id: de0e9bff-3bae-45d0-a90c-6c2a01dfbe66 - last_modified_time: '2022-11-23T20:06:02.958Z' - name: local_library_001 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/de0e9bff-3bae-45d0-a90c-6c2a01dfbe66/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - datastore_id: datastore-1065 - type: DATASTORE - type: LOCAL - version: '2' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: de0e9bff-3bae-45d0-a90c-6c2a01dfbe66 - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - subscriptions: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:06:02.958Z' - description: automated - id: de0e9bff-3bae-45d0-a90c-6c2a01dfbe66 - last_modified_time: '2022-11-23T20:06:02.958Z' - name: local_library_001 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/de0e9bff-3bae-45d0-a90c-6c2a01dfbe66/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - datastore_id: datastore-1065 - type: DATASTORE - type: LOCAL - version: '2' - value: {} - type: list """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, - "update": { - "query": {}, + "create": { + "query": {"client_token": "client_token"}, "body": { "creation_time": "creation_time", "description": "description", @@ -1260,15 +336,16 @@ "type": "type", "version": "version", }, - "path": {"library_id": "library_id"}, + "path": {}, }, "publish": { "query": {}, "body": {"subscriptions": "subscriptions"}, "path": {"library_id": "library_id"}, }, - "create": { - "query": {"client_token": "client_token"}, + "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, + "update": { + "query": {}, "body": { "creation_time": "creation_time", "description": "description", @@ -1284,7 +361,7 @@ "type": "type", "version": "version", }, - "path": {}, + "path": {"library_id": "library_id"}, }, } # pylint: disable=line-too-long @@ -1316,10 +393,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/content_locallibrary_info.py b/plugins/modules/content_locallibrary_info.py index d34759710..e8a8eb17e 100644 --- a/plugins/modules/content_locallibrary_info.py +++ b/plugins/modules/content_locallibrary_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,245 +73,9 @@ """ EXAMPLES = r""" -- name: List Local Content Library - vmware.vmware_rest.content_locallibrary_info: - register: my_content_library - -- name: List all Local Content Library - vmware.vmware_rest.content_locallibrary_info: - register: all_content_libraries - -- name: Create a new local content library - vmware.vmware_rest.content_locallibrary: - name: local_library_001 - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}" - type: DATASTORE - state: present - register: ds_lib - -- name: Retrieve the local content library information based upon id check mode - vmware.vmware_rest.content_locallibrary_info: - library_id: '{{ ds_lib.id }}' - register: result - check_mode: true """ RETURN = r""" -# content generated by the update_return_section callback# task: List all Local Content Library -value: - description: List all Local Content Library - returned: On success - sample: - - creation_time: '2022-11-23T20:02:22.940Z' - description: automated - id: a66d5c73-57f8-4a3a-9361-292a55f68516 - last_modified_time: '2022-11-23T20:02:22.940Z' - name: my_library_on_nfs - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/a66d5c73-57f8-4a3a-9361-292a55f68516/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:25.134Z' - description: automated - id: 3393956a-43ed-4e7f-bd96-eb39bd604445 - last_modified_time: '2022-11-23T20:02:25.134Z' - name: my_library_on_nfs_0 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/3393956a-43ed-4e7f-bd96-eb39bd604445/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:26.342Z' - description: automated - id: 87f66f86-c046-45a7-9563-d59ea220babf - last_modified_time: '2022-11-23T20:02:26.342Z' - name: my_library_on_nfs_1 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/87f66f86-c046-45a7-9563-d59ea220babf/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:27.504Z' - description: automated - id: f6c590c4-ae6d-4ad0-9362-378196e98a3c - last_modified_time: '2022-11-23T20:02:27.504Z' - name: my_library_on_nfs_2 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/f6c590c4-ae6d-4ad0-9362-378196e98a3c/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:28.821Z' - description: automated - id: e8917499-2a4c-4b70-b39b-ae0caaef89c3 - last_modified_time: '2022-11-23T20:02:28.821Z' - name: my_library_on_nfs_3 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/e8917499-2a4c-4b70-b39b-ae0caaef89c3/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:30.085Z' - description: automated - id: 630ebdfe-8913-45d3-aaa8-9c2fdecbb76b - last_modified_time: '2022-11-23T20:02:30.085Z' - name: my_library_on_nfs_4 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/630ebdfe-8913-45d3-aaa8-9c2fdecbb76b/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:31.482Z' - description: automated - id: a046e2e5-bd55-4d04-9443-750a2ab35a6d - last_modified_time: '2022-11-23T20:02:31.482Z' - name: my_library_on_nfs_5 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/a046e2e5-bd55-4d04-9443-750a2ab35a6d/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:32.846Z' - description: automated - id: b94383b1-7877-4dbd-8c33-51abc39451ff - last_modified_time: '2022-11-23T20:02:32.846Z' - name: my_library_on_nfs_6 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/b94383b1-7877-4dbd-8c33-51abc39451ff/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:34.218Z' - description: automated - id: 8e3efb68-cb84-4ce0-a65a-6c94cc6e6e00 - last_modified_time: '2022-11-23T20:02:34.218Z' - name: my_library_on_nfs_7 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/8e3efb68-cb84-4ce0-a65a-6c94cc6e6e00/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:35.922Z' - description: automated - id: 0b12c0b3-6c6d-448d-9033-e054a70183e7 - last_modified_time: '2022-11-23T20:02:35.922Z' - name: my_library_on_nfs_8 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/0b12c0b3-6c6d-448d-9033-e054a70183e7/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:37.796Z' - description: automated - id: 46454797-bbe0-415a-9fe9-3cf2f74a14db - last_modified_time: '2022-11-23T20:02:37.796Z' - name: my_library_on_nfs_9 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/46454797-bbe0-415a-9fe9-3cf2f74a14db/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - - creation_time: '2022-11-23T20:02:38.976Z' - description: automated - id: 209926aa-e3fe-46a5-95f2-501e82a5139b - last_modified_time: '2022-11-23T20:02:38.976Z' - name: my_library_on_nfs_10 - publish_info: - authentication_method: NONE - persist_json_enabled: 0 - publish_url: https://vcenter.test:443/cls/vcsp/lib/209926aa-e3fe-46a5-95f2-501e82a5139b/lib.json - published: 1 - user_name: vcsp - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - type: LOCAL - version: '2' - type: list """ # This structure describes the format of the data expected by the end-points @@ -349,10 +110,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/content_subscribedlibrary.py b/plugins/modules/content_subscribedlibrary.py index e67962853..1c26691c6 100644 --- a/plugins/modules/content_subscribedlibrary.py +++ b/plugins/modules/content_subscribedlibrary.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -303,7 +300,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -313,142 +310,15 @@ """ EXAMPLES = r""" -- name: Create a content library pointing on a NFS share - vmware.vmware_rest.content_locallibrary: - name: my_library_on_nfs - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - state: present - register: nfs_lib - -- name: Create subscribed library - vmware.vmware_rest.content_subscribedlibrary: - name: sub_lib - subscription_info: - subscription_url: '{{ nfs_lib.value.publish_info.publish_url }}' - authentication_method: NONE - automatic_sync_enabled: false - on_demand: true - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}" - type: DATASTORE - register: sub_lib - -- name: Create subscribed library (again) - vmware.vmware_rest.content_subscribedlibrary: - name: sub_lib - subscription_info: - subscription_url: '{{ nfs_lib.value.publish_info.publish_url }}' - authentication_method: NONE - automatic_sync_enabled: false - on_demand: true - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}" - type: DATASTORE - register: result - -- name: Clean up the cache - vmware.vmware_rest.content_subscribedlibrary: - name: sub_lib - library_id: '{{ sub_lib.id }}' - state: evict - -- name: Trigger a library sync - vmware.vmware_rest.content_subscribedlibrary: - name: sub_lib - library_id: '{{ sub_lib.id }}' - state: sync """ RETURN = r""" -# content generated by the update_return_section callback# task: Delete all the subscribed libraries -msg: - description: Delete all the subscribed libraries - returned: On success - sample: All items completed - type: str -results: - description: Delete all the subscribed libraries - returned: On success - sample: - - _ansible_item_label: - creation_time: '2022-11-23T20:06:05.189Z' - description: '' - id: 8b4e355e-a463-44f1-9b04-d0786a49cc7d - last_modified_time: '2022-11-23T20:06:05.189Z' - last_sync_time: '2022-11-23T20:06:07.717Z' - name: sub_lib - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - datastore_id: datastore-1065 - type: DATASTORE - subscription_info: - authentication_method: NONE - automatic_sync_enabled: 0 - on_demand: 1 - subscription_url: https://vcenter.test:443/cls/vcsp/lib/a66d5c73-57f8-4a3a-9361-292a55f68516/lib.json - type: SUBSCRIBED - version: '4' - _ansible_no_log: null - ansible_loop_var: item - changed: 1 - failed: 0 - invocation: - module_args: - client_token: null - creation_time: null - description: null - id: null - last_modified_time: null - last_sync_time: null - library_id: 8b4e355e-a463-44f1-9b04-d0786a49cc7d - name: null - optimization_info: null - publish_info: null - server_guid: null - session_timeout: null - state: absent - storage_backings: null - subscription_info: null - type: null - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - version: null - item: - creation_time: '2022-11-23T20:06:05.189Z' - description: '' - id: 8b4e355e-a463-44f1-9b04-d0786a49cc7d - last_modified_time: '2022-11-23T20:06:05.189Z' - last_sync_time: '2022-11-23T20:06:07.717Z' - name: sub_lib - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - datastore_id: datastore-1065 - type: DATASTORE - subscription_info: - authentication_method: NONE - automatic_sync_enabled: 0 - on_demand: 1 - subscription_url: https://vcenter.test:443/cls/vcsp/lib/a66d5c73-57f8-4a3a-9361-292a55f68516/lib.json - type: SUBSCRIBED - version: '4' - value: {} - type: list """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "sync": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, - "update": { - "query": {}, + "create": { + "query": {"client_token": "client_token"}, "body": { "creation_time": "creation_time", "description": "description", @@ -464,10 +334,18 @@ "type": "type", "version": "version", }, - "path": {"library_id": "library_id"}, + "path": {}, }, - "create": { - "query": {"client_token": "client_token"}, + "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, + "sync": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, + "evict": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, + "probe": { + "query": {}, + "body": {"subscription_info": "subscription_info"}, + "path": {}, + }, + "update": { + "query": {}, "body": { "creation_time": "creation_time", "description": "description", @@ -483,15 +361,8 @@ "type": "type", "version": "version", }, - "path": {}, - }, - "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, - "probe": { - "query": {}, - "body": {"subscription_info": "subscription_info"}, - "path": {}, + "path": {"library_id": "library_id"}, }, - "evict": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -522,10 +393,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/content_subscribedlibrary_info.py b/plugins/modules/content_subscribedlibrary_info.py index 0cc01cb29..d958ae73d 100644 --- a/plugins/modules/content_subscribedlibrary_info.py +++ b/plugins/modules/content_subscribedlibrary_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,35 +73,9 @@ """ EXAMPLES = r""" -- name: List Subscribed Content Library - vmware.vmware_rest.content_subscribedlibrary_info: - register: my_content_library """ RETURN = r""" -# content generated by the update_return_section callback# task: List Subscribed Content Library -value: - description: List Subscribed Content Library - returned: On success - sample: - - creation_time: '2022-11-23T20:06:05.189Z' - description: '' - id: 8b4e355e-a463-44f1-9b04-d0786a49cc7d - last_modified_time: '2022-11-23T20:06:05.189Z' - last_sync_time: '2022-11-23T20:06:07.717Z' - name: sub_lib - server_guid: 52fb0b5e-ffc3-465b-bf4f-e4e6d5423cf5 - storage_backings: - - datastore_id: datastore-1065 - type: DATASTORE - subscription_info: - authentication_method: NONE - automatic_sync_enabled: 0 - on_demand: 1 - subscription_url: https://vcenter.test:443/cls/vcsp/lib/a66d5c73-57f8-4a3a-9361-292a55f68516/lib.json - type: SUBSCRIBED - version: '4' - type: list """ # This structure describes the format of the data expected by the end-points @@ -139,10 +110,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_cluster_info.py b/plugins/modules/vcenter_cluster_info.py index dc178de08..28068a473 100644 --- a/plugins/modules/vcenter_cluster_info.py +++ b/plugins/modules/vcenter_cluster_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -94,7 +91,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -104,30 +101,9 @@ """ EXAMPLES = r""" -- name: Build a list of all the clusters - vmware.vmware_rest.vcenter_cluster_info: - register: all_the_clusters - -- name: Retrieve details about the first cluster - vmware.vmware_rest.vcenter_cluster_info: - cluster: '{{ all_the_clusters.value[0].cluster }}' - register: my_cluster_info """ RETURN = r""" -# content generated by the update_return_section callback# task: Retrieve details about the first cluster -id: - description: moid of the resource - returned: On success - sample: domain-c1006 - type: str -value: - description: Retrieve details about the first cluster - returned: On success - sample: - name: my_cluster - resource_pool: resgroup-1007 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -171,10 +147,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_datacenter.py b/plugins/modules/vcenter_datacenter.py index 992507c6f..ea45855b4 100644 --- a/plugins/modules/vcenter_datacenter.py +++ b/plugins/modules/vcenter_datacenter.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -85,7 +82,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -95,63 +92,9 @@ """ EXAMPLES = r""" -- name: Get a list of all the datacenters - register: existing_datacenters - vmware.vmware_rest.vcenter_datacenter_info: - -- name: Force delete the existing DC - vmware.vmware_rest.vcenter_datacenter: - state: absent - datacenter: '{{ item.datacenter }}' - force: true - with_items: '{{ existing_datacenters.value }}' - until: - - _result is not failed - retries: 7 - -- name: Create datacenter my_dc - vmware.vmware_rest.vcenter_datacenter: - name: my_dc - folder: '{{ my_datacenter_folder.folder }}' """ RETURN = r""" -# content generated by the update_return_section callback# task: Force delete the existing DC -msg: - description: Force delete the existing DC - returned: On success - sample: All items completed - type: str -results: - description: Force delete the existing DC - returned: On success - sample: - - _ansible_item_label: - datacenter: datacenter-1001 - name: my_dc - _ansible_no_log: null - ansible_loop_var: item - attempts: 1 - changed: 1 - failed: 0 - invocation: - module_args: - datacenter: datacenter-1001 - folder: null - force: 1 - name: null - session_timeout: null - state: absent - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - item: - datacenter: datacenter-1001 - name: my_dc - value: {} - type: list """ # This structure describes the format of the data expected by the end-points @@ -192,10 +135,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_datacenter_info.py b/plugins/modules/vcenter_datacenter_info.py index 486064ecd..854bbc651 100644 --- a/plugins/modules/vcenter_datacenter_info.py +++ b/plugins/modules/vcenter_datacenter_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -90,7 +87,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -100,24 +97,9 @@ """ EXAMPLES = r""" -- name: Get a list of all the datacenters - register: existing_datacenters - vmware.vmware_rest.vcenter_datacenter_info: - -- name: collect a list of the datacenters - vmware.vmware_rest.vcenter_datacenter_info: - register: my_datacenters """ RETURN = r""" -# content generated by the update_return_section callback# task: collect a list of the datacenters -value: - description: collect a list of the datacenters - returned: On success - sample: - - datacenter: datacenter-1001 - name: my_dc - type: list """ # This structure describes the format of the data expected by the end-points @@ -156,10 +138,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_datastore_info.py b/plugins/modules/vcenter_datastore_info.py index 091a38178..f281c7e31 100644 --- a/plugins/modules/vcenter_datastore_info.py +++ b/plugins/modules/vcenter_datastore_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -102,7 +99,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -112,33 +109,9 @@ """ EXAMPLES = r""" -- name: Build a list of all the datastores - vmware.vmware_rest.vcenter_datastore_info: - register: all_the_datastores """ RETURN = r""" -# content generated by the update_return_section callback# task: Build a list of all the datastores -value: - description: Build a list of all the datastores - returned: On success - sample: - - capacity: 11542724608 - datastore: datastore-1015 - free_space: 10033823744 - name: local - type: VMFS - - capacity: 42314215424 - datastore: datastore-1017 - free_space: 40374927360 - name: ro_datastore - type: NFS - - capacity: 42314215424 - datastore: datastore-1019 - free_space: 40374927360 - name: rw_datastore - type: NFS - type: list """ # This structure describes the format of the data expected by the end-points @@ -183,10 +156,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_folder_info.py b/plugins/modules/vcenter_folder_info.py index 485c986f6..52f56c83f 100644 --- a/plugins/modules/vcenter_folder_info.py +++ b/plugins/modules/vcenter_folder_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -104,7 +101,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -114,29 +111,9 @@ """ EXAMPLES = r""" -- name: Build a list of all the folders - vmware.vmware_rest.vcenter_folder_info: - register: my_folders - -- name: Build a list of all the folders with the type VIRTUAL_MACHINE and called vm - vmware.vmware_rest.vcenter_folder_info: - filter_type: VIRTUAL_MACHINE - filter_names: - - vm - register: my_folders """ RETURN = r""" -# content generated by the update_return_section callback# task: Build a list of all the folders with the type VIRTUAL_MACHINE and called vm -value: - description: Build a list of all the folders with the type VIRTUAL_MACHINE and called - vm - returned: On success - sample: - - folder: group-v1002 - name: vm - type: VIRTUAL_MACHINE - type: list """ # This structure describes the format of the data expected by the end-points @@ -178,10 +155,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_host.py b/plugins/modules/vcenter_host.py index c4430ae18..58077a5ee 100644 --- a/plugins/modules/vcenter_host.py +++ b/plugins/modules/vcenter_host.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -122,7 +119,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -132,29 +129,13 @@ """ EXAMPLES = r""" -- name: Connect the host(s) - vmware.vmware_rest.vcenter_host: - hostname: "{{ lookup('env', 'ESXI1_HOSTNAME') }}" - user_name: "{{ lookup('env', 'ESXI1_USERNAME') }}" - password: "{{ lookup('env', 'ESXI1_PASSWORD') }}" - thumbprint_verification: NONE - folder: '{{ my_host_folder.folder }}' """ RETURN = r""" -# content generated by the update_return_section callback# task: Connect the host(s) -value: - description: Connect the host(s) - returned: On success - sample: host-1013 - type: str """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"host": "host"}}, - "disconnect": {"query": {}, "body": {}, "path": {"host": "host"}}, - "connect": {"query": {}, "body": {}, "path": {"host": "host"}}, "create": { "query": {}, "body": { @@ -169,6 +150,9 @@ }, "path": {}, }, + "delete": {"query": {}, "body": {}, "path": {"host": "host"}}, + "connect": {"query": {}, "body": {}, "path": {"host": "host"}}, + "disconnect": {"query": {}, "body": {}, "path": {"host": "host"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -199,10 +183,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_host_info.py b/plugins/modules/vcenter_host_info.py index 1382d0c58..f7d3e2178 100644 --- a/plugins/modules/vcenter_host_info.py +++ b/plugins/modules/vcenter_host_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -107,7 +104,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -117,22 +114,9 @@ """ EXAMPLES = r""" -- name: Get a list of the hosts - vmware.vmware_rest.vcenter_host_info: - register: my_hosts """ RETURN = r""" -# content generated by the update_return_section callback# task: Get a list of the hosts -value: - description: Get a list of the hosts - returned: On success - sample: - - connection_state: CONNECTED - host: host-1013 - name: esxi1.test - power_state: POWERED_ON - type: list """ # This structure describes the format of the data expected by the end-points @@ -178,10 +162,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_network_info.py b/plugins/modules/vcenter_network_info.py index b5f938f30..bbd09b52c 100644 --- a/plugins/modules/vcenter_network_info.py +++ b/plugins/modules/vcenter_network_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -97,7 +94,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -107,32 +104,9 @@ """ EXAMPLES = r""" -- name: Get the dvswitch called my-portgroup - vmware.vmware_rest.vcenter_network_info: - filter_types: DISTRIBUTED_PORTGROUP - filter_names: my portrgoup - register: my_portgroup """ RETURN = r""" -# content generated by the update_return_section callback# task: Get a list of the networks -value: - description: Get a list of the networks - returned: On success - sample: - - name: VM Network - network: network-1016 - type: STANDARD_PORTGROUP - - name: second_vswitch - network: network-1018 - type: STANDARD_PORTGROUP - - name: dvswitch1-DVUplinks-1020 - network: dvportgroup-1021 - type: DISTRIBUTED_PORTGROUP - - name: my portrgoup - network: dvportgroup-1022 - type: DISTRIBUTED_PORTGROUP - type: list """ # This structure describes the format of the data expected by the end-points @@ -174,10 +148,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_ovf_libraryitem.py b/plugins/modules/vcenter_ovf_libraryitem.py index f93e79d34..740bfc6b6 100644 --- a/plugins/modules/vcenter_ovf_libraryitem.py +++ b/plugins/modules/vcenter_ovf_libraryitem.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -179,7 +176,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -189,103 +186,13 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - register: my_vm - -- name: Create a content library pointing on a NFS share - vmware.vmware_rest.content_locallibrary: - name: my_library_on_nfs - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - storage_uri: nfs://datastore.test/srv/share/content-library - type: OTHER - state: present - register: nfs_lib - -- name: Export the VM as an OVF on the library - vmware.vmware_rest.vcenter_ovf_libraryitem: - session_timeout: 2900 - source: - type: VirtualMachine - id: '{{ my_vm.id }}' - target: - library_id: '{{ nfs_lib.id }}' - create_spec: - name: golden_image - description: an OVF example - flags: [] - state: present - register: ovf_item - -- name: Get the list of items of the NFS library - vmware.vmware_rest.content_library_item_info: - library_id: '{{ nfs_lib.id }}' - register: lib_items - -- name: Create a new VM from the OVF - vmware.vmware_rest.vcenter_ovf_libraryitem: - ovf_library_item_id: '{{ (lib_items.value|selectattr("name", "equalto", "golden_image")|first).id }}' - state: deploy - target: - resource_pool_id: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - deployment_spec: - name: my_vm_from_ovf - accept_all_EULA: true - storage_provisioning: thin - -- name: Create a new VM from the OVF and specify the host and folder - vmware.vmware_rest.vcenter_ovf_libraryitem: - ovf_library_item_id: '{{ (lib_items.value|selectattr("name", "equalto", "golden_image")|first).id }}' - state: deploy - target: - resource_pool_id: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - folder_id: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - host_id: "{{ lookup('vmware.vmware_rest.host_moid', '/my_dc/host/my_cluster/esxi1.test/test_vm1') }}" - deployment_spec: - name: my_vm_from_ovf_on_a_host - accept_all_EULA: true - storage_provisioning: thin """ RETURN = r""" -# content generated by the update_return_section callback# task: Create a new VM from the OVF and specify the host and folder -value: - description: Create a new VM from the OVF and specify the host and folder - returned: On success - sample: - error: - errors: [] - information: [] - warnings: [] - resource_id: - id: vm-1078 - type: VirtualMachine - succeeded: 1 - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "filter": { - "query": {}, - "body": {"target": "target"}, - "path": {"ovf_library_item_id": "ovf_library_item_id"}, - }, "create": { "query": {"client_token": "client_token"}, "body": {"create_spec": "create_spec", "source": "source", "target": "target"}, @@ -296,6 +203,11 @@ "body": {"deployment_spec": "deployment_spec", "target": "target"}, "path": {"ovf_library_item_id": "ovf_library_item_id"}, }, + "filter": { + "query": {}, + "body": {"target": "target"}, + "path": {"ovf_library_item_id": "ovf_library_item_id"}, + }, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -326,10 +238,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_resourcepool.py b/plugins/modules/vcenter_resourcepool.py index b5a31b187..e1ad625a6 100644 --- a/plugins/modules/vcenter_resourcepool.py +++ b/plugins/modules/vcenter_resourcepool.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -148,7 +145,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.3.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -158,105 +155,32 @@ """ EXAMPLES = r""" -- name: Get the existing resource pools - vmware.vmware_rest.vcenter_resourcepool_info: - register: resource_pools - -- name: Create an Ad hoc resource pool - vmware.vmware_rest.vcenter_resourcepool: - name: my_resource_pool - parent: '{{ resource_pools.value[0].resource_pool }}' - cpu_allocation: - expandable_reservation: true - limit: 40 - reservation: 0 - shares: - level: NORMAL - memory_allocation: - expandable_reservation: false - limit: 2000 - reservation: 0 - shares: - level: NORMAL - register: my_resource_pool - -- name: Remove a resource pool - vmware.vmware_rest.vcenter_resourcepool: - resource_pool: '{{ my_resource_pool.id }}' - state: absent - -- name: Create a generic resource pool - vmware.vmware_rest.vcenter_resourcepool: - name: my_resource_pool - parent: '{{ resource_pools.value[0].resource_pool }}' - register: my_resource_pool - -- name: Modify a resource pool - vmware.vmware_rest.vcenter_resourcepool: - resource_pool: '{{ my_resource_pool.id }}' - cpu_allocation: - expandable_reservation: true - limit: -1 - reservation: 0 - shares: - level: NORMAL - memory_allocation: - expandable_reservation: false - limit: 1000 - reservation: 0 - shares: - level: NORMAL """ RETURN = r""" -# content generated by the update_return_section callback# task: Create a generic resource pool -id: - description: moid of the resource - returned: On success - sample: resgroup-1009 - type: str -value: - description: Create a generic resource pool - returned: On success - sample: - cpu_allocation: - expandable_reservation: 1 - limit: -1 - reservation: 0 - shares: - level: NORMAL - memory_allocation: - expandable_reservation: 1 - limit: -1 - reservation: 0 - shares: - level: NORMAL - name: my_resource_pool - resource_pools: [] - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"resource_pool": "resource_pool"}}, - "update": { + "create": { "query": {}, "body": { "cpu_allocation": "cpu_allocation", "memory_allocation": "memory_allocation", "name": "name", + "parent": "parent", }, - "path": {"resource_pool": "resource_pool"}, + "path": {}, }, - "create": { + "delete": {"query": {}, "body": {}, "path": {"resource_pool": "resource_pool"}}, + "update": { "query": {}, "body": { "cpu_allocation": "cpu_allocation", "memory_allocation": "memory_allocation", "name": "name", - "parent": "parent", }, - "path": {}, + "path": {"resource_pool": "resource_pool"}, }, } # pylint: disable=line-too-long @@ -288,10 +212,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_resourcepool_info.py b/plugins/modules/vcenter_resourcepool_info.py index 0d490db5f..d5a1ca0bd 100644 --- a/plugins/modules/vcenter_resourcepool_info.py +++ b/plugins/modules/vcenter_resourcepool_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -107,7 +104,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.3.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -117,53 +114,9 @@ """ EXAMPLES = r""" -- name: Get the existing resource pools - vmware.vmware_rest.vcenter_resourcepool_info: - register: resource_pools - -- name: Get the existing resource pool - vmware.vmware_rest.vcenter_resourcepool_info: - resource_pool: '{{ resource_pools.value[0].resource_pool }}' - register: my_resource_pool - -- name: Create a generic resource pool - vmware.vmware_rest.vcenter_resourcepool: - name: my_resource_pool - parent: '{{ resource_pools.value[0].resource_pool }}' - register: my_resource_pool - -- name: Read details from a specific resource pool - vmware.vmware_rest.vcenter_resourcepool_info: - resource_pool: '{{ my_resource_pool.id }}' - register: my_resource_pool """ RETURN = r""" -# content generated by the update_return_section callback# task: Read details from a specific resource pool -id: - description: moid of the resource - returned: On success - sample: resgroup-1009 - type: str -value: - description: Read details from a specific resource pool - returned: On success - sample: - cpu_allocation: - expandable_reservation: 1 - limit: -1 - reservation: 0 - shares: - level: NORMAL - memory_allocation: - expandable_reservation: 0 - limit: 1000 - reservation: 0 - shares: - level: NORMAL - name: my_resource_pool - resource_pools: [] - type: dict """ # This structure describes the format of the data expected by the end-points @@ -209,10 +162,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_storage_policies_info.py b/plugins/modules/vcenter_storage_policies_info.py index 1ae525a00..47000d381 100644 --- a/plugins/modules/vcenter_storage_policies_info.py +++ b/plugins/modules/vcenter_storage_policies_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -70,7 +67,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.3.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -80,54 +77,9 @@ """ EXAMPLES = r""" -- name: List existing storage policies - vmware.vmware_rest.vcenter_storage_policies_info: - register: storage_policies """ RETURN = r""" -# content generated by the update_return_section callback# task: List existing storage policies -value: - description: List existing storage policies - returned: On success - sample: - - description: Management Storage policy used for VMC large cluster - name: Management Storage Policy - Large - policy: cd8f7c94-3e11-67fc-17f5-4e96d91a5beb - - description: Allow the datastore to determine the best placement strategy for - storage objects - name: VVol No Requirements Policy - policy: f4e5bade-15a2-4805-bf8e-52318c4ce443 - - description: Management Storage policy used for smaller VMC Stretched Cluster - configuration. - name: Management Storage Policy - Stretched Lite - policy: d109de24-c966-428f-8da2-d281e6671e35 - - description: Sample storage policy for VMware's VM and virtual disk encryption - name: VM Encryption Policy - policy: 4d5f673c-536f-11e6-beb8-9e71128cae77 - - description: Management Storage policy used for encrypting VM - name: Management Storage policy - Encryption - policy: b1263970-8662-69e2-adc6-fa8ae01abecc - - description: Management Storage policy used for VMC single node cluster - name: Management Storage Policy - Single Node - policy: a9423670-7455-11e8-adc0-fa7ae01bbebc - - description: Storage policy used as default for Host-local PMem datastores - name: Host-local PMem Default Storage Policy - policy: c268da1b-b343-49f7-a468-b1deeb7078e0 - - description: Storage policy used as default for vSAN datastores - name: vSAN Default Storage Policy - policy: aa6d5a82-1c88-45da-85d3-3d74b91a5bad - - description: Management Storage policy used for VMC regular cluster - name: Management Storage Policy - Regular - policy: bb7e6b13-2d99-46eb-96e4-3d85c91a5bde - - description: Management Storage policy used for VMC regular cluster which requires - THIN provisioning - name: Management Storage policy - Thin - policy: b6423670-8552-66e8-adc1-fa6ae01abeac - - description: Management Storage policy used for VMC stretched cluster - name: Management Storage Policy - Stretched - policy: f31f2442-8247-4517-87c2-8d69d7a6c696 - type: list """ # This structure describes the format of the data expected by the end-points @@ -159,10 +111,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm.py b/plugins/modules/vcenter_vm.py index 70740932b..cfc437aa8 100644 --- a/plugins/modules/vcenter_vm.py +++ b/plugins/modules/vcenter_vm.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -754,7 +751,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -764,269 +761,13 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - register: my_vm - -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Create a content library based on a DataStore - vmware.vmware_rest.content_locallibrary: - name: my_library_on_datastore - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - type: DATASTORE - state: present - register: nfs_lib - -- name: Get the list of items of the NFS library - vmware.vmware_rest.content_library_item_info: - library_id: '{{ nfs_lib.id }}' - register: lib_items - -- name: Use the name to identify the item - set_fact: - my_template_item: "{{ lib_items.value | selectattr('name', 'equalto', 'golden-template')|first }}" - -- name: Deploy a new VM based on the template - vmware.vmware_rest.vcenter_vmtemplate_libraryitems: - name: vm-from-template - library: '{{ nfs_lib.id }}' - template_library_item: '{{ my_template_item.id }}' - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - state: deploy - register: my_new_vm - -- name: Retrieve all the details about the new VM - vmware.vmware_rest.vcenter_vm: - vm: '{{ my_new_vm.value }}' - register: my_new_vm_info - -- name: Create an instant clone of a VM - vmware.vmware_rest.vcenter_vm: - placement: - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - source: '{{ my_vm.id }}' - name: test_vm2 - state: instant_clone - register: my_instant_clone - -- name: Create a clone of a VM - vmware.vmware_rest.vcenter_vm: - placement: - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - source: '{{ my_vm.id }}' - name: test_vm3 - state: clone - register: my_clone_vm - -- name: Build a list of all the clusters - vmware.vmware_rest.vcenter_cluster_info: - register: all_the_clusters - -- name: Retrieve details about the first cluster - vmware.vmware_rest.vcenter_cluster_info: - cluster: '{{ all_the_clusters.value[0].cluster }}' - register: my_cluster_info - -- name: Build a list of all the folders with the type VIRTUAL_MACHINE and called vm - vmware.vmware_rest.vcenter_folder_info: - filter_type: VIRTUAL_MACHINE - filter_names: - - vm - register: my_folders - -- name: Set my_virtual_machine_folder - ansible.builtin.set_fact: - my_virtual_machine_folder: '{{ my_folders.value|first }}' - -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: '{{ my_cluster_info.id }}' - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: '{{ my_virtual_machine_folder.folder }}' - resource_pool: '{{ my_cluster_info.value.resource_pool }}' - name: test_vm1 - guest_OS: DEBIAN_7_64 - hardware_version: VMX_10 - memory: - hot_add_enabled: true - size_MiB: 1024 - register: my_vm """ RETURN = r""" -# content generated by the update_return_section callback# task: Create an instant clone of a VM -id: - description: moid of the resource - returned: On success - sample: vm-1104 - type: str -value: - description: Create an instant clone of a VM - returned: On success - sample: - boot: - delay: 0 - enter_setup_mode: 0 - retry: 0 - retry_delay: 10000 - type: BIOS - boot_devices: [] - cdroms: - '16002': - allow_guest_control: 0 - backing: - auto_detect: 1 - device_access_type: EMULATION - type: HOST_DEVICE - label: CD/DVD drive 1 - sata: - bus: 0 - unit: 2 - start_connected: 0 - state: NOT_CONNECTED - type: SATA - cpu: - cores_per_socket: 1 - count: 1 - hot_add_enabled: 0 - hot_remove_enabled: 0 - disks: - '16000': - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm2/test_vm2_2.vmdk' - capacity: 16106127360 - label: Hard disk 1 - sata: - bus: 0 - unit: 0 - type: SATA - '16001': - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm2/test_vm2_1.vmdk' - capacity: 32000000000 - label: Hard disk 2 - sata: - bus: 0 - unit: 1 - type: SATA - floppies: {} - guest_OS: RHEL_7_64 - hardware: - upgrade_policy: NEVER - upgrade_status: NONE - version: VMX_11 - identity: - bios_uuid: 4231bf8b-3cb4-3a3f-1bfb-18c857ce95b6 - instance_uuid: 5031b322-6030-a020-8e73-1a9ad0fd03ce - name: test_vm2 - instant_clone_frozen: 0 - memory: - hot_add_enabled: 1 - hot_add_increment_size_MiB: 128 - hot_add_limit_MiB: 3072 - size_MiB: 1024 - name: test_vm2 - nics: - '4000': - allow_guest_control: 0 - backing: - network: network-1095 - network_name: VM Network - type: STANDARD_PORTGROUP - label: Network adapter 1 - mac_address: 00:50:56:b1:26:0c - mac_type: ASSIGNED - pci_slot_number: 160 - start_connected: 0 - state: NOT_CONNECTED - type: VMXNET3 - upt_compatibility_enabled: 0 - wake_on_lan_enabled: 0 - nvme_adapters: {} - parallel_ports: {} - power_state: POWERED_ON - sata_adapters: - '15000': - bus: 0 - label: SATA controller 0 - pci_slot_number: 32 - type: AHCI - scsi_adapters: {} - serial_ports: {} - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "register": { - "query": {}, - "body": { - "datastore": "datastore", - "datastore_path": "datastore_path", - "name": "name", - "path": "path", - "placement": "placement", - }, - "path": {}, - }, "create": { "query": {}, "body": { @@ -1050,12 +791,18 @@ }, "path": {}, }, - "relocate": { + "register": { "query": {}, - "body": {"disks": "disks", "placement": "placement"}, - "path": {"vm": "vm"}, + "body": { + "datastore": "datastore", + "datastore_path": "datastore_path", + "name": "name", + "path": "path", + "placement": "placement", + }, + "path": {}, }, - "delete": {"query": {}, "body": {}, "path": {"vm": "vm"}}, + "unregister": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "clone": { "query": {}, "body": { @@ -1069,6 +816,7 @@ }, "path": {}, }, + "delete": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "instant_clone": { "query": {}, "body": { @@ -1083,7 +831,11 @@ }, "path": {}, }, - "unregister": {"query": {}, "body": {}, "path": {"vm": "vm"}}, + "relocate": { + "query": {}, + "body": {"disks": "disks", "placement": "placement"}, + "path": {"vm": "vm"}, + }, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -1114,10 +866,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_customization.py b/plugins/modules/vcenter_vm_guest_customization.py index 288399a91..fa5481645 100644 --- a/plugins/modules/vcenter_vm_guest_customization.py +++ b/plugins/modules/vcenter_vm_guest_customization.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -165,7 +162,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -175,36 +172,9 @@ """ EXAMPLES = r""" -- name: Customize the VM - vmware.vmware_rest.vcenter_vm_guest_customization: - vm: "{{ lookup('vmware.vmware_rest.vm_moid', '/my_dc/vm/test_vm1') }}" - configuration_spec: - linux_config: - domain: mydomain - hostname: - fixed_name: foobar - type: FIXED - interfaces: - - adapter: - ipv4: - type: STATIC - gateways: - - 192.168.123.1 - ip_address: 192.168.123.50 - prefix: 24 - global_DNS_settings: - dns_suffix_list: [] - dns_servers: - - 1.1.1.1 """ RETURN = r""" -# content generated by the update_return_section callback# task: Customize the VM -value: - description: Customize the VM - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -247,10 +217,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_filesystem_directories.py b/plugins/modules/vcenter_vm_guest_filesystem_directories.py index 296a6610d..8cd4b06b1 100644 --- a/plugins/modules/vcenter_vm_guest_filesystem_directories.py +++ b/plugins/modules/vcenter_vm_guest_filesystem_directories.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -137,7 +134,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -147,49 +144,6 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Create a directory in /tmp - vmware.vmware_rest.vcenter_vm_guest_filesystem_directories: - vm: '{{ my_vm.id }}' - path: /tmp/my/path - create_parents: true - credentials: - interactive_session: false - type: USERNAME_PASSWORD - user_name: root - password: root """ RETURN = r""" @@ -197,9 +151,14 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "move": { + "create_temporary": { "query": {}, - "body": {"credentials": "credentials", "new_path": "new_path", "path": "path"}, + "body": { + "credentials": "credentials", + "parent_path": "parent_path", + "prefix": "prefix", + "suffix": "suffix", + }, "path": {"vm": "vm"}, }, "create": { @@ -220,14 +179,9 @@ }, "path": {"vm": "vm"}, }, - "create_temporary": { + "move": { "query": {}, - "body": { - "credentials": "credentials", - "parent_path": "parent_path", - "prefix": "prefix", - "suffix": "suffix", - }, + "body": {"credentials": "credentials", "new_path": "new_path", "path": "path"}, "path": {"vm": "vm"}, }, } # pylint: disable=line-too-long @@ -260,10 +214,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_identity_info.py b/plugins/modules/vcenter_vm_guest_identity_info.py index b36e0592b..b65d28a13 100644 --- a/plugins/modules/vcenter_vm_guest_identity_info.py +++ b/plugins/modules/vcenter_vm_guest_identity_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,37 +73,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get guest identity information - vmware.vmware_rest.vcenter_vm_guest_identity_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get guest identity information -value: - description: Get guest identity information - returned: On success - sample: - family: LINUX - full_name: - args: [] - default_message: Red Hat Fedora (64-bit) - id: vmsg.guestos.fedora64Guest.label - host_name: localhost.localdomain - name: FEDORA_64 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -138,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_localfilesystem_info.py b/plugins/modules/vcenter_vm_guest_localfilesystem_info.py index 560ab7437..596bc7f96 100644 --- a/plugins/modules/vcenter_vm_guest_localfilesystem_info.py +++ b/plugins/modules/vcenter_vm_guest_localfilesystem_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -67,7 +64,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -77,38 +74,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get guest filesystem information - vmware.vmware_rest.vcenter_vm_guest_localfilesystem_info: - vm: '{{ test_vm1_info.id }}' - register: _result - until: - - _result is not failed - retries: 60 - delay: 5 """ RETURN = r""" -# content generated by the update_return_section callback# task: Get guest filesystem information -value: - description: Get guest filesystem information - returned: On success - sample: - /: - capacity: 2515173376 - free_space: 774787072 - mappings: [] - type: dict """ # This structure describes the format of the data expected by the end-points @@ -140,10 +108,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_networking_info.py b/plugins/modules/vcenter_vm_guest_networking_info.py index 45c834d6e..dd8ceff87 100644 --- a/plugins/modules/vcenter_vm_guest_networking_info.py +++ b/plugins/modules/vcenter_vm_guest_networking_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -68,7 +65,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -78,38 +75,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get guest networking information - vmware.vmware_rest.vcenter_vm_guest_networking_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get guest networking information -value: - description: Get guest networking information - returned: On success - sample: - dns: - ip_addresses: - - 10.0.2.3 - search_domains: - - localdomain - dns_values: - domain_name: localdomain - host_name: localhost.localdomain - type: dict """ # This structure describes the format of the data expected by the end-points @@ -141,10 +109,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py b/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py index 1752ec95d..aaee7595f 100644 --- a/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py +++ b/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -68,7 +65,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -78,34 +75,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get guest network interfaces information - vmware.vmware_rest.vcenter_vm_guest_networking_interfaces_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get guest network interfaces information -value: - description: Get guest network interfaces information - returned: On success - sample: - - ip: - ip_addresses: [] - mac_address: 00:50:56:b1:33:76 - nic: '4000' - type: list """ # This structure describes the format of the data expected by the end-points @@ -137,10 +109,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_networking_routes_info.py b/plugins/modules/vcenter_vm_guest_networking_routes_info.py index bab188e8f..5fec0172b 100644 --- a/plugins/modules/vcenter_vm_guest_networking_routes_info.py +++ b/plugins/modules/vcenter_vm_guest_networking_routes_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -67,7 +64,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -77,30 +74,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get guest network routes information - vmware.vmware_rest.vcenter_vm_guest_networking_routes_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get guest network routes information -value: - description: Get guest network routes information - returned: On success - sample: [] - type: list """ # This structure describes the format of the data expected by the end-points @@ -132,10 +108,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_operations_info.py b/plugins/modules/vcenter_vm_guest_operations_info.py index ac17c2f89..05fff0aca 100644 --- a/plugins/modules/vcenter_vm_guest_operations_info.py +++ b/plugins/modules/vcenter_vm_guest_operations_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.0.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -110,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_power.py b/plugins/modules/vcenter_vm_guest_power.py index 9120120e0..ce697f0f7 100644 --- a/plugins/modules/vcenter_vm_guest_power.py +++ b/plugins/modules/vcenter_vm_guest_power.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -78,7 +75,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -91,59 +88,16 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Shut down the VM - vmware.vmware_rest.vcenter_vm_guest_power: - state: shutdown - vm: '{{ my_vm.id }}' """ RETURN = r""" -# content generated by the update_return_section callback# task: Shut down the VM -value: - description: Shut down the VM - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { "shutdown": {"query": {}, "body": {}, "path": {"vm": "vm"}}, - "reboot": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "standby": {"query": {}, "body": {}, "path": {"vm": "vm"}}, + "reboot": {"query": {}, "body": {}, "path": {"vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -173,10 +127,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_guest_power_info.py b/plugins/modules/vcenter_vm_guest_power_info.py index 318ee809f..b8b0aa3fd 100644 --- a/plugins/modules/vcenter_vm_guest_power_info.py +++ b/plugins/modules/vcenter_vm_guest_power_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,53 +73,9 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Read the power status of the VM - vmware.vmware_rest.vcenter_vm_guest_power_info: - vm: '{{ my_vm.id }}' """ RETURN = r""" -# content generated by the update_return_section callback# task: Read the power status of the VM -value: - description: Read the power status of the VM - returned: On success - sample: - operations_ready: 0 - state: NOT_RUNNING - type: dict """ # This structure describes the format of the data expected by the end-points @@ -154,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware.py b/plugins/modules/vcenter_vm_hardware.py index d33d67f2b..d987868a3 100644 --- a/plugins/modules/vcenter_vm_hardware.py +++ b/plugins/modules/vcenter_vm_hardware.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -129,7 +126,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -139,30 +136,14 @@ """ EXAMPLES = r""" -- name: Upgrade the VM hardware version - vmware.vmware_rest.vcenter_vm_hardware: - upgrade_policy: AFTER_CLEAN_SHUTDOWN - upgrade_version: VMX_11 - vm: "{{ lookup('vmware.vmware_rest.vm_moid', '/my_dc/vm/test_vm1') }}" - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Upgrade the VM hardware version -id: - description: moid of the resource - returned: On success - sample: null - type: dict -value: - description: Upgrade the VM hardware version - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { + "upgrade": {"query": {}, "body": {"version": "version"}, "path": {"vm": "vm"}}, "update": { "query": {}, "body": { @@ -171,7 +152,6 @@ }, "path": {"vm": "vm"}, }, - "upgrade": {"query": {}, "body": {"version": "version"}, "path": {"vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -201,10 +181,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_adapter_sata.py b/plugins/modules/vcenter_vm_hardware_adapter_sata.py index ef65783b5..8008ba1a1 100644 --- a/plugins/modules/vcenter_vm_hardware_adapter_sata.py +++ b/plugins/modules/vcenter_vm_hardware_adapter_sata.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -23,7 +20,6 @@ description: - SATA bus number. type: int - default: 0 label: description: - The name of the item @@ -97,7 +93,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -107,46 +103,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Create a SATA adapter at PCI slot 34 - vmware.vmware_rest.vcenter_vm_hardware_adapter_sata: - vm: '{{ test_vm1_info.id }}' - pci_slot_number: 34 - register: _sata_adapter_result_1 - -- name: Remove SATA adapter at PCI slot 34 - vmware.vmware_rest.vcenter_vm_hardware_adapter_sata: - vm: '{{ test_vm1_info.id }}' - pci_slot_number: 34 - state: absent """ RETURN = r""" -# content generated by the update_return_section callback# task: Create a SATA adapter at PCI slot 34 -id: - description: moid of the resource - returned: On success - sample: '15000' - type: str -value: - description: Create a SATA adapter at PCI slot 34 - returned: On success - sample: - bus: 0 - label: SATA controller 0 - pci_slot_number: 34 - type: AHCI - type: dict """ # This structure describes the format of the data expected by the end-points @@ -187,10 +146,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py b/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py index d437c66da..bfd263e7b 100644 --- a/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py +++ b/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,43 +82,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get information about a specific controller - vmware.vmware_rest.vcenter_vm_hardware_adapter_sata_info: - vm: '{{ test_vm1_info.id }}' - adapter: '{{ _sata_adapter_result_1.id }}' - -- name: List the controller - vmware.vmware_rest.vcenter_vm_hardware_adapter_sata_info: - vm: '{{ test_vm1_info.id }}' """ RETURN = r""" -# content generated by the update_return_section callback# task: Get information about a specific controller -id: - description: moid of the resource - returned: On success - sample: '15000' - type: str -value: - description: Get information about a specific controller - returned: On success - sample: - bus: 0 - label: SATA controller 0 - pci_slot_number: 34 - type: AHCI - type: dict """ # This structure describes the format of the data expected by the end-points @@ -156,10 +119,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_adapter_scsi.py b/plugins/modules/vcenter_vm_hardware_adapter_scsi.py index 71f3e0d05..7219d3119 100644 --- a/plugins/modules/vcenter_vm_hardware_adapter_scsi.py +++ b/plugins/modules/vcenter_vm_hardware_adapter_scsi.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -23,7 +20,6 @@ description: - SCSI bus number. type: int - default: 0 label: description: - The name of the item @@ -110,7 +106,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -120,60 +116,13 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Create a SCSI adapter at PCI slot 35 - vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi: - vm: '{{ test_vm1_info.id }}' - pci_slot_number: 35 - register: _scsi_adapter_result_1 - -- name: Drop the SCSI controller - vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi: - vm: '{{ test_vm1_info.id }}' - pci_slot_number: 35 - state: absent - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Create a SCSI adapter at PCI slot 35 -id: - description: moid of the resource - returned: On success - sample: '1000' - type: str -value: - description: Create a SCSI adapter at PCI slot 35 - returned: On success - sample: - label: SCSI controller 0 - pci_slot_number: 35 - scsi: - bus: 0 - unit: 7 - sharing: NONE - type: PVSCSI - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"adapter": "adapter", "vm": "vm"}}, - "update": { - "query": {}, - "body": {"sharing": "sharing"}, - "path": {"adapter": "adapter", "vm": "vm"}, - }, "create": { "query": {}, "body": { @@ -184,6 +133,12 @@ }, "path": {"vm": "vm"}, }, + "delete": {"query": {}, "body": {}, "path": {"adapter": "adapter", "vm": "vm"}}, + "update": { + "query": {}, + "body": {"sharing": "sharing"}, + "path": {"adapter": "adapter", "vm": "vm"}, + }, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -214,10 +169,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py b/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py index 04c2a1090..d2afc1ebc 100644 --- a/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py +++ b/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,31 +82,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: List the SCSI adapter of a given VM - vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: List the SCSI adapter of a given VM -value: - description: List the SCSI adapter of a given VM - returned: On success - sample: - - adapter: '1000' - type: list """ # This structure describes the format of the data expected by the end-points @@ -144,10 +119,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_boot.py b/plugins/modules/vcenter_vm_hardware_boot.py index c282ae1ec..8ce764ae5 100644 --- a/plugins/modules/vcenter_vm_hardware_boot.py +++ b/plugins/modules/vcenter_vm_hardware_boot.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -117,7 +114,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -127,37 +124,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Change a VM boot parameters - vmware.vmware_rest.vcenter_vm_hardware_boot: - vm: '{{ test_vm1_info.id }}' - efi_legacy_boot: true - type: EFI - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Change a VM boot parameters -id: - description: moid of the resource - returned: On success - sample: null - type: dict -value: - description: Change a VM boot parameters - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -201,10 +170,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_boot_device.py b/plugins/modules/vcenter_vm_hardware_boot_device.py index 64254ef18..6b57350d6 100644 --- a/plugins/modules/vcenter_vm_hardware_boot_device.py +++ b/plugins/modules/vcenter_vm_hardware_boot_device.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -98,7 +95,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -108,32 +105,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Set a boot device - vmware.vmware_rest.vcenter_vm_hardware_boot_device: - vm: '{{ test_vm1_info.id }}' - devices: - - type: CDROM - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Set a boot device -value: - description: Set a boot device - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -168,10 +142,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_boot_device_info.py b/plugins/modules/vcenter_vm_hardware_boot_device_info.py index 6643e0e5c..8b85247bf 100644 --- a/plugins/modules/vcenter_vm_hardware_boot_device_info.py +++ b/plugins/modules/vcenter_vm_hardware_boot_device_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -67,7 +64,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -77,36 +74,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get boot device info - vmware.vmware_rest.vcenter_vm_hardware_boot_device_info: - vm: '{{ test_vm1_info.id }}' - register: _result - -- name: Get information about the boot device - vmware.vmware_rest.vcenter_vm_hardware_boot_device_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get information about the boot device -value: - description: Get information about the boot device - returned: On success - sample: - - type: CDROM - type: list """ # This structure describes the format of the data expected by the end-points @@ -138,10 +108,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_boot_info.py b/plugins/modules/vcenter_vm_hardware_boot_info.py index 4d5a2b003..4fc546bfe 100644 --- a/plugins/modules/vcenter_vm_hardware_boot_info.py +++ b/plugins/modules/vcenter_vm_hardware_boot_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,34 +73,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Retrieve the boot information from the VM - vmware.vmware_rest.vcenter_vm_hardware_boot_info: - vm: '{{ test_vm1_info.id }}' """ RETURN = r""" -# content generated by the update_return_section callback# task: Retrieve the boot information from the VM -value: - description: Retrieve the boot information from the VM - returned: On success - sample: - delay: 0 - enter_setup_mode: 0 - retry: 0 - retry_delay: 10000 - type: BIOS - type: dict """ # This structure describes the format of the data expected by the end-points @@ -135,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_cdrom.py b/plugins/modules/vcenter_vm_hardware_cdrom.py index 44f412d3f..e31298b35 100644 --- a/plugins/modules/vcenter_vm_hardware_cdrom.py +++ b/plugins/modules/vcenter_vm_hardware_cdrom.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -144,7 +141,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -154,67 +151,13 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Attach an ISO image to a guest VM - vmware.vmware_rest.vcenter_vm_hardware_cdrom: - vm: '{{ test_vm1_info.id }}' - type: SATA - sata: - bus: 0 - unit: 2 - start_connected: true - backing: - iso_file: '[ro_datastore] fedora.iso' - type: ISO_FILE - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Attach an ISO image to a guest VM -id: - description: moid of the resource - returned: On success - sample: '16002' - type: str -value: - description: Attach an ISO image to a guest VM - returned: On success - sample: - allow_guest_control: 0 - backing: - iso_file: '[ro_datastore] fedora.iso' - type: ISO_FILE - label: CD/DVD drive 1 - sata: - bus: 0 - unit: 2 - start_connected: 1 - state: NOT_CONNECTED - type: SATA - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "update": { - "query": {}, - "body": { - "allow_guest_control": "allow_guest_control", - "backing": "backing", - "start_connected": "start_connected", - }, - "path": {"cdrom": "cdrom", "vm": "vm"}, - }, "create": { "query": {}, "body": { @@ -228,8 +171,17 @@ "path": {"vm": "vm"}, }, "delete": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, - "disconnect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, "connect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, + "update": { + "query": {}, + "body": { + "allow_guest_control": "allow_guest_control", + "backing": "backing", + "start_connected": "start_connected", + }, + "path": {"cdrom": "cdrom", "vm": "vm"}, + }, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -260,10 +212,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_cdrom_info.py b/plugins/modules/vcenter_vm_hardware_cdrom_info.py index 80ce96f10..b591dc48a 100644 --- a/plugins/modules/vcenter_vm_hardware_cdrom_info.py +++ b/plugins/modules/vcenter_vm_hardware_cdrom_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,30 +82,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: List the cdrom devices on the guest - vmware.vmware_rest.vcenter_vm_hardware_cdrom_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: List the cdrom devices on the guest -value: - description: List the cdrom devices on the guest - returned: On success - sample: [] - type: list """ # This structure describes the format of the data expected by the end-points @@ -143,10 +119,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_cpu.py b/plugins/modules/vcenter_vm_hardware_cpu.py index e4df035b5..902db69fa 100644 --- a/plugins/modules/vcenter_vm_hardware_cpu.py +++ b/plugins/modules/vcenter_vm_hardware_cpu.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -100,7 +97,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -110,40 +107,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Dedicate one core to the VM - vmware.vmware_rest.vcenter_vm_hardware_cpu: - vm: '{{ test_vm1_info.id }}' - count: 1 - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Dedicate one core to the VM -id: - description: moid of the resource - returned: On success - sample: null - type: dict -value: - description: Dedicate one core to the VM - returned: On success - sample: - cores_per_socket: 1 - count: 1 - hot_add_enabled: 0 - hot_remove_enabled: 0 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -184,10 +150,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_cpu_info.py b/plugins/modules/vcenter_vm_hardware_cpu_info.py index 8f422d88c..666f332d5 100644 --- a/plugins/modules/vcenter_vm_hardware_cpu_info.py +++ b/plugins/modules/vcenter_vm_hardware_cpu_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,34 +73,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Retrieve the CPU information from the VM - vmware.vmware_rest.vcenter_vm_hardware_cpu_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Retrieve the CPU information from the VM -value: - description: Retrieve the CPU information from the VM - returned: On success - sample: - cores_per_socket: 1 - count: 1 - hot_add_enabled: 0 - hot_remove_enabled: 0 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -135,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_disk.py b/plugins/modules/vcenter_vm_hardware_disk.py index e06729a21..8f1c637ca 100644 --- a/plugins/modules/vcenter_vm_hardware_disk.py +++ b/plugins/modules/vcenter_vm_hardware_disk.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -150,7 +147,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -160,64 +157,13 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Create a new disk - vmware.vmware_rest.vcenter_vm_hardware_disk: - vm: '{{ test_vm1_info.id }}' - type: SATA - new_vmdk: - capacity: 320000 - register: my_new_disk - -- name: Delete the disk - vmware.vmware_rest.vcenter_vm_hardware_disk: - vm: '{{ test_vm1_info.id }}' - disk: '{{ my_new_disk.id }}' - state: absent - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Create a new disk -id: - description: moid of the resource - returned: On success - sample: '16000' - type: str -value: - description: Create a new disk - returned: On success - sample: - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/test_vm1_1.vmdk' - capacity: 320000 - label: Hard disk 2 - sata: - bus: 0 - unit: 0 - type: SATA - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"disk": "disk", "vm": "vm"}}, - "update": { - "query": {}, - "body": {"backing": "backing"}, - "path": {"disk": "disk", "vm": "vm"}, - }, "create": { "query": {}, "body": { @@ -230,6 +176,12 @@ }, "path": {"vm": "vm"}, }, + "delete": {"query": {}, "body": {}, "path": {"disk": "disk", "vm": "vm"}}, + "update": { + "query": {}, + "body": {"backing": "backing"}, + "path": {"disk": "disk", "vm": "vm"}, + }, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -260,10 +212,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_disk_info.py b/plugins/modules/vcenter_vm_hardware_disk_info.py index 57f55e391..09834c8c0 100644 --- a/plugins/modules/vcenter_vm_hardware_disk_info.py +++ b/plugins/modules/vcenter_vm_hardware_disk_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,50 +82,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Retrieve the disk information from the VM - vmware.vmware_rest.vcenter_vm_hardware_disk_info: - vm: '{{ test_vm1_info.id }}' - register: _result - -- name: Retrieve disk information using the label - vmware.vmware_rest.vcenter_vm_hardware_disk_info: - vm: '{{ test_vm1_info.id }}' - label: Hard disk 1 - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Retrieve disk information using the label -id: - description: moid of the resource - returned: On success - sample: '2000' - type: str -value: - description: Retrieve disk information using the label - returned: On success - sample: - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/test_vm1.vmdk' - capacity: 17179869184 - label: Hard disk 1 - scsi: - bus: 0 - unit: 0 - type: SCSI - type: dict """ # This structure describes the format of the data expected by the end-points @@ -163,10 +119,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_ethernet.py b/plugins/modules/vcenter_vm_hardware_ethernet.py index d544f054e..6e50c2360 100644 --- a/plugins/modules/vcenter_vm_hardware_ethernet.py +++ b/plugins/modules/vcenter_vm_hardware_ethernet.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -164,7 +161,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -174,144 +171,44 @@ """ EXAMPLES = r""" -- name: Get the dvswitch called my-portgroup - vmware.vmware_rest.vcenter_network_info: - filter_types: DISTRIBUTED_PORTGROUP - filter_names: my portrgoup - register: my_portgroup - -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Attach a VM to a dvswitch - vmware.vmware_rest.vcenter_vm_hardware_ethernet: - vm: '{{ test_vm1_info.id }}' - pci_slot_number: 4 - backing: - type: DISTRIBUTED_PORTGROUP - network: '{{ my_portgroup.value[0].network }}' - start_connected: false - register: vm_hardware_ethernet_1 - -- name: Turn the NIC's start_connected flag on - vmware.vmware_rest.vcenter_vm_hardware_ethernet: - nic: '{{ vm_hardware_ethernet_1.id }}' - start_connected: true - vm: '{{ test_vm1_info.id }}' - -- name: Attach the VM to a standard portgroup - vmware.vmware_rest.vcenter_vm_hardware_ethernet: - vm: '{{ test_vm1_info.id }}' - pci_slot_number: 4 - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: _result - -- name: Attach the VM to a standard portgroup (again) - vmware.vmware_rest.vcenter_vm_hardware_ethernet: - vm: '{{ test_vm1_info.id }}' - pci_slot_number: 4 - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: _result - -- name: Collect a list of the NIC for a given VM - vmware.vmware_rest.vcenter_vm_hardware_ethernet_info: - vm: '{{ test_vm1_info.id }}' - register: vm_nic - -- name: Attach the VM to a standard portgroup (again) using the nic ID - vmware.vmware_rest.vcenter_vm_hardware_ethernet: - vm: '{{ test_vm1_info.id }}' - nic: '{{ vm_nic.value[0].nic }}' - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: _result - -- name: Attach to another standard portgroup - vmware.vmware_rest.vcenter_vm_hardware_ethernet: - vm: '{{ test_vm1_info.id }}' - nic: '{{ vm_nic.value[0].nic }}' - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/second_vswitch') }}" - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Attach a VM to a dvswitch -id: - description: moid of the resource - returned: On success - sample: '4000' - type: str -value: - description: Attach a VM to a dvswitch - returned: On success - sample: - allow_guest_control: 0 - backing: - connection_cookie: 632732945 - distributed_port: '2' - distributed_switch_uuid: 50 31 d3 c4 2d 09 4f e3-0f d6 7f 30 3d fe d4 a0 - network: dvportgroup-1022 - type: DISTRIBUTED_PORTGROUP - label: Network adapter 1 - mac_address: 00:50:56:b1:33:76 - mac_type: ASSIGNED - pci_slot_number: 4 - start_connected: 0 - state: NOT_CONNECTED - type: VMXNET3 - upt_compatibility_enabled: 0 - wake_on_lan_enabled: 0 - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "update": { + "create": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "mac_address": "mac_address", "mac_type": "mac_type", + "pci_slot_number": "pci_slot_number", "start_connected": "start_connected", + "type": "type", "upt_compatibility_enabled": "upt_compatibility_enabled", "wake_on_lan_enabled": "wake_on_lan_enabled", }, - "path": {"nic": "nic", "vm": "vm"}, + "path": {"vm": "vm"}, }, - "create": { + "delete": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, + "connect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, + "update": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "mac_address": "mac_address", "mac_type": "mac_type", - "pci_slot_number": "pci_slot_number", "start_connected": "start_connected", - "type": "type", "upt_compatibility_enabled": "upt_compatibility_enabled", "wake_on_lan_enabled": "wake_on_lan_enabled", }, - "path": {"vm": "vm"}, + "path": {"nic": "nic", "vm": "vm"}, }, - "delete": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, - "disconnect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, - "connect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -342,10 +239,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_ethernet_info.py b/plugins/modules/vcenter_vm_hardware_ethernet_info.py index 068df536d..27c6f5811 100644 --- a/plugins/modules/vcenter_vm_hardware_ethernet_info.py +++ b/plugins/modules/vcenter_vm_hardware_ethernet_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,35 +82,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Collect a list of the NIC for a given VM - vmware.vmware_rest.vcenter_vm_hardware_ethernet_info: - vm: '{{ test_vm1_info.id }}' - register: _result - -- name: Collect a list of the NIC for a given VM - vmware.vmware_rest.vcenter_vm_hardware_ethernet_info: - vm: '{{ test_vm1_info.id }}' - register: vm_nic """ RETURN = r""" -# content generated by the update_return_section callback# task: Collect a list of the NIC for a given VM -value: - description: Collect a list of the NIC for a given VM - returned: On success - sample: [] - type: list """ # This structure describes the format of the data expected by the end-points @@ -148,10 +119,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_floppy.py b/plugins/modules/vcenter_vm_hardware_floppy.py index 3c8c7f09d..4489d2d1f 100644 --- a/plugins/modules/vcenter_vm_hardware_floppy.py +++ b/plugins/modules/vcenter_vm_hardware_floppy.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -110,7 +107,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -120,76 +117,34 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Add a floppy disk drive - vmware.vmware_rest.vcenter_vm_hardware_floppy: - vm: '{{ test_vm1_info.id }}' - allow_guest_control: true - register: my_floppy_drive - -- name: Remove a floppy drive - vmware.vmware_rest.vcenter_vm_hardware_floppy: - vm: '{{ test_vm1_info.id }}' - floppy: '{{ my_floppy_drive.id }}' - state: absent - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Add a floppy disk drive -id: - description: moid of the resource - returned: On success - sample: '8000' - type: str -value: - description: Add a floppy disk drive - returned: On success - sample: - allow_guest_control: 1 - backing: - auto_detect: 1 - host_device: '' - type: HOST_DEVICE - label: Floppy drive 1 - start_connected: 0 - state: NOT_CONNECTED - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "update": { + "create": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "start_connected": "start_connected", }, - "path": {"floppy": "floppy", "vm": "vm"}, + "path": {"vm": "vm"}, }, - "create": { + "delete": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, + "connect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, + "update": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "start_connected": "start_connected", }, - "path": {"vm": "vm"}, + "path": {"floppy": "floppy", "vm": "vm"}, }, - "delete": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, - "disconnect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, - "connect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -220,10 +175,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_floppy_info.py b/plugins/modules/vcenter_vm_hardware_floppy_info.py index 8f4c39258..781d44576 100644 --- a/plugins/modules/vcenter_vm_hardware_floppy_info.py +++ b/plugins/modules/vcenter_vm_hardware_floppy_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,30 +82,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: List the floppy disk drives - vmware.vmware_rest.vcenter_vm_hardware_floppy_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: List the floppy disk drives -value: - description: List the floppy disk drives - returned: On success - sample: [] - type: list """ # This structure describes the format of the data expected by the end-points @@ -143,10 +119,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_info.py b/plugins/modules/vcenter_vm_hardware_info.py index 23002fe75..c3f242284 100644 --- a/plugins/modules/vcenter_vm_hardware_info.py +++ b/plugins/modules/vcenter_vm_hardware_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,28 +73,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect the hardware information - vmware.vmware_rest.vcenter_vm_hardware_info: - vm: '{{ search_result.value[0].vm }}' - register: my_vm1_hardware_info """ RETURN = r""" -# content generated by the update_return_section callback# task: Collect the hardware information -value: - description: Collect the hardware information - returned: On success - sample: - upgrade_policy: NEVER - upgrade_status: NONE - version: VMX_10 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -129,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_memory.py b/plugins/modules/vcenter_vm_hardware_memory.py index f10fc4e58..3b224d156 100644 --- a/plugins/modules/vcenter_vm_hardware_memory.py +++ b/plugins/modules/vcenter_vm_hardware_memory.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -90,7 +87,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -100,36 +97,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Increase the memory of a VM - vmware.vmware_rest.vcenter_vm_hardware_memory: - vm: '{{ test_vm1_info.id }}' - size_MiB: 1080 - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Increase the memory of a VM -id: - description: moid of the resource - returned: On success - sample: null - type: dict -value: - description: Increase the memory of a VM - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -165,10 +135,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_memory_info.py b/plugins/modules/vcenter_vm_hardware_memory_info.py index c0fe728a9..1e6f4b757 100644 --- a/plugins/modules/vcenter_vm_hardware_memory_info.py +++ b/plugins/modules/vcenter_vm_hardware_memory_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,32 +73,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Retrieve the memory information from the VM - vmware.vmware_rest.vcenter_vm_hardware_memory_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Retrieve the memory information from the VM -value: - description: Retrieve the memory information from the VM - returned: On success - sample: - hot_add_enabled: 1 - size_MiB: 1024 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -133,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_parallel.py b/plugins/modules/vcenter_vm_hardware_parallel.py index a96e19007..514315558 100644 --- a/plugins/modules/vcenter_vm_hardware_parallel.py +++ b/plugins/modules/vcenter_vm_hardware_parallel.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -109,7 +106,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -119,69 +116,34 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Turn on guest control on the parallel port - vmware.vmware_rest.vcenter_vm_hardware_parallel: - vm: '{{ test_vm1_info.id }}' - allow_guest_control: true - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Turn on guest control on the parallel port -id: - description: moid of the resource - returned: On success - sample: '10000' - type: str -value: - description: Turn on guest control on the parallel port - returned: On success - sample: - allow_guest_control: 1 - backing: - auto_detect: 1 - host_device: '' - type: HOST_DEVICE - label: Parallel port 1 - start_connected: 0 - state: NOT_CONNECTED - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "update": { + "create": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "start_connected": "start_connected", }, - "path": {"port": "port", "vm": "vm"}, + "path": {"vm": "vm"}, }, - "create": { + "delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "update": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "start_connected": "start_connected", }, - "path": {"vm": "vm"}, + "path": {"port": "port", "vm": "vm"}, }, - "delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, - "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, - "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -212,10 +174,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_parallel_info.py b/plugins/modules/vcenter_vm_hardware_parallel_info.py index ac6da9802..a8967ce95 100644 --- a/plugins/modules/vcenter_vm_hardware_parallel_info.py +++ b/plugins/modules/vcenter_vm_hardware_parallel_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,30 +82,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Retrieve the parallel port information from the VM - vmware.vmware_rest.vcenter_vm_hardware_parallel_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Retrieve the parallel port information from the VM -value: - description: Retrieve the parallel port information from the VM - returned: On success - sample: [] - type: list """ # This structure describes the format of the data expected by the end-points @@ -143,10 +119,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_serial.py b/plugins/modules/vcenter_vm_hardware_serial.py index 7eeebae38..9e4f53819 100644 --- a/plugins/modules/vcenter_vm_hardware_serial.py +++ b/plugins/modules/vcenter_vm_hardware_serial.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -137,7 +134,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -147,85 +144,14 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Create a new serial port - vmware.vmware_rest.vcenter_vm_hardware_serial: - vm: '{{ test_vm1_info.id }}' - label: Serial port 2 - allow_guest_control: true - register: _result - -- name: Create another serial port with a label - vmware.vmware_rest.vcenter_vm_hardware_serial: - vm: '{{ test_vm1_info.id }}' - label: Serial port 2 - allow_guest_control: true - register: _result - -- name: Create an existing serial port (label) - vmware.vmware_rest.vcenter_vm_hardware_serial: - vm: '{{ test_vm1_info.id }}' - label: Serial port 1 - allow_guest_control: true - register: _result - -- name: Get an existing serial port (label) - vmware.vmware_rest.vcenter_vm_hardware_serial_info: - vm: '{{ test_vm1_info.id }}' - label: Serial port 1 - register: serial_port_1 - -- name: Delete an existing serial port (port id) - vmware.vmware_rest.vcenter_vm_hardware_serial: - vm: '{{ test_vm1_info.id }}' - port: '{{ serial_port_1.id }}' - state: absent - register: _result - -- name: Delete an existing serial port (label) - vmware.vmware_rest.vcenter_vm_hardware_serial: - vm: '{{ test_vm1_info.id }}' - label: Serial port 2 - state: absent - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Create an existing serial port (label) -id: - description: moid of the resource - returned: On success - sample: '9000' - type: str -value: - description: Create an existing serial port (label) - returned: On success - sample: - allow_guest_control: 1 - backing: - auto_detect: 1 - host_device: '' - type: HOST_DEVICE - label: Serial port 1 - start_connected: 0 - state: NOT_CONNECTED - yield_on_poll: 0 - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "update": { + "create": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", @@ -233,9 +159,12 @@ "start_connected": "start_connected", "yield_on_poll": "yield_on_poll", }, - "path": {"port": "port", "vm": "vm"}, + "path": {"vm": "vm"}, }, - "create": { + "delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "update": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", @@ -243,11 +172,8 @@ "start_connected": "start_connected", "yield_on_poll": "yield_on_poll", }, - "path": {"vm": "vm"}, + "path": {"port": "port", "vm": "vm"}, }, - "delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, - "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, - "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -278,10 +204,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_hardware_serial_info.py b/plugins/modules/vcenter_vm_hardware_serial_info.py index 791b39eda..bf76f9577 100644 --- a/plugins/modules/vcenter_vm_hardware_serial_info.py +++ b/plugins/modules/vcenter_vm_hardware_serial_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -75,7 +72,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -85,50 +82,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Retrieve the serial ports information from the VM - vmware.vmware_rest.vcenter_vm_hardware_serial_info: - vm: '{{ test_vm1_info.id }}' - register: _result - -- name: Get an existing serial port (label) - vmware.vmware_rest.vcenter_vm_hardware_serial_info: - vm: '{{ test_vm1_info.id }}' - label: Serial port 1 - register: serial_port_1 """ RETURN = r""" -# content generated by the update_return_section callback# task: Get an existing serial port (label) -id: - description: moid of the resource - returned: On success - sample: '9000' - type: str -value: - description: Get an existing serial port (label) - returned: On success - sample: - allow_guest_control: 1 - backing: - auto_detect: 1 - host_device: '' - type: HOST_DEVICE - label: Serial port 1 - start_connected: 0 - state: NOT_CONNECTED - yield_on_poll: 0 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -163,10 +119,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_info.py b/plugins/modules/vcenter_vm_info.py index 3c1c513f8..dbd6ef7d8 100644 --- a/plugins/modules/vcenter_vm_info.py +++ b/plugins/modules/vcenter_vm_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -118,7 +115,7 @@ type: list author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -128,167 +125,9 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Wait until my VM is off - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ my_vm.id }}' - register: vm_info - until: - - vm_info is not failed - - vm_info.value.power_state == "POWERED_OFF" - retries: 60 - delay: 5 - -- register: _should_be_empty - name: Search with an invalid filter - vmware.vmware_rest.vcenter_vm_info: - filter_names: test_vm1_does_not_exists - -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info """ RETURN = r""" -# content generated by the update_return_section callback# task: Wait until my VM is off -id: - description: moid of the resource - returned: On success - sample: vm-1049 - type: str -value: - description: Wait until my VM is off - returned: On success - sample: - boot: - delay: 0 - enter_setup_mode: 0 - retry: 0 - retry_delay: 10000 - type: BIOS - boot_devices: [] - cdroms: - '16002': - allow_guest_control: 0 - backing: - auto_detect: 1 - device_access_type: EMULATION - type: HOST_DEVICE - label: CD/DVD drive 1 - sata: - bus: 0 - unit: 2 - start_connected: 0 - state: NOT_CONNECTED - type: SATA - cpu: - cores_per_socket: 1 - count: 1 - hot_add_enabled: 0 - hot_remove_enabled: 0 - disks: - '16000': - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/rhel-8.5.vmdk' - capacity: 16106127360 - label: Hard disk 1 - sata: - bus: 0 - unit: 0 - type: SATA - '16001': - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1_1/second_disk.vmdk' - capacity: 32000000000 - label: Hard disk 2 - sata: - bus: 0 - unit: 1 - type: SATA - floppies: {} - guest_OS: RHEL_7_64 - hardware: - upgrade_policy: NEVER - upgrade_status: NONE - version: VMX_11 - identity: - bios_uuid: 4231943a-a1b5-9d24-1e05-d447e9ff0396 - instance_uuid: 5031e081-01a7-d61a-31f8-4bc54057ec60 - name: test_vm1 - instant_clone_frozen: 0 - memory: - hot_add_enabled: 1 - size_MiB: 1024 - name: test_vm1 - nics: - '4000': - allow_guest_control: 0 - backing: - network: network-1041 - network_name: VM Network - type: STANDARD_PORTGROUP - label: Network adapter 1 - mac_address: 00:50:56:b1:22:7d - mac_type: ASSIGNED - pci_slot_number: 160 - start_connected: 0 - state: NOT_CONNECTED - type: VMXNET3 - upt_compatibility_enabled: 0 - wake_on_lan_enabled: 0 - nvme_adapters: {} - parallel_ports: {} - power_state: POWERED_OFF - sata_adapters: - '15000': - bus: 0 - label: SATA controller 0 - pci_slot_number: 32 - type: AHCI - scsi_adapters: {} - serial_ports: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -336,10 +175,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_libraryitem_info.py b/plugins/modules/vcenter_vm_libraryitem_info.py index 1dd4cd43b..7b0406b16 100644 --- a/plugins/modules/vcenter_vm_libraryitem_info.py +++ b/plugins/modules/vcenter_vm_libraryitem_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -68,7 +65,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -78,30 +75,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get the information from the library - vmware.vmware_rest.vcenter_vm_libraryitem_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get the information from the library -value: - description: Get the information from the library - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -133,10 +109,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_power.py b/plugins/modules/vcenter_vm_power.py index cd9bc4179..69bbe82a9 100644 --- a/plugins/modules/vcenter_vm_power.py +++ b/plugins/modules/vcenter_vm_power.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -79,7 +76,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -93,148 +90,16 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Turn the power of the VM on - vmware.vmware_rest.vcenter_vm_power: - state: start - vm: '{{ my_vm.id }}' - -- name: Turn on the power of the VM - vmware.vmware_rest.vcenter_vm_power: - state: start - vm: '{{ my_vm.id }}' - -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Turn the power of the VM on - vmware.vmware_rest.vcenter_vm_power: - state: start - vm: '{{ test_vm1_info.id }}' """ RETURN = r""" -# content generated by the update_return_section callback# task: Turn off the VM -msg: - description: Turn off the VM - returned: On success - sample: All items completed - type: str -results: - description: Turn off the VM - returned: On success - sample: - - _ansible_item_label: - cpu_count: 1 - memory_size_MiB: 128 - name: vCLS-e89f3630-0f4d-4adb-bac5-1912e2b5d8ab - power_state: POWERED_OFF - vm: vm-1023 - _ansible_no_log: null - ansible_loop_var: item - changed: 0 - failed: 0 - invocation: - module_args: - session_timeout: null - state: stop - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - vm: vm-1023 - item: - cpu_count: 1 - memory_size_MiB: 128 - name: vCLS-e89f3630-0f4d-4adb-bac5-1912e2b5d8ab - power_state: POWERED_OFF - vm: vm-1023 - value: - error_type: ALREADY_IN_DESIRED_STATE - messages: - - args: [] - default_message: Virtual machine is already powered off. - id: com.vmware.api.vcenter.vm.power.already_powered_off - - args: [] - default_message: The attempted operation cannot be performed in the current - state (Powered off). - id: vmsg.InvalidPowerState.summary - - _ansible_item_label: - cpu_count: 1 - memory_size_MiB: 1080 - name: test_vm1 - power_state: POWERED_ON - vm: vm-1024 - _ansible_no_log: null - ansible_loop_var: item - changed: 0 - failed: 0 - invocation: - module_args: - session_timeout: null - state: stop - vcenter_hostname: vcenter.test - vcenter_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER - vcenter_rest_log_file: /tmp/vmware_rest.log - vcenter_username: administrator@vsphere.local - vcenter_validate_certs: 0 - vm: vm-1024 - item: - cpu_count: 1 - memory_size_MiB: 1080 - name: test_vm1 - power_state: POWERED_ON - vm: vm-1024 - value: {} - type: list """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { + "stop": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "suspend": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "reset": {"query": {}, "body": {}, "path": {"vm": "vm"}}, - "stop": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "start": {"query": {}, "body": {}, "path": {"vm": "vm"}}, } # pylint: disable=line-too-long @@ -265,10 +130,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_power_info.py b/plugins/modules/vcenter_vm_power_info.py index f1139ffc5..f9fb8d3cf 100644 --- a/plugins/modules/vcenter_vm_power_info.py +++ b/plugins/modules/vcenter_vm_power_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,31 +73,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get guest power information - vmware.vmware_rest.vcenter_vm_power_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get guest power information -value: - description: Get guest power information - returned: On success - sample: - state: POWERED_ON - type: dict """ # This structure describes the format of the data expected by the end-points @@ -132,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_storage_policy.py b/plugins/modules/vcenter_vm_storage_policy.py index 030acbab6..f42111ebe 100644 --- a/plugins/modules/vcenter_vm_storage_policy.py +++ b/plugins/modules/vcenter_vm_storage_policy.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -95,7 +92,7 @@ type: dict author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -105,42 +102,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Prepare the disk policy dict - ansible.builtin.set_fact: - vm_disk_policy: "{{ {} | combine({ my_new_disk.id: {'policy': my_storage_policy.policy, 'type': 'USE_SPECIFIED_POLICY'} }) }}" - -- name: Adjust VM storage policy - vmware.vmware_rest.vcenter_vm_storage_policy: - vm: '{{ test_vm1_info.id }}' - vm_home: - type: USE_DEFAULT_POLICY - disks: '{{ vm_disk_policy }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Adjust VM storage policy -id: - description: moid of the resource - returned: On success - sample: null - type: dict -value: - description: Adjust VM storage policy - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -176,10 +140,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_storage_policy_compliance.py b/plugins/modules/vcenter_vm_storage_policy_compliance.py index 855a6e88a..fa46c61e9 100644 --- a/plugins/modules/vcenter_vm_storage_policy_compliance.py +++ b/plugins/modules/vcenter_vm_storage_policy_compliance.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -87,7 +84,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -138,10 +135,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_storage_policy_compliance_info.py b/plugins/modules/vcenter_vm_storage_policy_compliance_info.py index 860f98e50..7dd24b79f 100644 --- a/plugins/modules/vcenter_vm_storage_policy_compliance_info.py +++ b/plugins/modules/vcenter_vm_storage_policy_compliance_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -68,7 +65,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -78,37 +75,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get VM storage policy compliance information - vmware.vmware_rest.vcenter_vm_storage_policy_compliance_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get VM storage policy compliance information -value: - description: Get VM storage policy compliance information - returned: On success - sample: - disks: - '16000': - check_time: '2022-11-23T19:53:45.594Z' - failure_cause: [] - policy: f4e5bade-15a2-4805-bf8e-52318c4ce443 - status: NOT_APPLICABLE - overall_compliance: NOT_APPLICABLE - type: dict """ # This structure describes the format of the data expected by the end-points @@ -140,10 +109,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_storage_policy_info.py b/plugins/modules/vcenter_vm_storage_policy_info.py index ef4e679b8..30988c2e2 100644 --- a/plugins/modules/vcenter_vm_storage_policy_info.py +++ b/plugins/modules/vcenter_vm_storage_policy_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -68,7 +65,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -78,31 +75,9 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Get VM storage policy - vmware.vmware_rest.vcenter_vm_storage_policy_info: - vm: '{{ test_vm1_info.id }}' - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Get VM storage policy -value: - description: Get VM storage policy - returned: On success - sample: - disks: {} - type: dict """ # This structure describes the format of the data expected by the end-points @@ -134,10 +109,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_tools.py b/plugins/modules/vcenter_vm_tools.py index 8928d4b77..6c32a2384 100644 --- a/plugins/modules/vcenter_vm_tools.py +++ b/plugins/modules/vcenter_vm_tools.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -87,7 +84,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -97,67 +94,21 @@ """ EXAMPLES = r""" -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Retrive vm-tools information - vmware.vmware_rest.vcenter_vm_tools: - vm: '{{ test_vm1_info.id }}' - register: _result - -- name: Change vm-tools upgrade policy to UPGRADE_AT_POWER_CYCLE - vmware.vmware_rest.vcenter_vm_tools: - vm: '{{ test_vm1_info.id }}' - upgrade_policy: UPGRADE_AT_POWER_CYCLE - register: _result - -- name: Change vm-tools upgrade policy to MANUAL - vmware.vmware_rest.vcenter_vm_tools: - vm: '{{ test_vm1_info.id }}' - upgrade_policy: MANUAL - register: _result """ RETURN = r""" -# content generated by the update_return_section callback# task: Retrive vm-tools information -id: - description: moid of the resource - returned: On success - sample: null - type: dict -value: - description: Retrive vm-tools information - returned: On success - sample: - auto_update_supported: 0 - install_attempt_count: 0 - install_type: OPEN_VM_TOOLS - run_state: RUNNING - upgrade_policy: MANUAL - version: '10346' - version_number: 10346 - version_status: UNMANAGED - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "update": { + "upgrade": { "query": {}, - "body": {"upgrade_policy": "upgrade_policy"}, + "body": {"command_line_options": "command_line_options"}, "path": {"vm": "vm"}, }, - "upgrade": { + "update": { "query": {}, - "body": {"command_line_options": "command_line_options"}, + "body": {"upgrade_policy": "upgrade_policy"}, "path": {"vm": "vm"}, }, } # pylint: disable=line-too-long @@ -189,10 +140,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_tools_info.py b/plugins/modules/vcenter_vm_tools_info.py index c5c855753..4b9eed331 100644 --- a/plugins/modules/vcenter_vm_tools_info.py +++ b/plugins/modules/vcenter_vm_tools_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,96 +73,9 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Wait until my VM is ready - vmware.vmware_rest.vcenter_vm_tools_info: - vm: '{{ my_vm.id }}' - register: vm_tools_info - until: - - vm_tools_info is not failed - - vm_tools_info.value.run_state == "RUNNING" - retries: 10 - delay: 5 - -- name: Wait until my VM is ready - vmware.vmware_rest.vcenter_vm_tools_info: - vm: '{{ my_vm.id }}' - register: vm_tools_info - until: - - vm_tools_info is not failed - - vm_tools_info.value.run_state == "RUNNING" - retries: 60 - delay: 5 - -- name: Look up the VM called test_vm1 in the inventory - register: search_result - vmware.vmware_rest.vcenter_vm_info: - filter_names: - - test_vm1 - -- name: Collect information about a specific VM - vmware.vmware_rest.vcenter_vm_info: - vm: '{{ search_result.value[0].vm }}' - register: test_vm1_info - -- name: Wait until my VM is ready - vmware.vmware_rest.vcenter_vm_tools_info: - vm: '{{ test_vm1_info.id }}' - register: vm_tools_info - until: - - vm_tools_info is not failed - - vm_tools_info.value.run_state == "RUNNING" - retries: 60 - delay: 5 """ RETURN = r""" -# content generated by the update_return_section callback# task: Wait until my VM is ready -value: - description: Wait until my VM is ready - returned: On success - sample: - auto_update_supported: 0 - install_attempt_count: 0 - install_type: OPEN_VM_TOOLS - run_state: RUNNING - upgrade_policy: MANUAL - version: '10346' - version_number: 10346 - version_status: UNMANAGED - type: dict """ # This structure describes the format of the data expected by the end-points @@ -197,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_tools_installer.py b/plugins/modules/vcenter_vm_tools_installer.py index 8dd852f36..ccdeae555 100644 --- a/plugins/modules/vcenter_vm_tools_installer.py +++ b/plugins/modules/vcenter_vm_tools_installer.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -82,7 +79,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -92,58 +89,15 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Update the vm-tools - vmware.vmware_rest.vcenter_vm_tools_installer: - vm: '{{ my_vm.id }}' - state: connect """ RETURN = r""" -# content generated by the update_return_section callback# task: Update the vm-tools -value: - description: Update the vm-tools - returned: On success - sample: {} - type: dict """ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "disconnect": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "connect": {"query": {}, "body": {}, "path": {"vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -173,10 +127,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vm_tools_installer_info.py b/plugins/modules/vcenter_vm_tools_installer_info.py index fe0e07e6a..e108e2021 100644 --- a/plugins/modules/vcenter_vm_tools_installer_info.py +++ b/plugins/modules/vcenter_vm_tools_installer_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -66,7 +63,7 @@ type: str author: - Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -76,52 +73,9 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Get information about the vm-tools - vmware.vmware_rest.vcenter_vm_tools_installer_info: - vm: '{{ my_vm.id }}' """ RETURN = r""" -# content generated by the update_return_section callback# task: Get information about the vm-tools -value: - description: Get information about the vm-tools - returned: On success - sample: - is_connected: 0 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -153,10 +107,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vmtemplate_libraryitems.py b/plugins/modules/vcenter_vmtemplate_libraryitems.py index 1bf700862..ab7f38977 100644 --- a/plugins/modules/vcenter_vmtemplate_libraryitems.py +++ b/plugins/modules/vcenter_vmtemplate_libraryitems.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -184,7 +181,7 @@ type: dict author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.2.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -194,120 +191,9 @@ """ EXAMPLES = r""" -- name: Create a VM - vmware.vmware_rest.vcenter_vm: - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - datastore: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - name: test_vm1 - guest_OS: RHEL_7_64 - hardware_version: VMX_11 - memory: - hot_add_enabled: true - size_MiB: 1024 - disks: - - type: SATA - backing: - type: VMDK_FILE - vmdk_file: '[local] test_vm1/{{ disk_name }}.vmdk' - - type: SATA - new_vmdk: - name: second_disk - capacity: 32000000000 - cdroms: - - type: SATA - sata: - bus: 0 - unit: 2 - nics: - - backing: - type: STANDARD_PORTGROUP - network: "{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/VM Network') }}" - register: my_vm - -- name: Create a content library based on a DataStore - vmware.vmware_rest.content_locallibrary: - name: my_library_on_datastore - description: automated - publish_info: - published: true - authentication_method: NONE - storage_backings: - - datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}" - type: DATASTORE - state: present - register: nfs_lib - -- name: Create a VM template on the library - vmware.vmware_rest.vcenter_vmtemplate_libraryitems: - name: golden-template - library: '{{ nfs_lib.id }}' - source_vm: '{{ my_vm.id }}' - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - register: mylib_item - -- name: Get the list of items of the NFS library - vmware.vmware_rest.content_library_item_info: - library_id: '{{ nfs_lib.id }}' - register: lib_items - -- name: Use the name to identify the item - set_fact: - my_template_item: "{{ lib_items.value | selectattr('name', 'equalto', 'golden-template')|first }}" - -- name: Deploy a new VM based on the template - vmware.vmware_rest.vcenter_vmtemplate_libraryitems: - name: vm-from-template - library: '{{ nfs_lib.id }}' - template_library_item: '{{ my_template_item.id }}' - placement: - cluster: "{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster') }}" - folder: "{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm') }}" - resource_pool: "{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources') }}" - state: deploy - register: my_new_vm """ RETURN = r""" -# content generated by the update_return_section callback# task: Create a VM template on the library -id: - description: moid of the resource - returned: On success - sample: 9c6df1f5-faba-490c-a8e6-edb72f787ab8 - type: str -value: - description: Create a VM template on the library - returned: On success - sample: - cpu: - cores_per_socket: 1 - count: 1 - disks: - '16000': - capacity: 16106127360 - disk_storage: - datastore: datastore-1122 - '16001': - capacity: 32000000000 - disk_storage: - datastore: datastore-1122 - guest_OS: RHEL_7_64 - memory: - size_MiB: 1024 - nics: - '4000': - backing_type: STANDARD_PORTGROUP - mac_type: ASSIGNED - network: network-1123 - vm_home_storage: - datastore: datastore-1122 - vm_template: vm-1132 - type: dict """ # This structure describes the format of the data expected by the end-points @@ -371,10 +257,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", diff --git a/plugins/modules/vcenter_vmtemplate_libraryitems_info.py b/plugins/modules/vcenter_vmtemplate_libraryitems_info.py index c4efbba00..8d1226619 100644 --- a/plugins/modules/vcenter_vmtemplate_libraryitems_info.py +++ b/plugins/modules/vcenter_vmtemplate_libraryitems_info.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -69,7 +66,7 @@ type: bool author: - Ansible Cloud Team (@ansible-collections) -version_added: 2.2.0 +version_added: 1.0.0 requirements: - vSphere 7.0.2 or greater - python >= 3.6 @@ -117,10 +114,14 @@ def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str",