Init: mediaserver

This commit is contained in:
2023-02-08 12:13:28 +01:00
parent 848bc9739c
commit f7c23d4ba9
31914 changed files with 6175775 additions and 0 deletions

View File

@@ -0,0 +1,357 @@
================================
vmware.vmware_rest Release Notes
================================
.. contents:: Topics
v2.2.0
======
Minor Changes
-------------
- Add news example for clone, instant clone and template on Content Library.
- documentation - clarify that the VMware vCenter API doesn't allow the cloning of template if there are not if Library.
- vcenter_vm - Add new examples (clone and instant clone).
Bugfixes
--------
- vcenter_datacenter - Ensure the idempotency works as expected.
New Modules
-----------
- vcenter_vmtemplate_libraryitems - Creates a library item in content library from a virtual machine
- vcenter_vmtemplate_libraryitems_info - Returns information about a virtual machine template contained in the library item specified by {@param.name templateLibraryItem}
v2.1.6
======
v2.1.5
======
Minor Changes
-------------
- Adjust the release version of the lookup plugins fro, 2.0.1 to 2.1.0.
- ``vcenter_network_info`` - add an example with a Distributed Virtual Switch, a.k.a dvswitch (https://github.com/ansible-collections/vmware.vmware_rest/pull/316).
Bugfixes
--------
- Adjust the cloud.common dependency to require 2.0.4 or greater (https://github.com/ansible-collections/vmware.vmware_rest/pull/315).
v2.1.4
======
Minor Changes
-------------
- Add more EXAMPLE blocks in the documenation of the modules.
Bugfixes
--------
- Add support for Python 3.10.
v2.1.3
======
Minor Changes
-------------
- The module_utils/vmware.py is licensed under BSD.
- add some missing example blocks.
Bugfixes
--------
- "remove the following modules vcenter_vm_guest_environment_info vcenter_vm_guest_environment_info " "vcenter_vm_guest_filesystemy vcenter_vm_guest_filesystem_files vcenter_vm_guest_filesystem_files_info " "vcenter_vm_guest_processes vcenter_vm_guest_processes_info because they don't work as expected."
v2.1.2
======
Minor Changes
-------------
- The examples uses the FQCN of the built-in modules
Bugfixes
--------
- vcenter_ovf_libraryitem - properly catch errors.
v2.1.1
======
Minor Changes
-------------
- ``content_subscribedlibrary`` - use FQCN in the example.
Bugfixes
--------
- Address a condition where the subkey item was not properly identified (https://github.com/ansible-collections/vmware_rest_code_generator/pull/181).
- vcenter_datacenter - Ensure pass stat=absent on a non-existing item won't raise an error (https://github.com/ansible-collections/vmware_rest_code_generator/pull/182).
- vcenter_vm_guest_customize - Add examples.
- vcenter_vm_hardware_ethernet - Ensure we can attach a NIC to another network (https://github.com/ansible-collections/vmware.vmware_rest/issues/267).
v2.1.0
======
Minor Changes
-------------
- ``vcenter_vm_guest_customization`` - remove the module until vSphere API end-point work properly.
- bump the default timeout to 600s to give more time to the slow operations.
- new moid lookup filter plugins to convert a resource path to a MOID.
- use turbo mode cache for lookup plugins.
Bugfixes
--------
- ``appliance_networking_dns_servers`` - returns error on failure.
v2.0.0
======
Minor Changes
-------------
- Handle import error with correct exception raised while importing aiohttp
Breaking Changes / Porting Guide
--------------------------------
- The vmware_rest 2.0.0 support vSphere 7.0.2 onwards.
- vcenter_vm_storage_policy - the format of the ``disks`` parameter has changed.
- vcenter_vm_storage_policy - the module has a new mandatory paramter: ``vm_home``.
Bugfixes
--------
- Properly handle ``validate_certs`` as a boolean and accept all the standard Ansible values (``yes``, ``true``, ``y``, ``no``, etc).
New Modules
-----------
- appliance_access_consolecli - Set enabled state of the console-based controlled CLI (TTY1).
- appliance_access_consolecli_info - Get enabled state of the console-based controlled CLI (TTY1).
- appliance_access_dcui - Set enabled state of Direct Console User Interface (DCUI TTY2).
- appliance_access_dcui_info - Get enabled state of Direct Console User Interface (DCUI TTY2).
- appliance_access_shell - Set enabled state of BASH, that is, access to BASH from within the controlled CLI.
- appliance_access_shell_info - Get enabled state of BASH, that is, access to BASH from within the controlled CLI.
- appliance_access_ssh - Set enabled state of the SSH-based controlled CLI.
- appliance_access_ssh_info - Get enabled state of the SSH-based controlled CLI.
- appliance_health_applmgmt_info - Get health status of applmgmt services.
- appliance_health_database_info - Returns the health status of the database.
- appliance_health_databasestorage_info - Get database storage health.
- appliance_health_load_info - Get load health.
- appliance_health_mem_info - Get memory health.
- appliance_health_softwarepackages_info - Get information on available software updates available in the remote vSphere Update Manager repository
- appliance_health_storage_info - Get storage health.
- appliance_health_swap_info - Get swap health.
- appliance_health_system_info - Get overall health of system.
- appliance_infraprofile_configs - Exports the desired profile specification.
- appliance_infraprofile_configs_info - List all the profiles which are registered.
- appliance_localaccounts - Create a new local user account.
- appliance_localaccounts_globalpolicy - Set the global password policy.
- appliance_localaccounts_globalpolicy_info - Get the global password policy.
- appliance_localaccounts_info - Get the local user account information.
- appliance_monitoring_info - Get monitored item info
- appliance_monitoring_query - Get monitoring data.
- appliance_networking - Reset and restarts network configuration on all interfaces, also this will renew the DHCP lease for DHCP IP address.
- appliance_networking_dns_domains - Set DNS search domains.
- appliance_networking_dns_domains_info - Get list of DNS search domains.
- appliance_networking_dns_hostname - Set the Fully Qualified Domain Name.
- appliance_networking_dns_hostname_info - Get the Fully Qualified Doman Name.
- appliance_networking_dns_servers - Set the DNS server configuration
- appliance_networking_dns_servers_info - Get DNS server configuration.
- appliance_networking_firewall_inbound - Set the ordered list of firewall rules to allow or deny traffic from one or more incoming IP addresses
- appliance_networking_firewall_inbound_info - Get the ordered list of firewall rules
- appliance_networking_info - Get Networking information for all configured interfaces.
- appliance_networking_interfaces_info - Get information about a particular network interface.
- appliance_networking_interfaces_ipv4 - Set IPv4 network configuration for specific network interface.
- appliance_networking_interfaces_ipv4_info - Get IPv4 network configuration for specific NIC.
- appliance_networking_interfaces_ipv6 - Set IPv6 network configuration for specific interface.
- appliance_networking_interfaces_ipv6_info - Get IPv6 network configuration for specific interface.
- appliance_networking_noproxy - Sets servers for which no proxy configuration should be applied
- appliance_networking_noproxy_info - Returns servers for which no proxy configuration will be applied.
- appliance_networking_proxy - Configures which proxy server to use for the specified protocol
- appliance_networking_proxy_info - Gets the proxy configuration for a specific protocol.
- appliance_ntp - Set NTP servers
- appliance_ntp_info - Get the NTP configuration status
- appliance_services - Restarts a service
- appliance_services_info - Returns the state of a service.
- appliance_shutdown - Cancel pending shutdown action.
- appliance_shutdown_info - Get details about the pending shutdown action.
- appliance_system_globalfips - Enable/Disable Global FIPS mode for the appliance
- appliance_system_globalfips_info - Get current appliance FIPS settings.
- appliance_system_storage - Resize all partitions to 100 percent of disk size.
- appliance_system_storage_info - Get disk to partition mapping.
- appliance_system_time_info - Get system time.
- appliance_system_time_timezone - Set time zone.
- appliance_system_time_timezone_info - Get time zone.
- appliance_system_version_info - Get the version.
- appliance_timesync - Set time synchronization mode.
- appliance_timesync_info - Get time synchronization mode.
- appliance_update_info - Gets the current status of the appliance update.
- appliance_vmon_service - Lists details of services managed by vMon.
- appliance_vmon_service_info - Returns the state of a service.
- content_configuration - Updates the configuration
- content_configuration_info - Retrieves the current configuration values.
- content_library_item_info - Returns the {@link ItemModel} with the given identifier.
- content_locallibrary - Creates a new local library.
- content_locallibrary_info - Returns a given local library.
- content_subscribedlibrary - Creates a new subscribed library
- content_subscribedlibrary_info - Returns a given subscribed library.
- vcenter_ovf_libraryitem - Creates a library item in content library from a virtual machine or virtual appliance
- vcenter_vm_guest_environment_info - Reads a single environment variable from the guest operating system
- vcenter_vm_guest_filesystem - Initiates an operation to transfer a file to or from the guest
- vcenter_vm_guest_filesystem_directories - Creates a directory in the guest operating system
- vcenter_vm_guest_filesystem_files - Creates a temporary file
- vcenter_vm_guest_filesystem_files_info - Returns information about a file or directory in the guest
- vcenter_vm_guest_operations_info - Get information about the guest operation status.
- vcenter_vm_guest_processes - Starts a program in the guest operating system
- vcenter_vm_guest_processes_info - Returns the status of a process running in the guest operating system, including those started by {@link Processes#create} that may have recently completed
v1.0.2
======
Minor Changes
-------------
- vcenter_resourcepool - add example in documentation.
- vcenter_resourcepool_info - add example in documentation.
v1.0.1
======
Minor Changes
-------------
- Ensure the shellcheck sanity test pass
v1.0.0
======
Minor Changes
-------------
- documentation - clarify that we don't have any required parameters.
- vcenter_host_connect - remove the module, use ``vcenter_host``
- vcenter_host_disconnect - remove the module, use ``vcenter_host``
- vcenter_storage_policies - remove vcenter_storage_policies
- vcenter_storage_policies_compliance_vm_info - remove the module
- vcenter_storage_policies_entities_compliance_info - remove the module
- vcenter_storage_policies_vm_info - remove the module
New Modules
-----------
- vcenter_cluster_info - Collect the information associated with the vCenter clusters
- vcenter_datacenter - Manage the datacenter of a vCenter
- vcenter_datacenter_info - Collect the information associated with the vCenter datacenters
- vcenter_datastore_info - Collect the information associated with the vCenter datastores
- vcenter_folder_info - Collect the information associated with the vCenter folders
- vcenter_host - Manage the host of a vCenter
- vcenter_host_info - Collect the information associated with the vCenter hosts
- vcenter_network_info - Collect the information associated with the vCenter networks
- vcenter_resourcepool - Manage the resourcepool of a vCenter
- vcenter_resourcepool_info - Collect the information associated with the vCenter resourcepools
- vcenter_storage_policies_info - Collect the information associated with the vCenter storage policiess
- vcenter_vm - Manage the vm of a vCenter
- vcenter_vm_guest_identity_info - Collect the guest identity information
- vcenter_vm_guest_localfilesystem_info - Collect the guest localfilesystem information
- vcenter_vm_guest_networking_info - Collect the guest networking information
- vcenter_vm_guest_networking_interfaces_info - Collect the guest networking interfaces information
- vcenter_vm_guest_networking_routes_info - Collect the guest networking routes information
- vcenter_vm_hardware - Manage the hardware of a VM
- vcenter_vm_hardware_adapter_sata - Manage the SATA adapter of a VM
- vcenter_vm_hardware_adapter_sata_info - Collect the SATA adapter information from a VM
- vcenter_vm_hardware_adapter_scsi - Manage the SCSI adapter of a VM
- vcenter_vm_hardware_adapter_scsi_info - Collect the SCSI adapter information from a VM
- vcenter_vm_hardware_boot - Manage the boot of a VM
- vcenter_vm_hardware_boot_device - Manage the boot device of a VM
- vcenter_vm_hardware_boot_device_info - Collect the boot device information from a VM
- vcenter_vm_hardware_boot_info - Collect the boot information from a VM
- vcenter_vm_hardware_cdrom - Manage the cdrom of a VM
- vcenter_vm_hardware_cdrom_info - Collect the cdrom information from a VM
- vcenter_vm_hardware_cpu - Manage the cpu of a VM
- vcenter_vm_hardware_cpu_info - Collect the cpu information from a VM
- vcenter_vm_hardware_disk - Manage the disk of a VM
- vcenter_vm_hardware_disk_info - Collect the disk information from a VM
- vcenter_vm_hardware_ethernet - Manage the ethernet of a VM
- vcenter_vm_hardware_ethernet_info - Collect the ethernet information from a VM
- vcenter_vm_hardware_floppy - Manage the floppy of a VM
- vcenter_vm_hardware_floppy_info - Collect the floppy information from a VM
- vcenter_vm_hardware_info - Manage the info of a VM
- vcenter_vm_hardware_memory - Manage the memory of a VM
- vcenter_vm_hardware_memory_info - Collect the memory information from a VM
- vcenter_vm_hardware_parallel - Manage the parallel of a VM
- vcenter_vm_hardware_parallel_info - Collect the parallel information from a VM
- vcenter_vm_hardware_serial - Manage the serial of a VM
- vcenter_vm_hardware_serial_info - Collect the serial information from a VM
- vcenter_vm_info - Collect the information from a VM
- vcenter_vm_libraryitem_info - Collect the libraryitem information from a VM
- vcenter_vm_power - Manage the power of a VM
- vcenter_vm_power_info - Collect the power information from a VM
- vcenter_vm_storage_policy - Manage the storage policy of a VM
- vcenter_vm_storage_policy_compliance_info - Collect the storage policy compliance information from a VM
- vcenter_vm_storage_policy_info - Collect the storage policy information from a VM
- vcenter_vm_tools - Manage the tools of a VM
- vcenter_vm_tools_info - Collect the tools information from a VM
v0.4.0
======
Minor Changes
-------------
- The format of the output of the Modules is now documented in the RETURN block.
- vcenter_rest_log_file - this optional parameter can be used to point on the log file where all the HTTP interaction will be record.
v0.3.0
======
Minor Changes
-------------
- Better documentation
- The module RETURN sections are now defined.
- vcenter_resourcepool - new module
- vcenter_resourcepool_info - new module
- vcenter_storage_policies - new module
- vcenter_storage_policies_compliance_vm_info - new module
- vcenter_storage_policies_entities_compliance_info - new module
- vcenter_storage_policies_info - new module
- vcenter_storage_policies_vm_info - new module
Deprecated Features
-------------------
- vcenter_vm_storage_policy_compliance - drop the module, it returns 404 error.
- vcenter_vm_tools - remove the ``upgrade`` state.
- vcenter_vm_tools_installer - remove the module from the collection.
v0.2.0
======
Bugfixes
--------
- Improve the documentation of the modules
- minor_changes - drop vcenter_vm_compute_policies_info because the API is flagged as Technology Preview
- minor_changes - drop vcenter_vm_console_tickets because the API is flagged as Technology Preview
- minor_changes - drop vcenter_vm_guest_power and keep vcenter_vm_power which provides the same features
v0.1.0
======
Bugfixes
--------
- Fix logic in vmware_cis_category_info module.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -0,0 +1,34 @@
{
"collection_info": {
"namespace": "vmware",
"name": "vmware_rest",
"version": "2.2.0",
"authors": [
"Ansible (https://github.com/ansible)"
],
"readme": "README.md",
"tags": [
"cloud",
"vmware",
"virtualization"
],
"description": null,
"license": [],
"license_file": "LICENSE",
"dependencies": {
"cloud.common": ">=2.0.4,<3.0.0"
},
"repository": "https://github.com/ansible-collections/vmware.vmware_rest.git",
"documentation": null,
"homepage": "https://github.com/ansible-collections/vmware.vmware_rest",
"issues": "https://github.com/ansible-collections/vmware.vmware_rest/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc"
},
"file_manifest_file": {
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "bf3f3803ad76a89f9dc022a7933f8b496a87c0685d0799ba312f95f0b4a08212",
"format": 1
},
"format": 1
}

View File

@@ -0,0 +1,266 @@
# Ansible Collection: vmware.vmware_rest
This repo hosts the `vmware.vmware_rest` Ansible Collection.
The collection includes the VMware modules and plugins supported by Ansible VMware community to help the management of VMware infrastructure. These modules are different from `community.vmware` since they are based upon VMware vSphere REST API interface and not relying on any third party libraries such as [`Pyvmomi`](https://github.com/vmware/pyvmomi) and [`vSphere Automation SDK for Python`](https://github.com/vmware/vsphere-automation-sdk-python).
<!--start requires_ansible-->
## Ansible version compatibility
This collection has been tested against following Ansible versions: **>=2.9.10**.
For collections that support Ansible 2.9, please ensure you update your `network_os` to use the
fully qualified collection name (for example, `cisco.ios.ios`).
Plugins and modules within a collection may be tested with only specific Ansible versions.
A collection may contain metadata that identifies these versions.
PEP440 is the schema used to describe the versions of Ansible.
<!--end requires_ansible-->
## Python version compatibility
The collection depends on ``aiohttp`` has [requirement](https://docs.aiohttp.org/en/stable/) which requires Python 3.6 or greater.
## vSphere compatibility
The 2.0.0 version of this collection requires vSphere 7.0.2 or greater.
## Known limitations
### VM Template and folder structure
These modules are based on the [vSphere REST API](https://developer.vmware.com/apis/vsphere-automation/latest/). This API doesn't provide any mechanism to list or clone VM templates when they are stored in a VM folder.
To circumvent this limitation, you should store your VM templates in a [Content Library](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-254B2CE8-20A8-43F0-90E8-3F6776C2C896.html).
## Installation and Usage
### Install the dependencies
You can either install ``aiohttp`` using your OS package manager or using Python virtual environment.
Notes:
For RHEL, there is no ``python3-aiohttp`` package available (yet), you can either get it from EPEL or install ``aiohttp`` using pip.
### Installing the Collection from Ansible Galaxy
Before using the VMware collection, you need to install the collection with the `ansible-galaxy` CLI:
ansible-galaxy collection install vmware.vmware_rest
You can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml` using the format:
```yaml
collections:
- name: vmware.vmware_rest
```
## Content
<!--start collection content-->
### Lookup plugins
Name | Description
--- | ---
[vmware.vmware_rest.cluster_moid](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.cluster_moid_lookup.rst)|Look up MoID for vSphere cluster objects using vCenter REST API
[vmware.vmware_rest.datacenter_moid](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.datacenter_moid_lookup.rst)|Look up MoID for vSphere datacenter objects using vCenter REST API
[vmware.vmware_rest.datastore_moid](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.datastore_moid_lookup.rst)|Look up MoID for vSphere datastore objects using vCenter REST API
[vmware.vmware_rest.folder_moid](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.folder_moid_lookup.rst)|Look up MoID for vSphere folder objects using vCenter REST API
[vmware.vmware_rest.host_moid](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.host_moid_lookup.rst)|Look up MoID for vSphere host objects using vCenter REST API
[vmware.vmware_rest.network_moid](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.network_moid_lookup.rst)|Look up MoID for vSphere network objects using vCenter REST API
[vmware.vmware_rest.resource_pool_moid](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.resource_pool_moid_lookup.rst)|Look up MoID for vSphere resource pool objects using vCenter REST API
[vmware.vmware_rest.vm_moid](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vm_moid_lookup.rst)|Look up MoID for vSphere vm objects using vCenter REST API
### Modules
Name | Description
--- | ---
[vmware.vmware_rest.appliance_access_consolecli](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_access_consolecli_module.rst)|Set enabled state of the console-based controlled CLI (TTY1).
[vmware.vmware_rest.appliance_access_consolecli_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_access_consolecli_info_module.rst)|Get enabled state of the console-based controlled CLI (TTY1).
[vmware.vmware_rest.appliance_access_dcui](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_access_dcui_module.rst)|Set enabled state of Direct Console User Interface (DCUI TTY2).
[vmware.vmware_rest.appliance_access_dcui_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_access_dcui_info_module.rst)|Get enabled state of Direct Console User Interface (DCUI TTY2).
[vmware.vmware_rest.appliance_access_shell](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_access_shell_module.rst)|Set enabled state of BASH, that is, access to BASH from within the controlled CLI.
[vmware.vmware_rest.appliance_access_shell_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_access_shell_info_module.rst)|Get enabled state of BASH, that is, access to BASH from within the controlled CLI.
[vmware.vmware_rest.appliance_access_ssh](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_access_ssh_module.rst)|Set enabled state of the SSH-based controlled CLI.
[vmware.vmware_rest.appliance_access_ssh_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_access_ssh_info_module.rst)|Get enabled state of the SSH-based controlled CLI.
[vmware.vmware_rest.appliance_health_applmgmt_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_health_applmgmt_info_module.rst)|Get health status of applmgmt services.
[vmware.vmware_rest.appliance_health_database_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_health_database_info_module.rst)|Returns the health status of the database.
[vmware.vmware_rest.appliance_health_databasestorage_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_health_databasestorage_info_module.rst)|Get database storage health.
[vmware.vmware_rest.appliance_health_load_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_health_load_info_module.rst)|Get load health.
[vmware.vmware_rest.appliance_health_mem_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_health_mem_info_module.rst)|Get memory health.
[vmware.vmware_rest.appliance_health_softwarepackages_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_health_softwarepackages_info_module.rst)|Get information on available software updates available in the remote vSphere Update Manager repository
[vmware.vmware_rest.appliance_health_storage_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_health_storage_info_module.rst)|Get storage health.
[vmware.vmware_rest.appliance_health_swap_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_health_swap_info_module.rst)|Get swap health.
[vmware.vmware_rest.appliance_health_system_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_health_system_info_module.rst)|Get overall health of system.
[vmware.vmware_rest.appliance_infraprofile_configs](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_infraprofile_configs_module.rst)|Exports the desired profile specification.
[vmware.vmware_rest.appliance_infraprofile_configs_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_infraprofile_configs_info_module.rst)|List all the profiles which are registered.
[vmware.vmware_rest.appliance_localaccounts_globalpolicy](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_localaccounts_globalpolicy_module.rst)|Set the global password policy.
[vmware.vmware_rest.appliance_localaccounts_globalpolicy_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_localaccounts_globalpolicy_info_module.rst)|Get the global password policy.
[vmware.vmware_rest.appliance_localaccounts_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_localaccounts_info_module.rst)|Get the local user account information.
[vmware.vmware_rest.appliance_monitoring_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_monitoring_info_module.rst)|Get monitored item info
[vmware.vmware_rest.appliance_monitoring_query](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_monitoring_query_module.rst)|Get monitoring data.
[vmware.vmware_rest.appliance_networking](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_module.rst)|Reset and restarts network configuration on all interfaces, also this will renew the DHCP lease for DHCP IP address.
[vmware.vmware_rest.appliance_networking_dns_domains](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_dns_domains_module.rst)|Set DNS search domains.
[vmware.vmware_rest.appliance_networking_dns_domains_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_dns_domains_info_module.rst)|Get list of DNS search domains.
[vmware.vmware_rest.appliance_networking_dns_hostname](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_dns_hostname_module.rst)|Set the Fully Qualified Domain Name.
[vmware.vmware_rest.appliance_networking_dns_hostname_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_dns_hostname_info_module.rst)|Get the Fully Qualified Doman Name.
[vmware.vmware_rest.appliance_networking_dns_servers](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_dns_servers_module.rst)|Set the DNS server configuration
[vmware.vmware_rest.appliance_networking_dns_servers_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_dns_servers_info_module.rst)|Get DNS server configuration.
[vmware.vmware_rest.appliance_networking_firewall_inbound](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_firewall_inbound_module.rst)|Set the ordered list of firewall rules to allow or deny traffic from one or more incoming IP addresses
[vmware.vmware_rest.appliance_networking_firewall_inbound_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_firewall_inbound_info_module.rst)|Get the ordered list of firewall rules
[vmware.vmware_rest.appliance_networking_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_info_module.rst)|Get Networking information for all configured interfaces.
[vmware.vmware_rest.appliance_networking_interfaces_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_interfaces_info_module.rst)|Get information about a particular network interface.
[vmware.vmware_rest.appliance_networking_interfaces_ipv4](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_interfaces_ipv4_module.rst)|Set IPv4 network configuration for specific network interface.
[vmware.vmware_rest.appliance_networking_interfaces_ipv4_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_interfaces_ipv4_info_module.rst)|Get IPv4 network configuration for specific NIC.
[vmware.vmware_rest.appliance_networking_interfaces_ipv6](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_interfaces_ipv6_module.rst)|Set IPv6 network configuration for specific interface.
[vmware.vmware_rest.appliance_networking_interfaces_ipv6_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_interfaces_ipv6_info_module.rst)|Get IPv6 network configuration for specific interface.
[vmware.vmware_rest.appliance_networking_noproxy](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_noproxy_module.rst)|Sets servers for which no proxy configuration should be applied
[vmware.vmware_rest.appliance_networking_noproxy_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_noproxy_info_module.rst)|Returns servers for which no proxy configuration will be applied.
[vmware.vmware_rest.appliance_networking_proxy](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_proxy_module.rst)|Configures which proxy server to use for the specified protocol
[vmware.vmware_rest.appliance_networking_proxy_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_networking_proxy_info_module.rst)|Gets the proxy configuration for a specific protocol.
[vmware.vmware_rest.appliance_ntp](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_ntp_module.rst)|Set NTP servers
[vmware.vmware_rest.appliance_ntp_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_ntp_info_module.rst)|Get the NTP configuration status
[vmware.vmware_rest.appliance_services](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_services_module.rst)|Restarts a service
[vmware.vmware_rest.appliance_services_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_services_info_module.rst)|Returns the state of a service.
[vmware.vmware_rest.appliance_shutdown](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_shutdown_module.rst)|Cancel pending shutdown action.
[vmware.vmware_rest.appliance_shutdown_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_shutdown_info_module.rst)|Get details about the pending shutdown action.
[vmware.vmware_rest.appliance_system_globalfips](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_system_globalfips_module.rst)|Enable/Disable Global FIPS mode for the appliance
[vmware.vmware_rest.appliance_system_globalfips_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_system_globalfips_info_module.rst)|Get current appliance FIPS settings.
[vmware.vmware_rest.appliance_system_storage](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_system_storage_module.rst)|Resize all partitions to 100 percent of disk size.
[vmware.vmware_rest.appliance_system_storage_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_system_storage_info_module.rst)|Get disk to partition mapping.
[vmware.vmware_rest.appliance_system_time_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_system_time_info_module.rst)|Get system time.
[vmware.vmware_rest.appliance_system_time_timezone](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_system_time_timezone_module.rst)|Set time zone.
[vmware.vmware_rest.appliance_system_time_timezone_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_system_time_timezone_info_module.rst)|Get time zone.
[vmware.vmware_rest.appliance_system_version_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_system_version_info_module.rst)|Get the version.
[vmware.vmware_rest.appliance_timesync](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_timesync_module.rst)|Set time synchronization mode.
[vmware.vmware_rest.appliance_timesync_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_timesync_info_module.rst)|Get time synchronization mode.
[vmware.vmware_rest.appliance_update_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_update_info_module.rst)|Gets the current status of the appliance update.
[vmware.vmware_rest.appliance_vmon_service](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_vmon_service_module.rst)|Lists details of services managed by vMon.
[vmware.vmware_rest.appliance_vmon_service_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.appliance_vmon_service_info_module.rst)|Returns the state of a service.
[vmware.vmware_rest.content_configuration](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.content_configuration_module.rst)|Updates the configuration
[vmware.vmware_rest.content_configuration_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.content_configuration_info_module.rst)|Retrieves the current configuration values.
[vmware.vmware_rest.content_library_item_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.content_library_item_info_module.rst)|Returns the {@link ItemModel} with the given identifier.
[vmware.vmware_rest.content_locallibrary](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.content_locallibrary_module.rst)|Creates a new local library.
[vmware.vmware_rest.content_locallibrary_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.content_locallibrary_info_module.rst)|Returns a given local library.
[vmware.vmware_rest.content_subscribedlibrary](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.content_subscribedlibrary_module.rst)|Creates a new subscribed library
[vmware.vmware_rest.content_subscribedlibrary_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.content_subscribedlibrary_info_module.rst)|Returns a given subscribed library.
[vmware.vmware_rest.vcenter_cluster_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_cluster_info_module.rst)|Retrieves information about the cluster corresponding to {@param.name cluster}.
[vmware.vmware_rest.vcenter_datacenter](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_datacenter_module.rst)|Create a new datacenter in the vCenter inventory
[vmware.vmware_rest.vcenter_datacenter_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_datacenter_info_module.rst)|Retrieves information about the datacenter corresponding to {@param.name datacenter}.
[vmware.vmware_rest.vcenter_datastore_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_datastore_info_module.rst)|Retrieves information about the datastore indicated by {@param.name datastore}.
[vmware.vmware_rest.vcenter_folder_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_folder_info_module.rst)|Returns information about at most 1000 visible (subject to permission checks) folders in vCenter matching the {@link FilterSpec}.
[vmware.vmware_rest.vcenter_host](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_host_module.rst)|Add a new standalone host in the vCenter inventory
[vmware.vmware_rest.vcenter_host_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_host_info_module.rst)|Returns information about at most 2500 visible (subject to permission checks) hosts in vCenter matching the {@link FilterSpec}.
[vmware.vmware_rest.vcenter_network_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_network_info_module.rst)|Returns information about at most 1000 visible (subject to permission checks) networks in vCenter matching the {@link FilterSpec}.
[vmware.vmware_rest.vcenter_ovf_libraryitem](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_ovf_libraryitem_module.rst)|Creates a library item in content library from a virtual machine or virtual appliance
[vmware.vmware_rest.vcenter_resourcepool](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_resourcepool_module.rst)|Creates a resource pool.
[vmware.vmware_rest.vcenter_resourcepool_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_resourcepool_info_module.rst)|Retrieves information about the resource pool indicated by {@param.name resourcePool}.
[vmware.vmware_rest.vcenter_storage_policies_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_storage_policies_info_module.rst)|Returns information about at most 1024 visible (subject to permission checks) storage solicies availabe in vCenter
[vmware.vmware_rest.vcenter_vm](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_module.rst)|Creates a virtual machine.
[vmware.vmware_rest.vcenter_vm_guest_customization](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_customization_module.rst)|Applies a customization specification on the virtual machine
[vmware.vmware_rest.vcenter_vm_guest_filesystem_directories](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_filesystem_directories_module.rst)|Creates a directory in the guest operating system
[vmware.vmware_rest.vcenter_vm_guest_identity_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_identity_info_module.rst)|Return information about the guest.
[vmware.vmware_rest.vcenter_vm_guest_localfilesystem_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_localfilesystem_info_module.rst)|Returns details of the local file systems in the guest operating system.
[vmware.vmware_rest.vcenter_vm_guest_networking_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_networking_info_module.rst)|Returns information about the network configuration in the guest operating system.
[vmware.vmware_rest.vcenter_vm_guest_networking_interfaces_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_networking_interfaces_info_module.rst)|Returns information about the networking interfaces in the guest operating system.
[vmware.vmware_rest.vcenter_vm_guest_networking_routes_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_networking_routes_info_module.rst)|Returns information about network routing in the guest operating system.
[vmware.vmware_rest.vcenter_vm_guest_operations_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_operations_info_module.rst)|Get information about the guest operation status.
[vmware.vmware_rest.vcenter_vm_guest_power](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_power_module.rst)|Issues a request to the guest operating system asking it to perform a soft shutdown, standby (suspend) or soft reboot
[vmware.vmware_rest.vcenter_vm_guest_power_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_guest_power_info_module.rst)|Returns information about the guest operating system power state.
[vmware.vmware_rest.vcenter_vm_hardware](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_module.rst)|Updates the virtual hardware settings of a virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_adapter_sata](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_adapter_sata_module.rst)|Adds a virtual SATA adapter to the virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_adapter_sata_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_adapter_sata_info_module.rst)|Returns information about a virtual SATA adapter.
[vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi_module.rst)|Adds a virtual SCSI adapter to the virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi_info_module.rst)|Returns information about a virtual SCSI adapter.
[vmware.vmware_rest.vcenter_vm_hardware_boot](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_boot_module.rst)|Updates the boot-related settings of a virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_boot_device](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_boot_device_module.rst)|Sets the virtual devices that will be used to boot the virtual machine
[vmware.vmware_rest.vcenter_vm_hardware_boot_device_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_boot_device_info_module.rst)|Returns an ordered list of boot devices for the virtual machine
[vmware.vmware_rest.vcenter_vm_hardware_boot_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_boot_info_module.rst)|Returns the boot-related settings of a virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_cdrom](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_cdrom_module.rst)|Adds a virtual CD-ROM device to the virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_cdrom_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_cdrom_info_module.rst)|Returns information about a virtual CD-ROM device.
[vmware.vmware_rest.vcenter_vm_hardware_cpu](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_cpu_module.rst)|Updates the CPU-related settings of a virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_cpu_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_cpu_info_module.rst)|Returns the CPU-related settings of a virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_disk](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_disk_module.rst)|Adds a virtual disk to the virtual machine
[vmware.vmware_rest.vcenter_vm_hardware_disk_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_disk_info_module.rst)|Returns information about a virtual disk.
[vmware.vmware_rest.vcenter_vm_hardware_ethernet](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_ethernet_module.rst)|Adds a virtual Ethernet adapter to the virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_ethernet_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_ethernet_info_module.rst)|Returns information about a virtual Ethernet adapter.
[vmware.vmware_rest.vcenter_vm_hardware_floppy](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_floppy_module.rst)|Adds a virtual floppy drive to the virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_floppy_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_floppy_info_module.rst)|Returns information about a virtual floppy drive.
[vmware.vmware_rest.vcenter_vm_hardware_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_info_module.rst)|Returns the virtual hardware settings of a virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_memory](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_memory_module.rst)|Updates the memory-related settings of a virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_memory_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_memory_info_module.rst)|Returns the memory-related settings of a virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_parallel](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_parallel_module.rst)|Adds a virtual parallel port to the virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_parallel_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_parallel_info_module.rst)|Returns information about a virtual parallel port.
[vmware.vmware_rest.vcenter_vm_hardware_serial](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_serial_module.rst)|Adds a virtual serial port to the virtual machine.
[vmware.vmware_rest.vcenter_vm_hardware_serial_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_hardware_serial_info_module.rst)|Returns information about a virtual serial port.
[vmware.vmware_rest.vcenter_vm_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_info_module.rst)|Returns information about a virtual machine.
[vmware.vmware_rest.vcenter_vm_libraryitem_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_libraryitem_info_module.rst)|Returns the information about the library item associated with the virtual machine.
[vmware.vmware_rest.vcenter_vm_power](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_power_module.rst)|Operate a boot, hard shutdown, hard reset or hard suspend on a guest.
[vmware.vmware_rest.vcenter_vm_power_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_power_info_module.rst)|Returns the power state information of a virtual machine.
[vmware.vmware_rest.vcenter_vm_storage_policy](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_storage_policy_module.rst)|Updates the storage policy configuration of a virtual machine and/or its associated virtual hard disks.
[vmware.vmware_rest.vcenter_vm_storage_policy_compliance](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_storage_policy_compliance_module.rst)|Returns the storage policy Compliance {@link Info} of a virtual machine after explicitly re-computing compliance check.
[vmware.vmware_rest.vcenter_vm_storage_policy_compliance_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_storage_policy_compliance_info_module.rst)|Returns the cached storage policy compliance information of a virtual machine.
[vmware.vmware_rest.vcenter_vm_storage_policy_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_storage_policy_info_module.rst)|Returns Information about Storage Policy associated with a virtual machine's home directory and/or its virtual hard disks.
[vmware.vmware_rest.vcenter_vm_tools](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_tools_module.rst)|Update the properties of VMware Tools.
[vmware.vmware_rest.vcenter_vm_tools_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_tools_info_module.rst)|Get the properties of VMware Tools.
[vmware.vmware_rest.vcenter_vm_tools_installer](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_tools_installer_module.rst)|Connects the VMware Tools CD installer as a CD-ROM for the guest operating system
[vmware.vmware_rest.vcenter_vm_tools_installer_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vm_tools_installer_info_module.rst)|Get information about the VMware Tools installer.
[vmware.vmware_rest.vcenter_vmtemplate_libraryitems](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vmtemplate_libraryitems_module.rst)|Creates a library item in content library from a virtual machine
[vmware.vmware_rest.vcenter_vmtemplate_libraryitems_info](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/docs/vmware.vmware_rest.vcenter_vmtemplate_libraryitems_info_module.rst)|Returns information about a virtual machine template contained in the library item specified by {@param.name templateLibraryItem}
<!--end collection content-->
### Documentation
The [VMware REST modules guide](https://docs.ansible.com/ansible/devel/scenario_guides/guide_vmware_rest.html) gives a step by step introduction of the collection.
## Testing and Development
Please, don't open Pull Request against the [vmware_rest](https://github.com/ansible-collections/vmware_rest) repository.
We use a project called [vmware_rest_code_generate](https://github.com/ansible-collections/vmware_rest_code_generator) to generate these modules and your change would be lost.
### Testing with `ansible-test`
```
virtualenv -p python3.7 .virtualenv/py37 # Or any other version greater than 3.6
source .virtualenv/py37/bin/activate
pip install -r requirements.txt -r test-requirements.txt
ansible-test network-integration --python 3.7 --inventory /tmp/inventory-vmware_rest vcenter_vm_scenario1
```
## Release notes
See [CHANGELOG.rst](https://github.com/ansible-collections/vmware.vmware_rest/blob/main/CHANGELOG.rst).
## Releasing, Versioning and Deprecation
This collection follows [Semantic Versioning](https://semver.org/). More details on versioning can be found [in the Ansible docs](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html#collection-versions).
We plan to regularly release new minor or bugfix versions once new features or bugfixes have been implemented.
Releasing the current major version happens from the `main` branch.
We currently are not planning any deprecations or new major releases like 2.0.0 containing backwards incompatible changes. If backwards incompatible changes are needed, we plan to deprecate the old behavior as early as possible. We also plan to backport at least bugfixes for the old major version for some time after releasing a new major version. We will not block community members from backporting other bugfixes and features from the latest stable version to older release branches, under the condition that these backports are of reasonable quality.
## Communication
We have a dedicated Working Group for VMware.
You can find other people interested in this in `#ansible-vmware` on [libera.chat](https://libera.chat/) IRC.
For more information about communities, meetings and agendas see https://github.com/ansible/community/wiki/VMware.
## Code of Conduct
This repository adheres to the [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
## More information
<!-- List out where the user can find additional information, such as working group meeting times, slack/IRC channels, or documentation for the product this collection automates. At a minimum, link to: -->
- [Ansible Collection overview](https://github.com/ansible-collections/overview)
- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)
- [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)
## License
GNU General Public License v3.0 or later
See [LICENSE](LICENSE) to see the full text.

View File

@@ -0,0 +1,5 @@
# This is a cross-platform list tracking distribution packages needed by tests;
# see https://docs.openstack.org/infra/bindep/ for additional information.
gcc [compile platform:centos-8 platform:rhel-8]
gcc [compile platform:rhel-9]

View File

@@ -0,0 +1,615 @@
ancestor: null
releases:
0.1.0:
changes:
bugfixes:
- Fix logic in vmware_cis_category_info module.
fragments:
- cis_category_info.yml
release_date: '2020-08-28'
0.2.0:
changes:
bugfixes:
- Improve the documentation of the modules
- minor_changes - drop vcenter_vm_compute_policies_info because the API is flagged
as Technology Preview
- minor_changes - drop vcenter_vm_console_tickets because the API is flagged
as Technology Preview
- minor_changes - drop vcenter_vm_guest_power and keep vcenter_vm_power which
provides the same features
fragments:
- drop-tech-preview-modules.yml
- drop-vcenter_vm_guest_power.yml
- improve_documentation.yml
release_date: '2020-09-11'
0.3.0:
changes:
deprecated_features:
- vcenter_vm_storage_policy_compliance - drop the module, it returns 404 error.
- vcenter_vm_tools - remove the ``upgrade`` state.
- vcenter_vm_tools_installer - remove the module from the collection.
minor_changes:
- Better documentation
- The module RETURN sections are now defined.
- vcenter_resourcepool - new module
- vcenter_resourcepool_info - new module
- vcenter_storage_policies - new module
- vcenter_storage_policies_compliance_vm_info - new module
- vcenter_storage_policies_entities_compliance_info - new module
- vcenter_storage_policies_info - new module
- vcenter_storage_policies_vm_info - new module
fragments:
- RETURN_section.yaml
- add_vcenter_vm_storage_policies.yaml
- better_documentation.yaml
- drop_vcenter_vm_storage_policy_compliance.yaml
- drop_vcenter_vm_tools_installer.yaml
- new_modules.yaml
release_date: '2020-09-25'
0.4.0:
changes:
minor_changes:
- The format of the output of the Modules is now documented in the RETURN block.
- vcenter_rest_log_file - this optional parameter can be used to point on the
log file where all the HTTP interaction will be record.
fragments:
- add_RETURN_block_to_modules.yaml
- add_vcenter_rest_log_file_parameter.yaml
release_date: '2020-09-30'
1.0.0:
changes:
minor_changes:
- documentation - clarify that we don't have any required parameters.
- vcenter_host_connect - remove the module, use ``vcenter_host``
- vcenter_host_disconnect - remove the module, use ``vcenter_host``
- vcenter_storage_policies - remove vcenter_storage_policies
- vcenter_storage_policies_compliance_vm_info - remove the module
- vcenter_storage_policies_entities_compliance_info - remove the module
- vcenter_storage_policies_vm_info - remove the module
fragments:
- documentation.yaml
- remove_vcenter_host_connect.yaml
- remove_vcenter_storage_policies.yaml
- remove_vcenter_storage_policies_compliance_vm_info.yaml
- remove_vcenter_storage_policies_entities_compliance_info.yaml
- remove_vcenter_storage_policies_vm_info.yaml
modules:
- description: Collect the information associated with the vCenter clusters
name: vcenter_cluster_info
namespace: ''
- description: Manage the datacenter of a vCenter
name: vcenter_datacenter
namespace: ''
- description: Collect the information associated with the vCenter datacenters
name: vcenter_datacenter_info
namespace: ''
- description: Collect the information associated with the vCenter datastores
name: vcenter_datastore_info
namespace: ''
- description: Collect the information associated with the vCenter folders
name: vcenter_folder_info
namespace: ''
- description: Manage the host of a vCenter
name: vcenter_host
namespace: ''
- description: Collect the information associated with the vCenter hosts
name: vcenter_host_info
namespace: ''
- description: Collect the information associated with the vCenter networks
name: vcenter_network_info
namespace: ''
- description: Manage the resourcepool of a vCenter
name: vcenter_resourcepool
namespace: ''
- description: Collect the information associated with the vCenter resourcepools
name: vcenter_resourcepool_info
namespace: ''
- description: Collect the information associated with the vCenter storage policiess
name: vcenter_storage_policies_info
namespace: ''
- description: Manage the vm of a vCenter
name: vcenter_vm
namespace: ''
- description: Collect the guest identity information
name: vcenter_vm_guest_identity_info
namespace: ''
- description: Collect the guest localfilesystem information
name: vcenter_vm_guest_localfilesystem_info
namespace: ''
- description: Collect the guest networking information
name: vcenter_vm_guest_networking_info
namespace: ''
- description: Collect the guest networking interfaces information
name: vcenter_vm_guest_networking_interfaces_info
namespace: ''
- description: Collect the guest networking routes information
name: vcenter_vm_guest_networking_routes_info
namespace: ''
- description: Manage the hardware of a VM
name: vcenter_vm_hardware
namespace: ''
- description: Manage the SATA adapter of a VM
name: vcenter_vm_hardware_adapter_sata
namespace: ''
- description: Collect the SATA adapter information from a VM
name: vcenter_vm_hardware_adapter_sata_info
namespace: ''
- description: Manage the SCSI adapter of a VM
name: vcenter_vm_hardware_adapter_scsi
namespace: ''
- description: Collect the SCSI adapter information from a VM
name: vcenter_vm_hardware_adapter_scsi_info
namespace: ''
- description: Manage the boot of a VM
name: vcenter_vm_hardware_boot
namespace: ''
- description: Manage the boot device of a VM
name: vcenter_vm_hardware_boot_device
namespace: ''
- description: Collect the boot device information from a VM
name: vcenter_vm_hardware_boot_device_info
namespace: ''
- description: Collect the boot information from a VM
name: vcenter_vm_hardware_boot_info
namespace: ''
- description: Manage the cdrom of a VM
name: vcenter_vm_hardware_cdrom
namespace: ''
- description: Collect the cdrom information from a VM
name: vcenter_vm_hardware_cdrom_info
namespace: ''
- description: Manage the cpu of a VM
name: vcenter_vm_hardware_cpu
namespace: ''
- description: Collect the cpu information from a VM
name: vcenter_vm_hardware_cpu_info
namespace: ''
- description: Manage the disk of a VM
name: vcenter_vm_hardware_disk
namespace: ''
- description: Collect the disk information from a VM
name: vcenter_vm_hardware_disk_info
namespace: ''
- description: Manage the ethernet of a VM
name: vcenter_vm_hardware_ethernet
namespace: ''
- description: Collect the ethernet information from a VM
name: vcenter_vm_hardware_ethernet_info
namespace: ''
- description: Manage the floppy of a VM
name: vcenter_vm_hardware_floppy
namespace: ''
- description: Collect the floppy information from a VM
name: vcenter_vm_hardware_floppy_info
namespace: ''
- description: Manage the info of a VM
name: vcenter_vm_hardware_info
namespace: ''
- description: Manage the memory of a VM
name: vcenter_vm_hardware_memory
namespace: ''
- description: Collect the memory information from a VM
name: vcenter_vm_hardware_memory_info
namespace: ''
- description: Manage the parallel of a VM
name: vcenter_vm_hardware_parallel
namespace: ''
- description: Collect the parallel information from a VM
name: vcenter_vm_hardware_parallel_info
namespace: ''
- description: Manage the serial of a VM
name: vcenter_vm_hardware_serial
namespace: ''
- description: Collect the serial information from a VM
name: vcenter_vm_hardware_serial_info
namespace: ''
- description: Collect the information from a VM
name: vcenter_vm_info
namespace: ''
- description: Collect the libraryitem information from a VM
name: vcenter_vm_libraryitem_info
namespace: ''
- description: Manage the power of a VM
name: vcenter_vm_power
namespace: ''
- description: Collect the power information from a VM
name: vcenter_vm_power_info
namespace: ''
- description: Manage the storage policy of a VM
name: vcenter_vm_storage_policy
namespace: ''
- description: Collect the storage policy compliance information from a VM
name: vcenter_vm_storage_policy_compliance_info
namespace: ''
- description: Collect the storage policy information from a VM
name: vcenter_vm_storage_policy_info
namespace: ''
- description: Manage the tools of a VM
name: vcenter_vm_tools
namespace: ''
- description: Collect the tools information from a VM
name: vcenter_vm_tools_info
namespace: ''
release_date: '2020-10-09'
1.0.1:
changes:
minor_changes:
- Ensure the shellcheck sanity test pass
fragments:
- shellcheck.yaml
release_date: '2020-10-09'
1.0.2:
changes:
minor_changes:
- vcenter_resourcepool - add example in documentation.
- vcenter_resourcepool_info - add example in documentation.
fragments:
- resourcepool.yaml
release_date: '2020-10-23'
2.0.0:
changes:
breaking_changes:
- The vmware_rest 2.0.0 support vSphere 7.0.2 onwards.
- vcenter_vm_storage_policy - the format of the ``disks`` parameter has changed.
- 'vcenter_vm_storage_policy - the module has a new mandatory paramter: ``vm_home``.'
bugfixes:
- Properly handle ``validate_certs`` as a boolean and accept all the standard
Ansible values (``yes``, ``true``, ``y``, ``no``, etc).
minor_changes:
- Handle import error with correct exception raised while importing aiohttp
fragments:
- 7_0_2_only.yaml
- ensure_Handle_import_error_for_aiohttp.yaml
- ensure_validate_certs_is_boolean.yaml
- vcenter_vm_storage_policy_home_vm.yaml
modules:
- description: Set enabled state of the console-based controlled CLI (TTY1).
name: appliance_access_consolecli
namespace: ''
- description: Get enabled state of the console-based controlled CLI (TTY1).
name: appliance_access_consolecli_info
namespace: ''
- description: Set enabled state of Direct Console User Interface (DCUI TTY2).
name: appliance_access_dcui
namespace: ''
- description: Get enabled state of Direct Console User Interface (DCUI TTY2).
name: appliance_access_dcui_info
namespace: ''
- description: Set enabled state of BASH, that is, access to BASH from within
the controlled CLI.
name: appliance_access_shell
namespace: ''
- description: Get enabled state of BASH, that is, access to BASH from within
the controlled CLI.
name: appliance_access_shell_info
namespace: ''
- description: Set enabled state of the SSH-based controlled CLI.
name: appliance_access_ssh
namespace: ''
- description: Get enabled state of the SSH-based controlled CLI.
name: appliance_access_ssh_info
namespace: ''
- description: Get health status of applmgmt services.
name: appliance_health_applmgmt_info
namespace: ''
- description: Returns the health status of the database.
name: appliance_health_database_info
namespace: ''
- description: Get database storage health.
name: appliance_health_databasestorage_info
namespace: ''
- description: Get load health.
name: appliance_health_load_info
namespace: ''
- description: Get memory health.
name: appliance_health_mem_info
namespace: ''
- description: Get information on available software updates available in the
remote vSphere Update Manager repository
name: appliance_health_softwarepackages_info
namespace: ''
- description: Get storage health.
name: appliance_health_storage_info
namespace: ''
- description: Get swap health.
name: appliance_health_swap_info
namespace: ''
- description: Get overall health of system.
name: appliance_health_system_info
namespace: ''
- description: Exports the desired profile specification.
name: appliance_infraprofile_configs
namespace: ''
- description: List all the profiles which are registered.
name: appliance_infraprofile_configs_info
namespace: ''
- description: Create a new local user account.
name: appliance_localaccounts
namespace: ''
- description: Set the global password policy.
name: appliance_localaccounts_globalpolicy
namespace: ''
- description: Get the global password policy.
name: appliance_localaccounts_globalpolicy_info
namespace: ''
- description: Get the local user account information.
name: appliance_localaccounts_info
namespace: ''
- description: Get monitored item info
name: appliance_monitoring_info
namespace: ''
- description: Get monitoring data.
name: appliance_monitoring_query
namespace: ''
- description: Reset and restarts network configuration on all interfaces, also
this will renew the DHCP lease for DHCP IP address.
name: appliance_networking
namespace: ''
- description: Set DNS search domains.
name: appliance_networking_dns_domains
namespace: ''
- description: Get list of DNS search domains.
name: appliance_networking_dns_domains_info
namespace: ''
- description: Set the Fully Qualified Domain Name.
name: appliance_networking_dns_hostname
namespace: ''
- description: Get the Fully Qualified Doman Name.
name: appliance_networking_dns_hostname_info
namespace: ''
- description: Set the DNS server configuration
name: appliance_networking_dns_servers
namespace: ''
- description: Get DNS server configuration.
name: appliance_networking_dns_servers_info
namespace: ''
- description: Set the ordered list of firewall rules to allow or deny traffic
from one or more incoming IP addresses
name: appliance_networking_firewall_inbound
namespace: ''
- description: Get the ordered list of firewall rules
name: appliance_networking_firewall_inbound_info
namespace: ''
- description: Get Networking information for all configured interfaces.
name: appliance_networking_info
namespace: ''
- description: Get information about a particular network interface.
name: appliance_networking_interfaces_info
namespace: ''
- description: Set IPv4 network configuration for specific network interface.
name: appliance_networking_interfaces_ipv4
namespace: ''
- description: Get IPv4 network configuration for specific NIC.
name: appliance_networking_interfaces_ipv4_info
namespace: ''
- description: Set IPv6 network configuration for specific interface.
name: appliance_networking_interfaces_ipv6
namespace: ''
- description: Get IPv6 network configuration for specific interface.
name: appliance_networking_interfaces_ipv6_info
namespace: ''
- description: Sets servers for which no proxy configuration should be applied
name: appliance_networking_noproxy
namespace: ''
- description: Returns servers for which no proxy configuration will be applied.
name: appliance_networking_noproxy_info
namespace: ''
- description: Configures which proxy server to use for the specified protocol
name: appliance_networking_proxy
namespace: ''
- description: Gets the proxy configuration for a specific protocol.
name: appliance_networking_proxy_info
namespace: ''
- description: Set NTP servers
name: appliance_ntp
namespace: ''
- description: Get the NTP configuration status
name: appliance_ntp_info
namespace: ''
- description: Restarts a service
name: appliance_services
namespace: ''
- description: Returns the state of a service.
name: appliance_services_info
namespace: ''
- description: Cancel pending shutdown action.
name: appliance_shutdown
namespace: ''
- description: Get details about the pending shutdown action.
name: appliance_shutdown_info
namespace: ''
- description: Enable/Disable Global FIPS mode for the appliance
name: appliance_system_globalfips
namespace: ''
- description: Get current appliance FIPS settings.
name: appliance_system_globalfips_info
namespace: ''
- description: Resize all partitions to 100 percent of disk size.
name: appliance_system_storage
namespace: ''
- description: Get disk to partition mapping.
name: appliance_system_storage_info
namespace: ''
- description: Get system time.
name: appliance_system_time_info
namespace: ''
- description: Set time zone.
name: appliance_system_time_timezone
namespace: ''
- description: Get time zone.
name: appliance_system_time_timezone_info
namespace: ''
- description: Get the version.
name: appliance_system_version_info
namespace: ''
- description: Set time synchronization mode.
name: appliance_timesync
namespace: ''
- description: Get time synchronization mode.
name: appliance_timesync_info
namespace: ''
- description: Gets the current status of the appliance update.
name: appliance_update_info
namespace: ''
- description: Lists details of services managed by vMon.
name: appliance_vmon_service
namespace: ''
- description: Returns the state of a service.
name: appliance_vmon_service_info
namespace: ''
- description: Updates the configuration
name: content_configuration
namespace: ''
- description: Retrieves the current configuration values.
name: content_configuration_info
namespace: ''
- description: Returns the {@link ItemModel} with the given identifier.
name: content_library_item_info
namespace: ''
- description: Creates a new local library.
name: content_locallibrary
namespace: ''
- description: Returns a given local library.
name: content_locallibrary_info
namespace: ''
- description: Creates a new subscribed library
name: content_subscribedlibrary
namespace: ''
- description: Returns a given subscribed library.
name: content_subscribedlibrary_info
namespace: ''
- description: Creates a library item in content library from a virtual machine
or virtual appliance
name: vcenter_ovf_libraryitem
namespace: ''
- description: Reads a single environment variable from the guest operating system
name: vcenter_vm_guest_environment_info
namespace: ''
- description: Initiates an operation to transfer a file to or from the guest
name: vcenter_vm_guest_filesystem
namespace: ''
- description: Creates a directory in the guest operating system
name: vcenter_vm_guest_filesystem_directories
namespace: ''
- description: Creates a temporary file
name: vcenter_vm_guest_filesystem_files
namespace: ''
- description: Returns information about a file or directory in the guest
name: vcenter_vm_guest_filesystem_files_info
namespace: ''
- description: Get information about the guest operation status.
name: vcenter_vm_guest_operations_info
namespace: ''
- description: Starts a program in the guest operating system
name: vcenter_vm_guest_processes
namespace: ''
- description: Returns the status of a process running in the guest operating
system, including those started by {@link Processes#create} that may have
recently completed
name: vcenter_vm_guest_processes_info
namespace: ''
release_date: '2021-06-01'
2.1.0:
changes:
bugfixes:
- '``appliance_networking_dns_servers`` - returns error on failure.'
minor_changes:
- '``vcenter_vm_guest_customization`` - remove the module until vSphere API
end-point work properly.'
- bump the default timeout to 600s to give more time to the slow operations.
- new moid lookup filter plugins to convert a resource path to a MOID.
- use turbo mode cache for lookup plugins.
fragments:
- bump_timeout.yaml
- fix_vcenter_vm_guest_customization.yaml
- lookup_turbo_mode.yaml
- new_moid_lookup_filters.yaml
release_date: '2021-09-15'
2.1.1:
changes:
bugfixes:
- Address a condition where the subkey item was not properly identified (https://github.com/ansible-collections/vmware_rest_code_generator/pull/181).
- vcenter_datacenter - Ensure pass stat=absent on a non-existing item won't
raise an error (https://github.com/ansible-collections/vmware_rest_code_generator/pull/182).
- vcenter_vm_guest_customize - Add examples.
- vcenter_vm_hardware_ethernet - Ensure we can attach a NIC to another network
(https://github.com/ansible-collections/vmware.vmware_rest/issues/267).
minor_changes:
- '``content_subscribedlibrary`` - use FQCN in the example.'
fragments:
- 2.1.1.yaml
- use-FQCN-in-create_vm.yaml.yaml
- vcenter_vm_hardware_ethernet_idempotency.yaml
release_date: '2021-10-29'
2.1.2:
changes:
bugfixes:
- vcenter_ovf_libraryitem - properly catch errors.
minor_changes:
- The examples uses the FQCN of the built-in modules
fragments:
- 2.1.2-vcenter_ovf_libraryitem.yaml
- 2.1.2.yaml
release_date: '2021-11-30'
2.1.3:
changes:
bugfixes:
- '"remove the following modules vcenter_vm_guest_environment_info vcenter_vm_guest_environment_info
" "vcenter_vm_guest_filesystemy vcenter_vm_guest_filesystem_files vcenter_vm_guest_filesystem_files_info
" "vcenter_vm_guest_processes vcenter_vm_guest_processes_info because they
don''t work as expected."
'
minor_changes:
- The module_utils/vmware.py is licensed under BSD.
- add some missing example blocks.
fragments:
- 2.1.3-changelog.yaml
- 2.1.3-module_utils.yaml
release_date: '2021-12-08'
2.1.4:
changes:
bugfixes:
- Add support for Python 3.10.
minor_changes:
- Add more EXAMPLE blocks in the documenation of the modules.
fragments:
- add_some_missing_EXAMPLE_blocks.yaml
- python3.10-support.yaml
release_date: '2022-01-04'
2.1.5:
changes:
bugfixes:
- Adjust the cloud.common dependency to require 2.0.4 or greater (https://github.com/ansible-collections/vmware.vmware_rest/pull/315).
minor_changes:
- Adjust the release version of the lookup plugins fro, 2.0.1 to 2.1.0.
- '``vcenter_network_info`` - add an example with a Distributed Virtual Switch,
a.k.a dvswitch (https://github.com/ansible-collections/vmware.vmware_rest/pull/316).'
fragments:
- cloud.common-bump.yaml
- vcenter_network_info-dvs-example.yaml
- version_added.yaml
release_date: '2022-04-26'
2.1.6:
release_date: '2022-04-29'
2.2.0:
changes:
bugfixes:
- vcenter_datacenter - Ensure the idempotency works as expected.
minor_changes:
- Add news example for clone, instant clone and template on Content Library.
- documentation - clarify that the VMware vCenter API doesn't allow the cloning
of template if there are not if Library.
- vcenter_vm - Add new examples (clone and instant clone).
fragments:
- 2.2.0.yaml
- vm_template_library.yaml
modules:
- description: Creates a library item in content library from a virtual machine
name: vcenter_vmtemplate_libraryitems
namespace: ''
- description: Returns information about a virtual machine template contained
in the library item specified by {@param.name templateLibraryItem}
name: vcenter_vmtemplate_libraryitems_info
namespace: ''
release_date: '2022-06-16'

View File

@@ -0,0 +1,29 @@
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
keep_fragments: true
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: vmware.vmware_rest
trivial_section_name: trivial

View File

@@ -0,0 +1,8 @@
---
minor_changes:
- add some missing example blocks.
bugfixes:
- >
"remove the following modules vcenter_vm_guest_environment_info vcenter_vm_guest_environment_info "
"vcenter_vm_guest_filesystemy vcenter_vm_guest_filesystem_files vcenter_vm_guest_filesystem_files_info "
"vcenter_vm_guest_processes vcenter_vm_guest_processes_info because they don't work as expected."

View File

@@ -0,0 +1,3 @@
---
minor_changes:
- "The module_utils/vmware.py is licensed under BSD."

View File

@@ -0,0 +1,3 @@
---
bugfixes:
- Adjust the cloud.common dependency to require 2.0.4 or greater (https://github.com/ansible-collections/vmware.vmware_rest/pull/315).

View File

@@ -0,0 +1,3 @@
---
minor_changes:
- "``content_subscribedlibrary`` - use FQCN in the example."

View File

@@ -0,0 +1,3 @@
---
minor_changes:
- "``vcenter_network_info`` - add an example with a Distributed Virtual Switch, a.k.a dvswitch (https://github.com/ansible-collections/vmware.vmware_rest/pull/316)."

View File

@@ -0,0 +1,3 @@
---
minor_changes:
- "Adjust the release version of the lookup plugins fro, 2.0.1 to 2.1.0."

View File

@@ -0,0 +1,3 @@
---
minor_changes:
- documentation - clarify that the VMware vCenter API doesn't allow the cloning of template if there are not if Library.

View File

@@ -0,0 +1,3 @@
The modules are autogenerated by:
https://github.com/ansible-collections/vmware_rest_code_generator
version: 2.1.4

View File

@@ -0,0 +1,4 @@
sphinx
sphinx-ansible
sphinx-ansible-theme
sphinxcontrib-restbuilder

View File

@@ -0,0 +1,2 @@
[rstcheck]
ignore_directives=ansible-task,ansible-tasks

View File

@@ -0,0 +1,21 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
#SPHINXOPTS ?= -W
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = ../build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

View File

@@ -0,0 +1,51 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'vmware_rest examples'
copyright = '2020-2021, Ansible contributors'
author = 'Ansible contributors'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinxcontrib.sphinx_ansible', 'sphinxcontrib.restbuilder']
ansible_roles_path = ['~/.ansible/collections/ansible_collections/vmware/vmware_rest/tests/integration/targets']
ansible_tmp_dir = '/tmp/sphinx-ansible'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_ansible_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# shellcheck disable=SC2035,SC2086,SC2044
set -eux
target_dir=$1
dest_dir="${target_dir}/docs/docsite/rst/scenario_guides"
mkdir -p "${dest_dir}/vmware_rest_scenarios/task_outputs"
cp -v *.rst ${dest_dir}
cp -v vmware_rest_scenarios/*.rst ${dest_dir}/vmware_rest_scenarios
for i in $(find vmware_rest_scenarios -name '*.rst' -exec awk '/literalinclude:/ {print $3}' '{}' \;); do
cp -v vmware_rest_scenarios/${i} ${dest_dir}/vmware_rest_scenarios/${i}
done
rm ${dest_dir}/index.rst

View File

@@ -0,0 +1,41 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_ansible:
*******************
VMware Guide (REST)
*******************
.. toctree::
:maxdepth: 1
vmware_rest_scenarios/vcenter/1_installation
vmware_rest_scenarios/vcenter/1_authentication
Life cycle of a Virtual Machine
###############################
These scenarios teach you how to accomplish common VMware tasks using the REST API and the Ansible ``vmware.vmware_rest`` collection. To get started, please select the task you want to accomplish.
.. toctree::
:maxdepth: 1
vmware_rest_scenarios/vcenter/2_collect_information
vmware_rest_scenarios/vcenter/3_create_vm
vmware_rest_scenarios/vcenter/4_vm_info
vmware_rest_scenarios/vcenter/5_vm_hardware_tuning
vmware_rest_scenarios/vcenter/6_run_a_vm
vmware_rest_scenarios/vcenter/7_vm_tool_information
vmware_rest_scenarios/vcenter/8_vm_tool_configuration
Manage a vCenter Server Appliance (VCSA)
########################################
.. toctree::
:maxdepth: 1
vmware_rest_scenarios/appliance/appliance_access
vmware_rest_scenarios/appliance/health
vmware_rest_scenarios/appliance/network
vmware_rest_scenarios/appliance/services
vmware_rest_scenarios/appliance/system_managment

View File

@@ -0,0 +1,9 @@
*************************************************
vmware.vmware_rest: Ansible Collection for VMware
*************************************************
.. toctree::
:maxdepth: 1
:caption: vmware.vmware_rest documentation
guide_vmware_rest

View File

@@ -0,0 +1,70 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_appliance_access:
************************************
Configure the console and SSH access
************************************
Introduction
============
This section show you how to manage the console and SSH access of the vCenter Server Appliance (VCSA).
Scenario requirements
=====================
You've got an up and running vCenter Server Appliance.
Manage the shell access
-----------------------
Detect if the Shell is enabled.
.. ansible-task::
- name: Check if the Shell is enabled
vmware.vmware_rest.appliance_access_shell_info:
Or turn on the Shell access with a timeout:
.. ansible-task::
- name: Disable the Shell
vmware.vmware_rest.appliance_access_shell:
enabled: False
timeout: 600
Manage the Direct Console User Interface (DCUI)
-----------------------------------------------
You can use :ref:`vmware.vmware_rest.appliance_access_dcui_info_module` to get the current state of the configuration:
.. ansible-task::
- name: Check if the Direct Console User Interface is enabled
vmware.vmware_rest.appliance_access_dcui_info:
You can enable or disable the interface with appliance_access_dcui:
.. ansible-task::
- name: Disable the Direct Console User Interface
vmware.vmware_rest.appliance_access_dcui:
enabled: False
Manage the SSH interface
------------------------
You can also get the status of the SSH interface with appliance_access_ssh_info:
.. ansible-task::
- name: Check is the SSH access is enabled
vmware.vmware_rest.appliance_access_ssh_info:
And to enable the SSH interface:
.. ansible-task::
- name: Ensure the SSH access ie enabled
vmware.vmware_rest.appliance_access_ssh:
enabled: true

View File

@@ -0,0 +1,103 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_appliance_health:
*******************************************
Get the health state of the VCSA components
*******************************************
Introduction
============
The collection provides several modules that you can use to know the state of the different components of the VCSA.
Scenario requirements
=====================
You've got an up and running vCenter Server Appliance.
Health state per component
--------------------------
The database:
.. ansible-task::
- name: Get the database heath status
vmware.vmware_rest.appliance_health_database_info:
The database storage:
.. ansible-task::
- name: Get the database storage heath status
vmware.vmware_rest.appliance_health_databasestorage_info:
The system load:
.. ansible-task::
- name: Get the system load status
vmware.vmware_rest.appliance_health_load_info:
The memory usage:
.. ansible-task::
- name: Get the system mem status
vmware.vmware_rest.appliance_health_mem_info:
The system status:
.. ansible-task::
- name: Get the system health status
vmware.vmware_rest.appliance_health_system_info:
The package manager:
.. ansible-task::
- name: Get the health of the software package manager
vmware.vmware_rest.appliance_health_softwarepackages_info:
The storage system:
.. ansible-task::
- name: Get the health of the storage system
vmware.vmware_rest.appliance_health_storage_info:
The swap usage:
.. ansible-task::
- name: Get the health of the swap
vmware.vmware_rest.appliance_health_swap_info:
Monitoring
----------
You can also retrieve information from the VCSA monitoring backend. First you need the name of the item. To get a full list of these items, run:
.. ansible-task::
- name: Get the list of the monitored items
vmware.vmware_rest.appliance_monitoring_info:
register: result
With this information, you can access the information for a given time frame:
.. ansible-task::
- name: Query the monitoring backend
vmware.vmware_rest.appliance_monitoring_query:
end_time: 2021-04-14T09:34:56.000Z
start_time: 2021-04-14T08:34:56.000Z
names:
- mem.total
interval: MINUTES5
function: AVG
register: result

View File

@@ -0,0 +1,186 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_appliance_network:
*****************
Network managment
*****************
IP configuration
================
You can also use Ansible to get and configure the network stack of the VCSA.
Global network information
--------------------------
The appliance_networking_info exposes the state of the global network configuration:
.. ansible-task::
- name: Get network information
vmware.vmware_rest.appliance_networking_info:
And you can adjust the parameters with the appliance_networking module.
.. ansible-task::
- name: Set network information
vmware.vmware_rest.appliance_networking:
ipv6_enabled: False
Network Interface configuration
-------------------------------
The appliance_networking_interfaces_info returns a list of the Network Interface of the system:
.. ansible-task::
- name: Get a list of the network interfaces
vmware.vmware_rest.appliance_networking_interfaces_info:
You can also use the ``interface_name`` parameter to just focus on one single entry:
.. ansible-task::
- name: Get details about one network interfaces
vmware.vmware_rest.appliance_networking_interfaces_info:
interface_name: nic0
DNS configuration
=================
The hostname configuration
--------------------------
The appliance_networking_dns_hostname_info module can be use to retrieve the hostname of the VCSA:
.. ansible-task::
- name: Get the hostname configuration
vmware.vmware_rest.appliance_networking_dns_hostname_info:
The DNS servers
---------------
Use the appliance_networking_dns_servers_info to get DNS servers currently in use:
.. ansible-task::
- name: Get the DNS servers
vmware.vmware_rest.appliance_networking_dns_servers_info:
ignore_errors: True # May be failing because of the CI set-up
The appliance_networking_dns_servers can be used to set a different name server.
.. ansible-task::
- name: Set the DNS servers
vmware.vmware_rest.appliance_networking_dns_servers:
servers:
- 192.168.123.1
mode: is_static
You can test a list of servers if you set ``state=test``:
.. ansible-task::
- name: Test the DNS servers
vmware.vmware_rest.appliance_networking_dns_servers:
state: test
servers:
- var
The search domain configuration
-------------------------------
The search domain configuration can be done with appliance_networking_dns_domains and appliance_networking_dns_domains_info. The second module returns a list of domains:
.. ansible-task::
- name: Get DNS domains configuration
vmware.vmware_rest.appliance_networking_dns_domains_info:
There is two way to set the search domain. By default the value you pass in ``domains`` will overwrite the existing domain:
.. ansible-task::
- name: Update the domain configuration
vmware.vmware_rest.appliance_networking_dns_domains:
domains:
- foobar
If you instead use the ``state=add`` parameter, the ``domain`` value will complet the existing list of domains.
.. ansible-task::
- name: Add another domain configuration
vmware.vmware_rest.appliance_networking_dns_domains:
domain: barfoo
state: add
Firewall settings
=================
You can also configure the VCSA firewall. You can add new ruleset with the appliance_networking_firewall_inbound module. In this example, we reject all the traffic coming from the ``1.2.3.0/24`` subnet:
.. ansible-task::
- name: Set a firewall rule
vmware.vmware_rest.appliance_networking_firewall_inbound:
rules:
- address: 1.2.3.0
prefix: 24
policy: REJECT
The appliance_networking_firewall_inbound_info module returns a list of the inbound ruleset:
.. ansible-task::
- name: Get the firewall inbound configuration
vmware.vmware_rest.appliance_networking_firewall_inbound_info:
HTTP proxy
==========
You can also configurre the VCSA to go through a HTTP proxy. The collection provides a set of modules to configure the proxy server and manage the noproxy filter.
In this example, we will set up a proxy and configure the ``noproxy`` for ``redhat.com`` and ``ansible.com``:
.. ansible-tasks::
- name: Set the HTTP proxy configuration
vmware.vmware_rest.appliance_networking_proxy:
enabled: true
server: https://datastore.test
port: 3128
protocol: https
- name: Set HTTP noproxy configuration
vmware.vmware_rest.appliance_networking_noproxy:
servers:
- redhat.com
- ansible.com
We can validate the configuration with the associated _info modules:
.. ansible-tasks::
- name: Get the HTTP proxy configuration
vmware.vmware_rest.appliance_networking_proxy_info:
- name: Get HTTP noproxy configuration
vmware.vmware_rest.appliance_networking_noproxy_info:
And we finally reverse the configuration:
.. ansible-tasks::
- name: Delete the HTTP proxy configuration
vmware.vmware_rest.appliance_networking_proxy:
config: {}
protocol: http
state: absent
- name: Remove the noproxy entries
vmware.vmware_rest.appliance_networking_noproxy:
servers: []

View File

@@ -0,0 +1,11 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_appliance_services:
******************
Services managment
******************
Handle your VCSA services with Ansible
======================================
You can use Ansible to control the VCSA services. To get a view of all the known services, you can use the appliance_services_info module:

View File

@@ -0,0 +1,161 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_appliance_shutdown:
****************
System managment
****************
How to reboot or shutdown the VCSA
==================================
You can use Ansible to trigger or cancel a shutdown. The appliance_shutdown_info module is useful to know if a shutdown is already scheduled.
.. ansible-task::
- name: Check if there is a shutdown scheduled
vmware.vmware_rest.appliance_shutdown_info:
When you trigger a shutdown, you can also specify a ``reason``. The information will be exposed to the other users:
.. ansible-task::
- name: Shutdown the appliance
vmware.vmware_rest.appliance_shutdown:
state: poweroff
reason: this is an example
delay: 600
To cancel a shutdown, you must set the ``state`` to ``cancel``:
.. ansible-task::
- name: Abort the shutdown of the appliance
vmware.vmware_rest.appliance_shutdown:
state: cancel
*********
FIPS mode
*********
Federal Information Processing Standards (FIPS)
===============================================
The appliance_system_globalfips_info module will tell you if FIPS is enabled.
.. ansible-task::
- name: "Get the status of the Federal Information Processing Standard mode"
vmware.vmware_rest.appliance_system_globalfips_info:
You can turn the option on or off with appliance_system_globalfips:
.. warning::
The VCSA will silently reboot itself if you change the FIPS configuration.
.. ansible-task::
- name: Turn off the FIPS mode and reboot
vmware.vmware_rest.appliance_system_globalfips:
enabled: false
*******************************
Time and Timezone configuration
*******************************
Timezone
========
The appliance_system_time_timezone and ppliance_system_time_timezone_info modules handle the Timezone configuration. You can get the current configuration with:
.. ansible-task::
- name: Get the timezone configuration
vmware.vmware_rest.appliance_system_time_timezone_info:
And to adjust the system's timezone, just do:
.. ansible-task::
- name: Use the UTC timezone
vmware.vmware_rest.appliance_system_time_timezone:
name: UTC
In this example we set the ``UTC`` timezone, you can also pass a timezone in the ``Europe/Paris`` format.
Current time
============
If you want to get the current time, use appliance_system_time_info:
.. ansible-task::
- name: Get the current time
vmware.vmware_rest.appliance_system_time_info:
Time Service (NTP)
==================
The VCSA can get the time from a NTP server:
.. ansible-task::
- name: Get the NTP configuration
vmware.vmware_rest.appliance_ntp_info:
You can use the appliance_ntp module to adjust the system NTP servers. The module accepts one or more NTP servers:
.. ansible-task::
- name: Adjust the NTP configuration
vmware.vmware_rest.appliance_ntp:
servers:
- time.google.com
If you set ``state=test``, the module will validate the servers are rechable.
.. ansible-task::
- name: Test the NTP configuration
vmware.vmware_rest.appliance_ntp:
state: test
servers:
- time.google.com
You can check the clock synchronization with appliance_timesync_info:
.. ansible-task::
- name: Get information regarding the clock synchronization
vmware.vmware_rest.appliance_timesync_info:
Or also validate the system use NTP with:
.. ansible-task::
- name: Ensure we use NTP
vmware.vmware_rest.appliance_timesync:
mode: NTP
**************
Storage system
**************
The collection also provides modules to manage the storage system. appliance_system_storage_info will list the storage partitions:
.. ansible-task::
- name: Get the appliance storage information
vmware.vmware_rest.appliance_system_storage_info:
You can use the ``state=resize_ex`` option to extend an existing partition:
.. ansible-task::
- 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
.. note::
``state=resize`` also works, but you won't get as much information as with ``resize_ex``.

View File

@@ -0,0 +1,43 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_authentication:
*******************************************
How to configure the vmware_rest collection
*******************************************
Introduction
============
The vcenter_rest modules need to be authenticated. There are two different
Environment variables
=====================
.. note::
This solution requires that you call the modules from the local machine.
You need to export some environment variables in your shell before you call the modules.
.. code-block:: shell
$ export VMWARE_HOST=vcenter.test
$ export VMWARE_USER=myvcenter-user
$ export VMWARE_PASSWORD=mypassword
$ ansible-playbook my-playbook.yaml
Module parameters
=================
All the vcenter_rest modules accept the following arguments:
- ``vcenter_host``
- ``vcenter_username``
- ``vcenter_password``
Ignore SSL certificate error
============================
It's common to run a test environment without a proper SSL certificate configuration.
To ignore the SSL error, you can use the ``vcenter_validate_certs: no`` argument or
``export VMWARE_VALIDATE_CERTS=no`` to set the environment variable.

View File

@@ -0,0 +1,40 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_installation:
*****************************************
How to install the vmware_rest collection
*****************************************
Requirements
============
The collection depends on:
- Ansible >=2.9.10 or greater
- Python 3.6 or greater
aiohttp
=======
aiohttp_ is the only dependency of the collection. You can install it with ``pip`` if you use a virtualenv to run Ansible.
.. code-block:: shell
$ pip install aiohttp
Or using an RPM.
.. code-block:: shell
$ sudo dnf install python3-aiohttp
.. _aiohttp: https://docs.aiohttp.org/en/stable/
Installation
============
The best option to install the collection is to use the ``ansible-galaxy`` command:
.. code-block:: shell
$ ansible-galaxy collection install vmware.vmware_rest

View File

@@ -0,0 +1,128 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_collect_info:
*************************************************
How to collect information about your environment
*************************************************
.. ansible-tasks::
:hide:
- import_role:
name: prepare_lab
Introduction
============
This section shows you how to utilize Ansible to collect information about your environment.
This information is useful for the other tutorials.
Scenario requirements
=====================
In this scenario we've got a vCenter with an ESXi host.
Our environment is pre-initialized with the following elements:
- A datacenter called ``my_dc``
- A cluster called ``my_cluser``
- A cluster called ``my_cluser``
- An ESXi host called ``esxi1`` is in the cluster
- Two datastores on the ESXi: ``rw_datastore`` and ``ro_datastore``
- A dvswitch based guest network
Finally, we use the environment variables to authenticate ourselves as explained in :ref:`vmware_rest_authentication`.
How to collect information
==========================
In these examples, we use the ``vcenter_*_info`` module to collect information about the associated resources.
All these modules return a ``value`` key. Depending on the context, this ``value`` key will be either a list or a dictionary.
Datacenter
----------
Here we use the ``vcenter_datacenter_info`` module to list all the datacenters. As expected, the ``value`` key of the output is a list.
.. ansible-task::
- name: collect a list of the datacenters
vmware.vmware_rest.vcenter_datacenter_info:
register: my_datacenters
Cluster
-------
Here we do the same with ``vcenter_cluster_info`` module:
.. ansible-task::
- name: Build a list of all the clusters
vmware.vmware_rest.vcenter_cluster_info:
register: all_the_clusters
And we can also fetch the details about a specific cluster, with the ``cluster`` parameter:
.. ansible-task::
- name: Retrieve details about the first cluster
vmware.vmware_rest.vcenter_cluster_info:
cluster: "{{ all_the_clusters.value[0].cluster }}"
register: my_cluster_info
And the ``value`` key of the output is this time a dictionary.
Datastore
---------
Here we use ``vcenter_datastore_info`` to get a list of all the datastore called ``rw_datastore``:
.. ansible-task::
- name: Retrieve a list of all the datastores
vmware.vmware_rest.vcenter_datastore_info:
filter_names:
- rw_datastore
register: my_datastores
We save the first datastore in `my_datastore` fact for later use.
.. ansible-task::
- name: Set my_datastore
set_fact:
my_datastore: '{{ my_datastores.value|first }}'
Folder
------
And here again, you use the ``vcenter_folder_info`` module to retrieve a list of all the folders.
.. ansible-task::
- name: Build a list of all the folders
vmware.vmware_rest.vcenter_folder_info:
register: my_folders
Most of the time, you will just want one type of folder. In this case we can use filters to reduce the amount to collect. Most of the ``_info`` modules come with similar filters.
.. ansible-task::
- 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
We register the first folder for later use with ``set_fact``.
.. ansible-task::
- name: Set my_virtual_machine_folder
set_fact:
my_virtual_machine_folder: '{{ my_folders.value|first }}'

View File

@@ -0,0 +1,50 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_create_vm:
*******************************
How to create a Virtual Machine
*******************************
.. contents::
:local:
Introduction
============
This section shows you how to use Ansible to create a virtual machine.
Scenario requirements
=====================
You've already followed :ref:`vmware_rest_collect_info` and you've got the following variables defined:
- ``my_cluster_info``
- ``my_datastore``
- ``my_virtual_machine_folder``
- ``my_cluster_info``
How to create a virtual machine
===============================
In this example, we will use the ``vcenter_vm`` module to create a new guest.
.. ansible-task::
- name: Create a VM
vmware.vmware_rest.vcenter_vm:
placement:
cluster: "{{ my_cluster_info.id }}"
datastore: "{{ my_datastore.datastore }}"
folder: "{{ my_virtual_machine_folder.folder }}"
resource_pool: "{{ my_cluster_info.value.resource_pool }}"
name: test_vm1
guest_OS: DEBIAN_8_64
hardware_version: VMX_11
memory:
hot_add_enabled: true
size_MiB: 1024
register: _result
.. note::
``vcenter_vm`` accepts more parameters, however you may prefer to start with a simple VM and use the ``vcenter_vm_hardware`` modules to tune it up afterwards. It's easier this way to identify a potential problematical step.

View File

@@ -0,0 +1,133 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_vm_info:
***************************************
Retrieve information from a specific VM
***************************************
.. contents::
:local:
Introduction
============
This section shows you how to use Ansible to retrieve information about a specific virtual machine.
Scenario requirements
=====================
You've already followed :ref:`vmware_rest_create_vm` and you've got create a new VM called ``test_vm1``.
How to collect virtual machine information
==========================================
List the VM
___________
In this example, we use the ``vcenter_vm_info`` module to collect information about our new VM.
In this example, we start by asking for a list of VMs. We use a filter to limit the results to just the VM called ``test_vm1``. So we are in a list context, with one single entry in the ``value`` key.
.. ansible-task::
- name: Look up the VM called test_vm1 in the inventory
vmware.vmware_rest.vcenter_vm_info:
filter_names:
- test_vm1
register: search_result
As expected, we get a list. And thanks to our filter, we just get one entry.
Collect the details about a specific VM
_______________________________________
For the next steps, we pass the ID of the VM through the ``vm`` parameter. This allow us to collect more details about this specific VM.
.. ansible-task::
- name: Collect information about a specific VM
vmware.vmware_rest.vcenter_vm_info:
vm: '{{ search_result.value[0].vm }}'
register: test_vm1_info
The result is a structure with all the details about our VM. You will note this is actually the same information that we get when we created the VM.
Get the hardware version of a specific VM
_________________________________________
We can also use all the ``vcenter_vm_*_info`` modules to retrieve a smaller amount
of information. Here we use ``vcenter_vm_hardware_info`` to know the hardware version of
the VM.
.. ansible-task::
- name: Collect the hardware information
vmware.vmware_rest.vcenter_vm_hardware_info:
vm: '{{ search_result.value[0].vm }}'
register: my_vm1_hardware_info
List the SCSI adapter(s) of a specific VM
_________________________________________
Here for instance, we list the SCSI adapter(s) of the VM:
.. ansible-task::
- 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
You can do the same for the SATA controllers with ``vcenter_vm_adapter_sata_info``.
List the CDROM drive(s) of a specific VM
________________________________________
And we list its CDROM drives.
.. ansible-task::
- name: List the cdrom devices on the guest
vmware.vmware_rest.vcenter_vm_hardware_cdrom_info:
vm: '{{ test_vm1_info.id }}'
register: _result
Get the memory information of the VM
____________________________________
Here we collect the memory information of the VM:
.. ansible-task::
- name: Retrieve the memory information from the VM
vmware.vmware_rest.vcenter_vm_hardware_memory_info:
vm: '{{ test_vm1_info.id }}'
register: _result
Get the storage policy of the VM
--------------------------------
We use the ``vcenter_vm_storage_policy_info`` module for that:
.. ansible-task::
- name: Get VM storage policy
vmware.vmware_rest.vcenter_vm_storage_policy_info:
vm: '{{ test_vm1_info.id }}'
register: _result
Get the disk information of the VM
----------------------------------
We use the ``vcenter_vm_hardware_disk_info`` for this operation:
.. ansible-task::
- name: Retrieve the disk information from the VM
vmware.vmware_rest.vcenter_vm_hardware_disk_info:
vm: '{{ test_vm1_info.id }}'
register: _result

View File

@@ -0,0 +1,184 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_vm_hardware_tuning:
*******************************
How to modify a virtual machine
*******************************
.. contents::
:local:
Introduction
============
This section shows you how to use Ansible to modify an existing virtual machine.
Scenario requirements
=====================
You've already followed :ref:`vmware_rest_create_vm` and created a VM.
How to add a CDROM drive to a virtual machine
=============================================
In this example, we use the ``vcenter_vm_hardware_*`` modules to add a new CDROM to an existing VM.
Add a new SATA adapter
______________________
First we create a new SATA adapter. We specify the ``pci_slot_number``. This way if we run the task again it won't do anything if there is already an adapter there.
.. ansible-task::
- 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
Add a CDROM drive
_________________
Now we can create the CDROM drive:
.. ansible-task::
- 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
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_attach_a_network:
How to attach a VM to a network
===============================
Attach a new NIC
________________
Here we attach the VM to the network (through the portgroup). We specify a ``pci_slot_number`` for the same reason.
The second task adjusts the NIC configuration.
.. ansible-tasks::
- name: Identify the portgroup called my-portgroup
vmware.vmware_rest.vcenter_network_info:
filter_types: DISTRIBUTED_PORTGROUP
filter_names: my-portrgoup
register: my_portgroup
- 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
Adjust the configuration of the NIC
___________________________________
.. ansible-task::
- 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 }}'
Increase the memory of the VM
=============================
We can also adjust the amount of memory that we dedicate to our VM.
.. ansible-task::
- name: Increase the memory of a VM
vmware.vmware_rest.vcenter_vm_hardware_memory:
vm: '{{ test_vm1_info.id }}'
size_MiB: 1080
register: _result
Upgrade the hardware version of the VM
======================================
Here we use the ``vcenter_vm_hardware`` module to upgrade the version of the hardware:
.. ansible-task::
- name: Upgrade the VM hardware version
vmware.vmware_rest.vcenter_vm_hardware:
upgrade_policy: AFTER_CLEAN_SHUTDOWN
upgrade_version: VMX_13
vm: '{{ test_vm1_info.id }}'
register: _result
Adjust the number of CPUs of the VM
===================================
You can use ``vcenter_vm_hardware_cpu`` for that:
.. ansible-task::
- name: Dedicate one core to the VM
vmware.vmware_rest.vcenter_vm_hardware_cpu:
vm: '{{ test_vm1_info.id }}'
count: 1
register: _result
Remove a SATA controller
========================
In this example, we remove the SATA controller of the PCI slot 34.
.. ansible-task::
- name: Dedicate one core to the VM
vmware.vmware_rest.vcenter_vm_hardware_cpu:
vm: '{{ test_vm1_info.id }}'
count: 1
register: _result
Attach a floppy drive
=====================
Here we attach a floppy drive to a VM.
.. ansible-task::
- 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
Attach a new disk
=================
Here we attach a tiny disk to the VM. The ``capacity`` is in bytes.
.. ansible-task::
- 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

View File

@@ -0,0 +1,57 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_run_a_vm:
****************************
How to run a virtual machine
****************************
.. contents::
:local:
Introduction
============
This section covers the power management of your virtual machine.
Power information
=================
Use ``vcenter_vm_power_info`` to know the power state of the VM.
.. ansible-task::
- name: Get guest power information
vmware.vmware_rest.vcenter_vm_power_info:
vm: '{{ test_vm1_info.id }}'
register: _result
How to start a virtual machine
==============================
Use the ``vcenter_vm_power`` module to start your VM:
.. ansible-task::
- name: Turn the power of the VM on
vmware.vmware_rest.vcenter_vm_power:
state: start
vm: '{{ test_vm1_info.id }}'
How to wait until my virtual machine is ready
=============================================
If your virtual machine runs VMware Tools, you can build a loop
around the ``center_vm_tools_info`` module:
.. ansible-task::
- 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

View File

@@ -0,0 +1,96 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_vm_tool_information:
*****************************************************
How to get information from a running virtual machine
*****************************************************
.. contents::
:local:
Introduction
============
This section shows you how to collection information from a running virtual machine.
Scenario requirements
=====================
You've already followed :ref:`vmware_rest_run_a_vm` and your virtual machine runs VMware Tools.
How to collect information
==========================
In this example, we use the ``vcenter_vm_guest_*`` module to collect information about the associated resources.
Filesystem
----------
Here we use ``vcenter_vm_guest_localfilesystem_info`` to retrieve the details
about the filesystem of the guest. In this example we also use a ``retries``
loop. The VMware Tools may take a bit of time to start and by doing so, we give
the VM a bit more time.
.. ansible-task::
- 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
Guest identity
--------------
You can use ``vcenter_vm_guest_identity_info`` to get details like the OS family or the hostname of the running VM.
.. ansible-task::
- name: Get guest identity information
vmware.vmware_rest.vcenter_vm_guest_identity_info:
vm: '{{ test_vm1_info.id }}'
register: _result
Network
-------
``vcenter_vm_guest_networking_info`` will return the OS network configuration.
.. ansible-task::
- name: Get guest networking information
vmware.vmware_rest.vcenter_vm_guest_networking_info:
vm: '{{ test_vm1_info.id }}'
register: _result
Network interfaces
------------------
``vcenter_vm_guest_networking_interfaces_info`` will return a list of NIC configurations.
See also :ref:`vmware_rest_attach_a_network`.
.. ansible-task::
- name: Get guest network interfaces information
vmware.vmware_rest.vcenter_vm_guest_networking_interfaces_info:
vm: '{{ test_vm1_info.id }}'
register: _result
Network routes
--------------
Use ``vcenter_vm_guest_networking_routes_info`` to explore the route table of your vitual machine.
.. ansible-task::
- name: Get guest network routes information
vmware.vmware_rest.vcenter_vm_guest_networking_routes_info:
vm: '{{ test_vm1_info.id }}'
register: _result

View File

@@ -0,0 +1,47 @@
.. _ansible_collections.vmware.vmware_rest.docsite.vmware_rest_vm_tool_configuration:
**************************************************************
How to configure the VMware tools of a running virtual machine
**************************************************************
.. contents::
:local:
Introduction
============
This section show you how to collection information from a running virtual machine.
Scenario requirements
=====================
You've already followed :ref:`vmware_rest_run_a_vm` and your virtual machine runs VMware Tools.
How to change the upgrade policy
================================
Change the upgrade policy to MANUAL
---------------------------------------------------
You can adjust the VMware Tools upgrade policy with the ``vcenter_vm_tools`` module.
.. ansible-task::
- name: Change vm-tools upgrade policy to MANUAL
vmware.vmware_rest.vcenter_vm_tools:
vm: '{{ test_vm1_info.id }}'
upgrade_policy: MANUAL
register: _result
Change the upgrade policy to UPGRADE_AT_POWER_CYCLE
------------------------------------------------------------------------------------------
.. ansible-task::
- 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

View File

@@ -0,0 +1,2 @@
---
requires_ansible: '>=2.9.10'

View File

@@ -0,0 +1,53 @@
# Copyright: (c) 2021, Alina Buzachis <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class ModuleDocFragment(object):
# Parameters for the Lookup Managed Object Reference (MoID) plugins
DOCUMENTATION = r"""
options:
_terms:
description: Path to query.
required: true
vcenter_hostname:
description:
- The hostname or IP address of the vSphere vCenter.
- If the value is not specified in the task, the value of environment variable
C(VMWARE_HOST) will be used instead.
required: true
type: str
vcenter_password:
description:
- The vSphere vCenter password.
- If the value is not specified in the task, the value of environment variable
C(VMWARE_PASSWORD) will be used instead.
required: true
type: str
vcenter_rest_log_file:
description:
- You can use this optional parameter to set the location of a log file.
- This file will be used to record the HTTP REST interaction.
- The file will be stored on the host that run the module.
- If the value is not specified in the task, the value of environment variable
C(VMWARE_REST_LOG_FILE) will be used instead.
type: str
vcenter_username:
description:
- The vSphere vCenter username.
- If the value is not specified in the task, the value of environment variable
C(VMWARE_USER) will be used instead.
required: true
type: str
vcenter_validate_certs:
default: true
description:
- Allows connection when SSL certificates are not valid. Set to C(false) when
certificates are not trusted.
- If the value is not specified in the task, the value of environment variable
C(VMWARE_VALIDATE_CERTS) will be used instead.
type: bool
"""

View File

@@ -0,0 +1,68 @@
# Copyright: (c) 2021, Alina Buzachis <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
name: cluster_moid
short_description: Look up MoID for vSphere cluster objects using vCenter REST API
description:
- Returns Managed Object Reference (MoID) of the vSphere cluster object contained in the specified path.
author:
- Alina Buzachis (@alinabuzachis)
version_added: 2.1.0
requirements:
- vSphere 7.0.2 or greater
- python >= 3.6
- aiohttp
extends_documentation_fragment:
- vmware.vmware_rest.moid
"""
EXAMPLES = r"""
# lookup sample
- name: set connection info
ansible.builtin.set_fact:
connection_args:
vcenter_hostname: "vcenter.test"
vcenter_username: "administrator@vsphere.local"
vcenter_password: "1234"
- name: lookup MoID of the object
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/my_cluster', **connection_args) }}"
- name: lookup MoID of the object inside the path
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.cluster_moid', '/my_dc/host/') }}"
"""
RETURN = r"""
_raw:
description: MoID of the vSphere cluster object
type: str
sample: domain-c1007
"""
from ansible_collections.vmware.vmware_rest.plugins.plugin_utils.lookup import (
Lookup,
get_credentials,
)
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
TurboLookupBase as LookupBase,
)
class LookupModule(LookupBase):
async def _run(self, terms, variables, **kwargs):
self.set_options(var_options=variables, direct=get_credentials(**kwargs))
self.set_option("object_type", "cluster")
result = await Lookup.entry_point(terms, self._options)
return [result]
run = _run if not hasattr(LookupBase, "run_on_daemon") else LookupBase.run_on_daemon

View File

@@ -0,0 +1,68 @@
# Copyright: (c) 2021, Alina Buzachis <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
name: datacenter_moid
short_description: Look up MoID for vSphere datacenter objects using vCenter REST API
description:
- Returns Managed Object Reference (MoID) of the vSphere datacenter object contained in the specified path.
author:
- Alina Buzachis (@alinabuzachis)
version_added: 2.1.0
requirements:
- vSphere 7.0.2 or greater
- python >= 3.6
- aiohttp
extends_documentation_fragment:
- vmware.vmware_rest.moid
"""
EXAMPLES = r"""
# lookup sample
- name: set connection info
ansible.builtin.set_fact:
connection_args:
vcenter_hostname: "vcenter.test"
vcenter_username: "administrator@vsphere.local"
vcenter_password: "1234"
- name: lookup MoID of the object
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.datacenter_moid', '/my_dc', **connection_args) }}"
- name: lookup MoID of the object inside the path
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.datacenter_moid', '/my_folder/') }}"
"""
RETURN = r"""
_raw:
description: MoID of the vSphere datacenter object
type: str
sample: datacenter-1001
"""
from ansible_collections.vmware.vmware_rest.plugins.plugin_utils.lookup import (
Lookup,
get_credentials,
)
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
TurboLookupBase as LookupBase,
)
class LookupModule(LookupBase):
async def _run(self, terms, variables, **kwargs):
self.set_options(var_options=variables, direct=get_credentials(**kwargs))
self.set_option("object_type", "datacenter")
result = await Lookup.entry_point(terms, self._options)
return [result]
run = _run if not hasattr(LookupBase, "run_on_daemon") else LookupBase.run_on_daemon

View File

@@ -0,0 +1,68 @@
# Copyright: (c) 2021, Alina Buzachis <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
name: datastore_moid
short_description: Look up MoID for vSphere datastore objects using vCenter REST API
description:
- Returns Managed Object Reference (MoID) of the vSphere datastore object object contained in the specified path.
author:
- Alina Buzachis (@alinabuzachis)
version_added: 2.1.0
requirements:
- vSphere 7.0.2 or greater
- python >= 3.6
- aiohttp
extends_documentation_fragment:
- vmware.vmware_rest.moid
"""
EXAMPLES = r"""
# lookup sample
- name: set connection info
ansible.builtin.set_fact:
connection_args:
vcenter_hostname: "vcenter.test"
vcenter_username: "administrator@vsphere.local"
vcenter_password: "1234"
- name: lookup MoID of the object
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/host/my_cluster/esxi1.test/ro_datastore', **connection_args) }}"
- name: lookup MoID of the object inside the path
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/') }}"
"""
RETURN = r"""
_raw:
description: MoID of the vSphere datastore object
type: str
sample: datastore-1019
"""
from ansible_collections.vmware.vmware_rest.plugins.plugin_utils.lookup import (
Lookup,
get_credentials,
)
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
TurboLookupBase as LookupBase,
)
class LookupModule(LookupBase):
async def _run(self, terms, variables, **kwargs):
self.set_options(var_options=variables, direct=get_credentials(**kwargs))
self.set_option("object_type", "datastore")
result = await Lookup.entry_point(terms, self._options)
return [result]
run = _run if not hasattr(LookupBase, "run_on_daemon") else LookupBase.run_on_daemon

View File

@@ -0,0 +1,68 @@
# Copyright: (c) 2021, Alina Buzachis <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
name: folder_moid
short_description: Look up MoID for vSphere folder objects using vCenter REST API
description:
- Returns Managed Object Reference (MoID) of the vSphere folder object contained in the specified path.
author:
- Alina Buzachis (@alinabuzachis)
version_added: 2.1.0
requirements:
- vSphere 7.0.2 or greater
- python >= 3.6
- aiohttp
extends_documentation_fragment:
- vmware.vmware_rest.moid
"""
EXAMPLES = r"""
# lookup sample
- name: set connection info
ansible.builtin.set_fact:
connection_args:
vcenter_hostname: "vcenter.test"
vcenter_username: "administrator@vsphere.local"
vcenter_password: "1234"
- name: lookup MoID of the object
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm/foo/bar', **connection_args) }}"
- name: lookup MoID of the object inside the path
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.folder_moid', '/my_dc/vm/foo/') }}"
"""
RETURN = r"""
_raw:
description: MoID of the vSphere folder object
type: str
sample: group-v1029
"""
from ansible_collections.vmware.vmware_rest.plugins.plugin_utils.lookup import (
Lookup,
get_credentials,
)
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
TurboLookupBase as LookupBase,
)
class LookupModule(LookupBase):
async def _run(self, terms, variables, **kwargs):
self.set_options(var_options=variables, direct=get_credentials(**kwargs))
self.set_option("object_type", "folder")
result = await Lookup.entry_point(terms, self._options)
return [result]
run = _run if not hasattr(LookupBase, "run_on_daemon") else LookupBase.run_on_daemon

View File

@@ -0,0 +1,68 @@
# Copyright: (c) 2021, Alina Buzachis <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
name: host_moid
short_description: Look up MoID for vSphere host objects using vCenter REST API
description:
- Returns Managed Object Reference (MoID) of the vSphere host object contained in the specified path.
author:
- Alina Buzachis (@alinabuzachis)
version_added: 2.1.0
requirements:
- vSphere 7.0.2 or greater
- python >= 3.6
- aiohttp
extends_documentation_fragment:
- vmware.vmware_rest.moid
"""
EXAMPLES = r"""
# lookup sample
- name: set connection info
ansible.builtin.set_fact:
connection_args:
vcenter_hostname: "vcenter.test"
vcenter_username: "administrator@vsphere.local"
vcenter_password: "1234"
- name: lookup MoID of the object
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.host_moid', '/my_dc/host/my_cluster/esxi1.test', **connection_args) }}"
- name: lookup MoID of the object inside the path
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.host_moid', '/my_dc/host/my_cluster/') }}"
"""
RETURN = r"""
_raw:
description: MoID of the vSphere host object
type: str
sample: host-1014
"""
from ansible_collections.vmware.vmware_rest.plugins.plugin_utils.lookup import (
Lookup,
get_credentials,
)
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
TurboLookupBase as LookupBase,
)
class LookupModule(LookupBase):
async def _run(self, terms, variables, **kwargs):
self.set_options(var_options=variables, direct=get_credentials(**kwargs))
self.set_option("object_type", "host")
result = await Lookup.entry_point(terms, self._options)
return [result]
run = _run if not hasattr(LookupBase, "run_on_daemon") else LookupBase.run_on_daemon

View File

@@ -0,0 +1,68 @@
# Copyright: (c) 2021, Alina Buzachis <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
name: network_moid
short_description: Look up MoID for vSphere network objects using vCenter REST API
description:
- Returns Managed Object Reference (MoID) of the vSphere network object contained in the specified path.
author:
- Alina Buzachis (@alinabuzachis)
version_added: 2.1.0
requirements:
- vSphere 7.0.2 or greater
- python >= 3.6
- aiohttp
extends_documentation_fragment:
- vmware.vmware_rest.moid
"""
EXAMPLES = r"""
# lookup sample
- name: set connection info
ansible.builtin.set_fact:
connection_args:
vcenter_hostname: "vcenter.test"
vcenter_username: "administrator@vsphere.local"
vcenter_password: "1234"
- name: lookup MoID of the object
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/test_network', **connection_args) }}"
- name: lookup MoID of the object inside the path
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.network_moid', '/my_dc/network/') }}"
"""
RETURN = r"""
_raw:
description: MoID of the vSphere network object
type: str
sample: network-1017
"""
from ansible_collections.vmware.vmware_rest.plugins.plugin_utils.lookup import (
Lookup,
get_credentials,
)
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
TurboLookupBase as LookupBase,
)
class LookupModule(LookupBase):
async def _run(self, terms, variables, **kwargs):
self.set_options(var_options=variables, direct=get_credentials(**kwargs))
self.set_option("object_type", "network")
result = await Lookup.entry_point(terms, self._options)
return [result]
run = _run if not hasattr(LookupBase, "run_on_daemon") else LookupBase.run_on_daemon

View File

@@ -0,0 +1,68 @@
# Copyright: (c) 2021, Alina Buzachis <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
name: resource_pool_moid
short_description: Look up MoID for vSphere resource pool objects using vCenter REST API
description:
- Returns Managed Object Reference (MoID) of the vSphere resource pool object contained in the specified path.
author:
- Alina Buzachis (@alinabuzachis)
version_added: 2.1.0
requirements:
- vSphere 7.0.2 or greater
- python >= 3.6
- aiohttp
extends_documentation_fragment:
- vmware.vmware_rest.moid
"""
EXAMPLES = r"""
# lookup sample
- name: set connection info
ansible.builtin.set_fact:
connection_args:
vcenter_hostname: "vcenter.test"
vcenter_username: "administrator@vsphere.local"
vcenter_password: "1234"
- name: lookup MoID of the object
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources/my_resource_pool', **connection_args) }}"
- name: lookup MoID of the object inside the path
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.resource_pool_moid', '/my_dc/host/my_cluster/Resources/') }}"
"""
RETURN = r"""
_raw:
description: MoID of the vSphere resource pool object
type: str
sample: resgroup-1008
"""
from ansible_collections.vmware.vmware_rest.plugins.plugin_utils.lookup import (
Lookup,
get_credentials,
)
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
TurboLookupBase as LookupBase,
)
class LookupModule(LookupBase):
async def _run(self, terms, variables, **kwargs):
self.set_options(var_options=variables, direct=get_credentials(**kwargs))
self.set_option("object_type", "resource_pool")
result = await Lookup.entry_point(terms, self._options)
return [result]
run = _run if not hasattr(LookupBase, "run_on_daemon") else LookupBase.run_on_daemon

View File

@@ -0,0 +1,68 @@
# Copyright: (c) 2021, Alina Buzachis <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
name: vm_moid
short_description: Look up MoID for vSphere vm objects using vCenter REST API
description:
- Returns Managed Object Reference (MoID) of the vSphere vm object contained in the specified path.
author:
- Alina Buzachis (@alinabuzachis)
version_added: 2.1.0
requirements:
- vSphere 7.0.2 or greater
- python >= 3.6
- aiohttp
extends_documentation_fragment:
- vmware.vmware_rest.moid
"""
EXAMPLES = r"""
# lookup sample
- name: set connection info
ansible.builtin.set_fact:
connection_args:
vcenter_hostname: "vcenter.test"
vcenter_username: "administrator@vsphere.local"
vcenter_password: "1234"
- name: lookup MoID of the object
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.vm_moid', '/my_dc/host/my_cluster/esxi1.test/test_vm1', **connection_args) }}"
- name: lookup MoID of the object inside the path
ansible.builtin.debug: msg="{{ lookup('vmware.vmware_rest.vm_moid', '/my_dc/vm/') }}"
"""
RETURN = r"""
_raw:
description: MoID of the vSphere vm object
type: str
sample: vm-1026
"""
from ansible_collections.vmware.vmware_rest.plugins.plugin_utils.lookup import (
Lookup,
get_credentials,
)
from ansible_collections.cloud.common.plugins.plugin_utils.turbo.lookup import (
TurboLookupBase as LookupBase,
)
class LookupModule(LookupBase):
async def _run(self, terms, variables, **kwargs):
self.set_options(var_options=variables, direct=get_credentials(**kwargs))
self.set_option("object_type", "vm")
result = await Lookup.entry_point(terms, self._options)
return [result]
run = _run if not hasattr(LookupBase, "run_on_daemon") else LookupBase.run_on_daemon

View File

@@ -0,0 +1,419 @@
# This file is maintained in the vmware_rest_code_generator project
# https://github.com/ansible-collections/vmware_rest_code_generator
# Copyright (c) 2021 Ansible Project
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete work.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
import hashlib
import importlib
import json
import re
from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils.parsing.convert_bool import boolean
async def open_session(
vcenter_hostname=None,
vcenter_username=None,
vcenter_password=None,
validate_certs=True,
log_file=None,
):
validate_certs = boolean(validate_certs)
m = hashlib.sha256()
m.update(vcenter_hostname.encode())
m.update(vcenter_username.encode())
m.update(vcenter_password.encode())
if log_file:
m.update(log_file.encode())
m.update(b"yes" if validate_certs else b"no")
digest = m.hexdigest()
# TODO: Handle session timeout
if digest in open_session._pool:
return open_session._pool[digest]
exceptions = importlib.import_module(
"ansible_collections.cloud.common.plugins.module_utils.turbo.exceptions"
)
try:
aiohttp = importlib.import_module("aiohttp")
except ImportError:
raise exceptions.EmbeddedModuleFailure(msg=missing_required_lib("aiohttp"))
if not aiohttp:
raise exceptions.EmbeddedModuleFailure(msg="Failed to import aiohttp")
if log_file:
trace_config = aiohttp.TraceConfig()
async def on_request_end(session, trace_config_ctx, params):
with open(log_file, "a+", encoding="utf-8") as fd:
answer = await params.response.text()
fd.write(
f"{params.method}: {params.url}\n"
f"headers: {params.headers}\n"
f" status: {params.response.status}\n"
f" answer: {answer}\n\n"
)
trace_config.on_request_end.append(on_request_end)
trace_configs = [trace_config]
else:
trace_configs = []
auth = aiohttp.BasicAuth(vcenter_username, vcenter_password)
if validate_certs:
connector = aiohttp.TCPConnector(limit=20)
else:
connector = aiohttp.TCPConnector(limit=20, ssl=False)
async with aiohttp.ClientSession(
connector=connector, connector_owner=False, trace_configs=trace_configs
) as session:
try:
async with session.post(
"https://{hostname}/rest/com/vmware/cis/session".format(
hostname=vcenter_hostname
),
auth=auth,
) as resp:
if resp.status != 200:
raise exceptions.EmbeddedModuleFailure(
"Authentication failure. code: {0}, json: {1}".format(
resp.status, await resp.text()
)
)
json = await resp.json()
except aiohttp.client_exceptions.ClientConnectorError as e:
raise exceptions.EmbeddedModuleFailure(f"Authentication failure: {e}")
session_id = json["value"]
session = aiohttp.ClientSession(
connector=connector,
headers={
"vmware-api-session-id": session_id,
"content-type": "application/json",
},
connector_owner=False,
trace_configs=trace_configs,
)
open_session._pool[digest] = session
return session
open_session._pool = {}
def gen_args(params, in_query_parameter):
args = ""
for i in in_query_parameter:
if i.startswith("filter."): # < 7.0.2
v = params.get("filter_" + i[7:])
else:
v = params.get(i)
if not v:
continue
if not args:
args = "?"
else:
args += "&"
if isinstance(v, list):
for j in v:
if j == v[-1]:
args += (i + "=") + j
else:
args += (i + "=") + j + "&"
elif isinstance(v, bool) and v:
args += i + "=true"
else:
args += (i + "=") + v
return args
def session_timeout(params):
exceptions = importlib.import_module(
"ansible_collections.cloud.common.plugins.module_utils.turbo.exceptions"
)
try:
aiohttp = importlib.import_module("aiohttp")
except ImportError:
raise exceptions.EmbeddedModuleFailure(msg=missing_required_lib("aiohttp"))
if not aiohttp:
raise exceptions.EmbeddedModuleFailure(msg="Failed to import aiohttp")
out = {}
if params.get("session_timeout"):
out["timeout"] = aiohttp.ClientTimeout(total=params.get("session_timeout"))
return out
async def update_changed_flag(data, status, operation):
if data is None:
data = {"value": {}}
elif isinstance(data, list): # e.g: appliance_infraprofile_configs_info
data = {"value": data}
elif isinstance(data, str):
data = {"value": data}
elif isinstance(data, dict) and "value" not in data: # 7.0.2+
data = {"value": data}
elif isinstance(data, bool):
data = {"value": data}
if isinstance(data["value"], str) and data["value"][0] in [
"{",
"]",
]: # e.g: appliance_infraprofile_configs
data["value"] == json.loads(data["value"])
if status == 500:
data["failed"] = True
data["changed"] = False
elif operation in ["create", "clone", "instant_clone"] and status in [200, 201]:
data["failed"] = False
data["changed"] = True
elif operation == "update" and status in [200, 204]:
data["failed"] = False
data["changed"] = True
elif operation == "upgrade" and status in [200]:
data["failed"] = False
data["changed"] = True
elif operation == "set" and status in [200, 204]:
data["failed"] = False
data["changed"] = True
elif operation == "delete" and status in [200, 204]:
data["failed"] = False
data["changed"] = True
elif operation == "delete" and status == 404:
data["failed"] = False
data["changed"] = False
elif operation in ["get", "list"] and status in [200]:
data["failed"] = False
data["changed"] = False
elif operation in ["get", "list"] and status in [404]:
data["failed"] = True
data["changed"] = False
elif status >= 400:
data["failed"] = True
data["changed"] = False
if not isinstance(data["value"], dict):
pass
elif data.get("type") == "com.vmware.vapi.std.errors.not_found":
if operation == "delete":
data["failed"] = False
data["changed"] = False
else:
data["failed"] = True
data["changed"] = False
elif data.get("type") == "com.vmware.vapi.std.errors.already_in_desired_state":
data["failed"] = False
data["changed"] = False
elif data.get("type") == "com.vmware.vapi.std.errors.already_exists":
data["failed"] = False
data["changed"] = False
elif (
data.get("value", {}).get("error_type") in ["NOT_FOUND"]
and operation == "delete"
):
data["failed"] = False
data["changed"] = False
elif data.get("value", {}).get("error_type") in [
"ALREADY_EXISTS",
"ALREADY_IN_DESIRED_STATE",
]:
data["failed"] = False
data["changed"] = False
elif data.get("type") == "com.vmware.vapi.std.errors.resource_in_use":
# NOTE: this is a shortcut/hack. We get this issue if a CDROM already exists
data["failed"] = False
data["changed"] = False
elif (
data.get("type") == "com.vmware.vapi.std.errors.internal_server_error"
and data["value"]
and data["value"]["messages"]
and data["value"]["messages"][0]["args"]
== [
"com.vmware.vim.binding.vim.fault.DuplicateName cannot be cast to com.vmware.vim.binding.vim.fault.AlreadyConnected"
]
):
# NOTE: another one for vcenter_host
data["failed"] = False
data["changed"] = False
elif data.get("type", "").startswith("com.vmware.vapi.std.errors"):
data["failed"] = True
# 7.0.3, vcenter_ovf_libraryitem returns status 200 on failure
elif data.get("value", {}).get("error", {}).get("errors", []):
data["failed"] = True
return data
async def list_devices(session, url):
existing_entries = []
async with session.get(url) as resp:
_json = await resp.json()
return _json
async def build_full_device_list(session, url, device_list):
import asyncio
device_ids = []
if isinstance(device_list, list):
value = device_list
else: # 7.0.2 <
value = device_list["value"]
for i in value:
# Content library returns string {"value": "library_id"}
if isinstance(i, str):
device_ids.append(i)
continue
fields = list(i.values())
if len(fields) != 1:
# The list already comes with all the details
return device_list
device_ids.append(fields[0])
tasks = [
asyncio.ensure_future(get_device_info(session, url, _id)) for _id in device_ids
]
return [await i for i in tasks]
async def get_device_info(session, url, _id):
# remove the action=foo from the URL
m = re.search("(.+)(action=[-a-z]+)(.*)", url)
if m:
url = f"{m.group(1)}{m.group(3)}"
url = url.rstrip("?")
# workaround for content_library_item_info
if "item?library_id=" in url:
item_url = url.split("?")[0] + "/" + _id
else:
item_url = url + "/" + _id
async with session.get(item_url) as resp:
if resp.status == 200:
_json = await resp.json()
if "value" not in _json: # 7.0.2+
_json = {"value": _json}
_json["id"] = str(_id)
return _json
async def exists(
params, session, url, uniquity_keys=None, per_id_url=None, comp_func=None
):
if not uniquity_keys:
uniquity_keys = []
if not per_id_url:
per_id_url = url
def default_comp_func(device):
for k in uniquity_keys:
if not params.get(k):
continue
if isinstance(device, dict): # 7.0.2 <
v = device["value"].get(k)
elif isinstance(device, list):
v = device
else:
exceptions = importlib.import_module(
"ansible_collections.cloud.common.plugins.module_utils.turbo.exceptions"
)
raise exceptions.EmbeddedModuleFailure(msg="Unexpect type")
if isinstance(k, int) or isinstance(v, str):
k = str(k)
v = str(v)
if v == params.get(k):
return device
if not comp_func:
comp_func = default_comp_func
uniquity_keys += ["label", "pci_slot_number", "sata"]
devices = await list_devices(session, url)
full_devices = await build_full_device_list(session, per_id_url, devices)
for device in full_devices:
if comp_func(device):
return device
def set_subkey(root, path, value):
cur_loc = root
splitted = path.split("/")
for j in splitted[:-1]:
if j not in cur_loc:
cur_loc[j] = {}
cur_loc = cur_loc[j]
cur_loc[splitted[-1]] = value
def prepare_payload(params, payload_format):
payload = {}
for i in payload_format["body"].keys():
if params[i] is None:
continue
path = payload_format["body"][i]
set_subkey(payload, path, params[i])
return payload
def get_subdevice_type(url):
"""If url needs a subkey, return its name."""
candidates = []
for i in url.split("/"):
if i.startswith("{"):
candidates.append(i[1:-1])
if len(candidates) != 2:
return
return candidates[-1].split("}")[0]
def get_device_type(url):
device_type = url.split("/")[-1]
# NOTE: This mapping can be extracted from the delete end-point of the
# resource, e.g:
# /rest/vcenter/vm/{vm}/hardware/ethernet/{nic} -> nic
# Also, it sounds like we can use "list_index" instead
if device_type == "ethernet":
return "nic"
elif device_type in ["sata", "scsi"]:
return "adapter"
elif device_type in ["parallel", "serial"]:
return "port"
else:
return device_type

Some files were not shown because too many files have changed in this diff Show More