vmware.govc
ansible-role-govc
This role installs and manages govc, a command-line tool for working with VMware vCenter server.
Requirements
- You need to have
gunzip
installed.
Role Variables
To specify the version of govc to install:
govc_version
: "0.12.1"
The location where you want to install the govc tool. You can choose to install it in a user's local path or a system-wide path.
govc_path
: /usr/bin
Dependencies
While it’s not mandatory, you might want to install ansible-role-assets to get a set of OVAs.
Example Playbook
---
- hosts: adminServers
roles:
# Install govc in the standard path
- role: ansible-role-govc
# Install govc version 0.12.1 in the /tmp directory,
# and import a photon OVA into an ESX or vCenter server
- role: ansible-role-govc
vars:
govc_path: /tmp
govc_version: "0.12.1"
# Specify the ESX or vCenter host and credentials
govc_host: esx-a.home.local
govc_username: [email protected]
govc_password: password
# Alternatively, you can use govc_url
# govc_url: https://user:pass@host/sdk
govc_ova_imports:
- name: photon01
ova: /tmp/photon.ova
- name: photon02
ova: /tmp/photon.ova
- name: vcsa
spec: /tmp/vcsa.json
ova: /tmp/vcsa.ova
Testing
Make changes to the tests/group_vars
to fit your environment. You can create your own vault.yml
files or replace them with plain text passwords.
Then, run the tests:
pip install molecule docker-py
./tests/test.sh
License
Copyright © 2017 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: MIT OR GPL-3.0-only
Author Information
Tom Scanlan
tscanlan@vmware.com
tompscanlan@gmail.com