Ansible Modules for vCloud Director Released

Ansible Modules for vCloud Director are now available on GitHub.

VMware vCloud Director provides different ways to configure and consume services offered by a cloud provider. While the web-based user interface and the available command line interface are targeted for human usage, there is a rising demand of automating such tasks. The REST API of vCloud Director is the interface that can be used by client applications to implement such automation. Different client tools are available to access the REST API as part of larger automation solutions, like the vCloud Director Plugin for vRealize Orchestrator, or the vCloud Director Provider for Terraform. The now released modules provide an integration into Ansible.

The Ansible Modules for vCloud Director allow the automation of typical  user operations as part of Ansible playbooks. These can be used for instance as part of a Continuous Integration / Continuous Delivery pipeline, for example to automatically deploy a vApp to prepare automated integration testing.

Installation

The modules are published under BSD-2 License on GitHub:
https://github.com/vmware/ansible-module-vcloud-director

Ansible Modules for vCloud Director on GitHub

You have to have the Python SDK for vCloud Director installed on your system in order to use the Ansible Modules. Here’s how to get started:

Features

The initial release of the Ansible Modules for vCloud Director covers 8 resources in vCloud Director. The table below shows the supported resources with their states and operations.

VCD Resources States Operations
Catalog Create / Update / Delete Share / Unshare
Catalog Item Upload / Delete Capture vApp
vApp Create / Delete Power On / Power Off / Deploy / Undeploy
vApp VM Create / Update/ Delete Power On / Power Off / Reload / Deploy / Undeploy
Disk Create / Update/ Delete
Org Create / Update/ Delete Read
Org VDC Create / Update / Delete
User Create / Update/ Delete

A full documentation of all the states and operations and their arguments can be found in the docs folder of the repository:
https://github.com/vmware/ansible-module-vcloud-director/blob/master/docs/index.md

Example

As example, the following playbook configuration will deploy a new vApp from a catalog:

Feedback

Feel free to contribute to this open-source project by providing feedback through the Issues section on GitHub, and of course submit pull requests if you have some code improvements!