-
Notifications
You must be signed in to change notification settings - Fork 22
/
example.tf
102 lines (81 loc) · 2.67 KB
/
example.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
provider "vix" {
// valid options are: "fusion", "workstation", "serverv1", "serverv2", "player"
// and "workstation_shared"
product = "fusion"
verify_ssl = false
// clone_type can be "full" or "linked". Advantages of one over the other
// are described here: https://www.vmware.com/support/ws5/doc/ws_clone_typeofclone.html
// cloning_strategy = "linked"
}
/*resource "vix_vswitch" "vmnet10" {
name = "vmnet10"
nat = true
dhcp = true
range = "192.168.1.0/24"
host_access = true
}*/
resource "vix_vm" "core01" {
name = "core01"
description = "Terraform VMWARE VIX test"
/*
* The provider will download, verify, decompress and untar the image.
* Ideally you will provide images that have VMware Tools installed already,
* otherwise the provider will be considerably limited for what it can do.
*/
image {
url = "https://github.com/hooklift/boxes/releases/download/stable/coreos-stable-vmware.box"
checksum = "5b20ba225b5d4e1a3c01e071f8c9f607ed6c6e1d88e6ed5a66387aaf75b9ee2b"
checksum_type = "sha256"
// If image is encrypted we need to provide a password
// password = "${var.password}"
}
cpus = 2
// Memory sizes must be provided using IEC sizes such as: kib, ki, mib, mi,
// gib or gi.
memory = "1.0gib"
upgrade_vhardware = false
tools_init_timeout = "15s"
// Be aware that GUI does not work if the virtual machine is encrypted
gui = true
// Whether to enable or disable all shared folders for this VM
sharedfolders = true
// Advanced configuration
/*network_adapter {
// type can be either "custom", "nat", "bridged" or "hostonly"
type = "custom"
mac_address = "00:00:00:00:00"
mac_address_type = "static"
// vswitch is only required when network type is "custom"
vswitch = ${vix_vswitch.vmnet10.name}
// vmxnet3 requires VMware Tools
driver = "vmxnet3"
}*/
// Minimal required
network_adapter {
type = "bridged"
}
network_adapter {
type = "nat"
mac_address = "00:50:56:aa:bb:cc"
mac_address_type = "static"
}
network_adapter {
type = "hostonly"
}
cdrom {
bus_type = "scsi"
image = "/Users/camilo/Dropbox/Development/hooklift/boxes/cfgdrv.iso"
}
// Adds an IDE device by default and autodetects the host's CDROM
cdrom {}
shared_folder {
name = "Dev1"
enable = false
guest_path = "/home/camilo/dev"
host_path = "/Users/camilo/Development"
readonly = false
}
}
output "IP address" {
value = "${vix_vm.core01.ip_address}"
}