This repository hosts the cloud.vmware_ops validated Ansible Collection.
The collection includes a variety of Ansible roles and playbooks to help automate the management of VMware.
It focuses on playbooks and roles that allow users to quickly and easily perform VMware operations tasks. The playbooks cover common use cases and leverage the roles inside the collection. The roles can be used to create your own playbooks and cover custom use cases for your environment.
This repository comes with an execution environment definition. This can be used to quickly build a container image that contains all of the software required to run the playbooks and roles in this repository. See execution-environment/README.md for more information.
It is common for people to use localhost to run the tasks in this content since most tasks simply interact with the vSphere environment. If you do not use the execution environment mentioned above, the following requirements are needed on whatever host runs the tasks:
- Python 3.9 or greater
- Python requirements found in execution-environment/requirements.txt
Once the collection is installed, you can install the python requirements using pip: pip install -r ~/.ansible/collections/ansible_collections/cloud/vmware_ops/execution-environment/requirements.txt
This collection supports vSphere 7.x and 8.x.
This collection has been tested against following Ansible versions: >=2.16.0.
Required collections are listed in the galaxy.yml and will be installed automatically when this collection is installed.
This content can be installed from git by anyone with access to the repository.
To consume this Validated Content from Automation Hub, please ensure that you add the following lines to your ansible.cfg file.
# if you have multiple server configurations (validated content, certified content, public content, etc) you can specify those config
# section names here as a comma separated list. For example 'server_list = validated,public,my_galaxy
[galaxy]
server_list = validated
[galaxy_server.validated]
url=https://console.redhat.com/api/automation-hub/content/validated/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=<SuperSecretToken>
The token can be obtained from the Automation Hub Web UI.
Once the above steps are done, you can run the following command to install the collection.
ansible-galaxy collection install cloud.vmware_ops
Once installed, you can reference the cloud.vmware_ops collection content by its fully qualified collection name (FQCN), for example:
- hosts: localhost
roles:
- role: cloud.vmware_ops.system_settings- Ansible Using collections for more details.
-
Use Case Name: Create and Modify Cluster Settings and Perform ESXi Maintenance
- Actors:
- System Admin
- Description:
- A systems administrator can modify various vCenter cluster settings.
- Related Playbooks:
- cluster_settings/disable_high_availability.yml
- cluster_settings/enable_high_availability.yml
- cluster_settings/manage_all_settings.yml
- esxi_management/disable_maintenance_mode.yml
- esxi_management/enable_maintenance_mode.yml
- Roles:
cloud.vmware_ops.cluster_settings- Set DPM, DRS, vCLS, HA, and vSAN settingscloud.vmware_ops.esxi_maintenance_mode- Manage the maintenance status of an ESXi host
- Flow:
- Using the
manage_all_settingsplaybook, control a variety of settings in vCenter - Quickly enable or disable high availability on the cluster using the dedicated playbooks
- Put an ESXi host in maintenance mode to adjust settings on the host, then add it back into production using the
esxi_maintenance_moderole - When a new ESXi host or datastore has been added to the cluster, include the
cluster_settingsrole to adjust related settings.
- Using the
- Actors:
-
Use Case Name: Create and Manage Virtual ESXi Hosts and a Nested VCenter
- Actors:
- System Admin
- Description:
- A systems administrator can deploy a virtual vSphere environment for testing or isolation purposes.
- Related Playbooks:
- esxi_management/add_esxi_host_to_vcenter.yml
- esxi_management/remove_esxi_host_from_vcenter.yml
- esxi_management/reconnect_esxi_host_in_vcenter.yml
- provision_vcenter/provision_vcsa_on_esxi.yml
- system_settings.yml
- Roles:
cloud.vmware_ops.provision_virtual_esxi- Provision a set of virtual ESXi hosts on an existing vSphere environmentcloud.vmware_ops.vcenter_host_connection- Manage the connection status of an ESXi host to a vCenter appliancecloud.vmware_ops.system_settings- Manage the system settings of a vCenter appliancecloud.vmware_ops.provision_vcenter- Provision a vCenter appliance on an ESXi host or on an existing vCenter cluster
- Flow:
- Deploy virtual ESXi hosts on an existing cluster using the
provision_virtual_esxirole - Deploy a vCenter appliance to one of the new virtual hosts using the
provision_vcenterrole orprovision_vcsa_on_esxiplaybook - Add the other virtual ESXi hosts to the new vCenter using the
add_esxi_host_from_vcenterplaybook orvcenter_host_connectionrole - Modify vCenter appliance system settings using the
system_settingsplaybook orsystem_settingsrole
- Deploy virtual ESXi hosts on an existing cluster using the
- Actors:
-
Use Case Name: Manage a VM and Export and/or Deploy as an OVF
- Actors:
- System Admin
- Description:
- A systems administrator can create or modify an existing VM, export it as an OVF, and deploy the OVF to other clusters.
- Related Playbooks:
- provision_vm/manage_vm.yml
- provision_vm/deploy_ovf.yml
- export_vm_as_ovf.yml
- snapshot_management/create_snapshot.yml
- snapshot_management/remove_all_snapshots.yml
- snapshot_management/remove_snapshot.yml
- snapshot_management/revert_to_a_snapshot.yml
- Roles:
cloud.vmware_ops.export_vm_as_ovf- Exports an existing VM as an OVF filecloud.vmware_ops.provision_vm- Create, manage, or delete a VMcloud.vmware_ops.snapshot_management- Manage the snapshots of a VMcloud.vmware_ops.manage_folder- Create or delete a foldercloud.vmware_ops.deploy_ovf- Deploy an OVF file to an ESXi host or existing vCenter Cluster
- Flow:
- Create or adjust a VM to prepare it for export using the
provision_vmrole ormanage_vmplaybook - Optionally take snapshots of the VM using the
snapshot_managementrole orcreate_snapshotplaybook - Power off the VM using
provision_vmrole ormanage_vmplaybook - Export the VM as an OVF file using the
export_vm_as_ovfplaybook orexport_vm_as_ovfrole - Deploy the VM from an OVF file using the
deploy_ovfplaybook ordeploy_ovfrole
- Create or adjust a VM to prepare it for export using the
- Actors:
All releases will meet the following test criteria.
- 100% success for Integration tests.
- 100% success for Sanity tests as part of ansible-test.
- 100% success for ansible-lint allowing only false positives.
This community is currently not accepting direct contributions. We encourage you to open git issues for bugs, comments or feature requests.
Refer to the Ansible community guide.
-
Join the Ansible forum:
- Get Help: get help or help others.
- Posts tagged with 'vmware': subscribe to participate in collection-related conversations.
- Ansible VMware Automation Working Group: by joining the team you will automatically get subscribed to the posts tagged with 'vmware'.
- Social Spaces: gather and interact with fellow enthusiasts.
- News & Announcements: track project-wide announcements including social events.
-
The Ansible Bullhorn newsletter: used to announce releases and important changes.
For more information about communication, see the Ansible communication guide.
As Red Hat Ansible Validated Content, this collection is entitled to limited support through Ansible Automation Platform (AAP).
GNU General Public License v3.0 or later
See LICENSE to see the full text.