-
Notifications
You must be signed in to change notification settings - Fork 582
/
vsphere.go
63 lines (58 loc) · 2.23 KB
/
vsphere.go
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
package templates
const VsphereCloudProviderTemplate = `
[Global]
user = "{{ .VsphereConfig.Global.User }}"
password = "{{ .VsphereConfig.Global.Password }}"
{{- if ne .VsphereConfig.Global.VCenterIP "" }}
server = "{{ .VsphereConfig.Global.VCenterIP }}"
{{- end }}
{{- if ne .VsphereConfig.Global.VCenterPort "" }}
port = "{{ .VsphereConfig.Global.VCenterPort }}"
{{- end }}
insecure-flag = "{{ .VsphereConfig.Global.InsecureFlag }}"
{{- if ne .VsphereConfig.Global.Datacenters "" }}
datacenters = "{{ .VsphereConfig.Global.Datacenters }}"
{{- end }}
{{- if ne .VsphereConfig.Global.Datacenter "" }}
datacenter = "{{ .VsphereConfig.Global.Datacenter }}"
{{- end }}
{{- if ne .VsphereConfig.Global.DefaultDatastore "" }}
datastore = "{{ .VsphereConfig.Global.DefaultDatastore }}"
{{- end }}
{{- if ne .VsphereConfig.Global.WorkingDir "" }}
working-dir = "{{ .VsphereConfig.Global.WorkingDir }}"
{{- end }}
soap-roundtrip-count = "{{ .VsphereConfig.Global.RoundTripperCount }}"
{{- if ne .VsphereConfig.Global.VMUUID "" }}
vm-uuid = "{{ .VsphereConfig.Global.VMUUID }}"
{{- end }}
{{- if ne .VsphereConfig.Global.VMName "" }}
vm-name = "{{ .VsphereConfig.Global.VMName }}"
{{- end }}
{{ range $k,$v := .VsphereConfig.VirtualCenter }}
[VirtualCenter "{{ $k }}"]
user = "{{ $v.User }}"
password = "{{ $v.Password }}"
{{- if ne $v.VCenterPort "" }}
port = "{{ $v.VCenterPort }}"
{{- end }}
{{- if ne $v.Datacenters "" }}
datacenters = "{{ $v.Datacenters }}"
{{- end }}
soap-roundtrip-count = "{{ $v.RoundTripperCount }}"
{{- end }}
[Workspace]
server = "{{ .VsphereConfig.Workspace.VCenterIP }}"
datacenter = "{{ .VsphereConfig.Workspace.Datacenter }}"
folder = "{{ .VsphereConfig.Workspace.Folder }}"
default-datastore = "{{ .VsphereConfig.Workspace.DefaultDatastore }}"
resourcepool-path = "{{ .VsphereConfig.Workspace.ResourcePoolPath }}"
[Disk]
{{- if ne .VsphereConfig.Disk.SCSIControllerType "" }}
scsicontrollertype = {{ .VsphereConfig.Disk.SCSIControllerType }}
{{- end }}
[Network]
{{- if ne .VsphereConfig.Network.PublicNetwork "" }}
public-network = "{{ .VsphereConfig.Network.PublicNetwork }}"
{{- end }}
`