From c3f2cc64f7b6ae00ca160baaae6ab7c7d377e62a Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 16 Jun 2020 17:03:15 +0200 Subject: [PATCH] add basic HCL2 docs for vmware --- website/pages/docs/builders/vmware/iso.mdx | 26 ++++++++++++++++++++-- website/pages/docs/builders/vmware/vmx.mdx | 22 ++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/website/pages/docs/builders/vmware/iso.mdx b/website/pages/docs/builders/vmware/iso.mdx index 7dae035ab..04e0706aa 100644 --- a/website/pages/docs/builders/vmware/iso.mdx +++ b/website/pages/docs/builders/vmware/iso.mdx @@ -37,18 +37,40 @@ Here is a basic example. This example is not functional. It will start the OS installer but then fail because we don't provide the preseed file for Ubuntu to self-install. Still, the example serves to show the basic configuration: + + + ```json { "type": "vmware-iso", "iso_url": "http://old-releases.ubuntu.com/releases/precise/ubuntu-12.04.2-server-amd64.iso", - "iso_checksum": "af5f788aee1b32c4b2634734309cc9e9", - "iso_checksum_type": "md5", + "iso_checksum": "md5:af5f788aee1b32c4b2634734309cc9e9", "ssh_username": "packer", "ssh_password": "packer", "shutdown_command": "shutdown -P now" } ``` + + + +```hcl +source "vmware-iso" "basic-example" { + iso_url = "http://old-releases.ubuntu.com/releases/precise/ubuntu-12.04.2-server-amd64.iso" + iso_checksum = "md5:af5f788aee1b32c4b2634734309cc9e9" + ssh_username = "packer" + ssh_password = "packer" + shutdown_command = "shutdown -P now" +} + +build { + sources = ["sources.vmware-iso.basic-example"] +} +``` + + + + ## VMware-ISO Builder Configuration Reference There are many configuration options available for the builder. In addition to diff --git a/website/pages/docs/builders/vmware/vmx.mdx b/website/pages/docs/builders/vmware/vmx.mdx index 7ab1087ea..5166faa2d 100644 --- a/website/pages/docs/builders/vmware/vmx.mdx +++ b/website/pages/docs/builders/vmware/vmx.mdx @@ -34,6 +34,9 @@ VMware virtual machine. Here is an example. This example is fully functional as long as the source path points to a real VMX file with the proper settings: + + + ```json { "type": "vmware-vmx", @@ -44,6 +47,25 @@ points to a real VMX file with the proper settings: } ``` + + + +```hcl +source "vmware-vmx" "basic-example" { + source_path = "/path/to/a/vm.vmx" + ssh_username = "root" + ssh_password = "root" + shutdown_command = "shutdown -P now" +} + +build { + sources = ["sources.vmware-vmx.basic-example"] +} +``` + + + + ## Configuration Reference There are many configuration options available for the VMware builder. They are