chef-provisioning-vsphere 0.8.3.dev.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f96dd29fbfd941469ca3dacdd6f6d2e19770370
4
- data.tar.gz: d5023c13212aa6a1c1c14ee037a9f3c114d1d1c1
3
+ metadata.gz: f1e15f7e89cd09e356d98b1682e020a8f3097bfe
4
+ data.tar.gz: fe158186e2cd3db9fc8773f39a0a53d1961e1dbf
5
5
  SHA512:
6
- metadata.gz: 6bba46dc0ef4e84de46b54e31689fa119316a564dcffe4a105be75463a4dc7c78f0e9b9505dd8748fff2cdf14d2c63c4596fa7bd3a83b15bf0fd507cfd8c04ad
7
- data.tar.gz: 77c54aa40ce56afc3600075c7f6a302117ea0fad578c9e5a7460e5a0bed605addb067e4ae0173929ba299a3862184a9d2c9138988b1a138c1c06c107be541545
6
+ metadata.gz: 7d12658f0905e90b84c4aac0647057afff5cf12a9640116b969ee429d101c8318ebd6caf07d4d97d58d5e9dc379631d9cb57f087215da20defee6b7725adadb5
7
+ data.tar.gz: 052cb02786e6890f2ef5b32c444eafc39fd61fc5a602240a9fcdae01b3c7e5b7b526095a969b33e3896f75033ec23f859f324d6daf49b97c0a0e3f49bb7fb788
data/.gitignore CHANGED
@@ -1,3 +1,3 @@
1
- pkg/
2
- Gemfile.lock
1
+ pkg/
2
+ Gemfile.lock
3
3
  *.gem
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
- # -*- encoding: utf-8 -*-
2
- source "https://rubygems.org"
3
- gemspec
4
-
5
- gem "chef", "~> 12.3"
1
+ # -*- encoding: utf-8 -*-
2
+ source "https://rubygems.org"
3
+ gemspec
4
+
5
+ gem "chef", "~> 12.3"
data/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright (c) 2015 CenturyLink
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1
+ Copyright (c) 2015 CenturyLink
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,20 +1,20 @@
1
- Copyright (c) 2014 Rally Software Development Corp
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2014 Rally Software Development Corp
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,269 +1,269 @@
1
- chef-provisioning-vsphere
2
- ==================
3
-
4
- This is a [chef-provisioning](https://github.com/opscode/chef-provisioning) provisioner for [VMware vSphere](http://www.vmware.com/products/vsphere).
5
-
6
- chef-provisioning-vsphere supports provisioning Unix/ssh and Windows/winrm guest VMs.
7
-
8
- ## Prerequisites
9
-
10
- ### Vsphere infrastructure
11
-
12
- A vcenter and valid login credentials.
13
-
14
- ### VM Template
15
-
16
- A VM template capable of installing Chef 11.8 or newer. This can be either windows or linux flavored.
17
-
18
- ### A provisioning node (can be local)
19
-
20
- An environment equipped with the chef client and the chef-provisioning-vsphere gem.
21
-
22
- ## A basic provisioning recipe
23
-
24
- This is a minimal machine definition that will use a dhcp assigned ip (it assumes the presense of a dhcp server). For test purposes this uses a linked clone for a faster provisioning time. This recipe should be used with a linux template. Windows provisioned servers need to point to a chef server for the cookbooks since winrm does not support port forwarding and there fore cannot reach back on the chef-zero port to get the local cookbooks. See examples below.
25
-
26
- ```
27
- chef_gem 'chef-provisioning-vsphere' do
28
- action :install
29
- compile_time true
30
- end
31
-
32
- require 'chef/provisioning/vsphere_driver'
33
-
34
- with_vsphere_driver host: 'vcenter-host-name',
35
- insecure: true,
36
- user: 'you_user_name',
37
- password: 'your_mothers_maiden_name'
38
-
39
- with_machine_options :bootstrap_options => {
40
- use_linked_clone: true,
41
- num_cpus: 2,
42
- memory_mb: 4096,
43
- network_name: ["vlan_20_172.21.20"],
44
- datacenter: 'datacenter_name',
45
- resource_pool: 'cluster',
46
- template_name: 'path to template',
47
- customization_spec: {
48
- ipsettings: {
49
- dnsServerList: ['1.2.3.31','1.2.3.41']
50
- },
51
- :domain => 'local'
52
- }
53
- :ssh => {
54
- :user => 'root',
55
- :password => 'password',
56
- :paranoid => false,
57
- }
58
- }
59
-
60
- machine "my_machine_name" do
61
- run_list ['my_cookbook::default']
62
- end
63
-
64
- ```
65
-
66
- ## Provision!
67
-
68
- ```
69
- chef-client -z -o 'my_cookbook::provision'
70
- ```
71
-
72
- This will use chef-zero and needs no chef server (only works for ssh). Note that chef-zero does not support berkshelf style cookbook dependency resolution. So this works if the cookbook in the machine's runlist has no external dependencies. If it needs to reach out to supermarket or another berkshelf API server, perform a `berks vendor` to pull down the dependencies first.
73
-
74
- ## Supported machine bootstrapping options
75
-
76
- - `[:use_linked_clone]` - (true/false) great for testing but not recommended for production.
77
- - `[:datacenter]` - Name of vsphere datacenter (*required*)
78
- - `[:template_name]` - path to vmware template (can be template or a shutown vm) (*required*)
79
- - `[:template_folder]` - path to a folder containing the template (do not use if template is in the root vm folder)
80
- - `[:vm_folder]` - path to a folder where the machine will be created.
81
- - `[:datastore]` - name of datastore to use
82
- - `[:num_cpus]` - number of cpus to allocate to machine
83
- - `[:network_name]` - array of network names to use. A NIC will be added for each
84
- - `[:memory_mb]` - number of megabytes to allocate for machine
85
- - `[:host]` - `{cluster}`/`{host}` to use during provisioning
86
- - `[:resource_pool]` - `{cluster}`/`{resource pool}` to use during provisioning
87
- - `[:additional_disk_size_gb]` - an array of numbers, each signifying the number of gigabytes to assign to an additional disk (*his requires a datastore to be specified*)
88
- - `[:ssh][:user]` user to use for ssh/winrm (defaults to root on linux/administrator on windows)
89
- - `[:ssh][:password]` - password to use for ssh/winrm
90
- - `[:ssh][:paranoid]` - specifies the strictness of the host key verification checking
91
- - `[:ssh][:port]` port to use for ssh/winrm (defaults to 22 for ssh or 5985 for winrm)
92
- - `[:convergence_options][:install_msi_url]` - url to chef client msi to use (defaults to latest)
93
- - `[:convergence_options][:install_sh_url]` - the bach script to install chef client on linux (defaults to latest)
94
- - `[:customization_spec][:ipsettings][:ip]` static ip to assign to machine
95
- - `[:customization_spec][:ipsettings][:subnetMask]` - subnet to use
96
- - `[:customization_spec][:ipsettings][:gateway]` - array of possible gateways to use (this will most often be an array of 1)
97
- - `[:customization_spec][:ipsettings][:dnsServerList]` - array of DNS servers to use
98
- - `[:customization_spec][:domain]` - domain to use (if not 'local' on a windows machine it will attempt to domain join)
99
- - `[:customization_spec][:domainAdmin]` - domain admin account to use for domain join on windows (should be `{user name}`@`{domain}`)
100
- - `[:customization_spec][:domainAdminPassword]` - domain administrator password
101
- - `[:customization_spec][:hostname]` - hostname to use. Defaults to machine resource name if not provided
102
- - `[:customization_spec][:org_name]` - org name used in sysprep on windows
103
- - `[:customization_spec][:product_id]` - windows product key
104
- - `[:customization_spec][:time_zone]` - The case-sensitive timezone, such as Europe/Sofia based on the tz (timezone) database used by Linux and other Unix systems
105
- - `[:customization_spec][:win_time_zone]` - numeric time zone for windows
106
-
107
- ## Timeout options
108
- These are settings set at the root of `machine_options`. Chances are the defaults for these settings do not need to be changed:
109
-
110
- - `start_timeout` - number of seconds to wait for a machine to be accessible after a restart (default 10 minutes)
111
- - `create_timeout` - number of seconds to wait for a machine to be accessible after initiating provisioning (default 10 minutes)
112
- - `ready_timeout` - number of seconds to wait for customization to complete and vmware tools to come on line (default 5 minutes)
113
-
114
- ## More config examples
115
-
116
- ### Static IP and two additional disks of 20 and 50GB
117
-
118
- ```
119
- with_machine_options :bootstrap_options => {
120
- use_linked_clone: true,
121
- num_cpus: 2,
122
- memory_mb: 4096,
123
- network_name: ["vlan_20_172.21.20"],
124
- datacenter: 'datacenter_name',
125
- resource_pool: 'cluster',
126
- template_name: 'path to template',
127
- datastore: "my_data_store",
128
- additional_disk_size_gb: [50,20],
129
- customization_spec: {
130
- ipsettings: {
131
- ip: '192.168.3.4',
132
- subnetMask: '255.255.255.0',
133
- gateway: ["192.168.3.1"],
134
- dnsServerList: ['1.2.3.31','1.2.3.41']
135
- },
136
- :domain => 'local'
137
- }
138
- :ssh => {
139
- :user => 'root',
140
- :password => 'password',
141
- :paranoid => false,
142
- }
143
- }
144
- ```
145
-
146
- ### Domain joined windows machine
147
-
148
- ```
149
- with_machine_options :bootstrap_options => {
150
- use_linked_clone: true,
151
- num_cpus: 2,
152
- memory_mb: 4096,
153
- network_name: ['vlan_20_172.21.20'],
154
- datacenter: 'datacenter_name',
155
- resource_pool: 'cluster',
156
- template_name: 'path to template',
157
- customization_spec: {
158
- ipsettings: {
159
- dnsServerList: ['1.2.3.31','1.2.3.41']
160
- },
161
- domain: 'blah.com',
162
- domainAdmin: 'administrator@blah.com',
163
- domainAdminPassword: 'Passwordyoyoyo',
164
- org_name: 'acme',
165
- product_id: 'CDAA-87DC-3455-FF77-2AAC',
166
- win_time_zone: 4
167
- }
168
- ssh: {
169
- user: 'administrator',
170
- password: 'password',
171
- paranoid: false,
172
- }
173
- },
174
- :convergence_options => {
175
- :ssl_verify_mode => :verify_none
176
- }
177
- ```
178
- Note: You must run chef-client against a server for a windows box. You can do this locally since the provisioning recipe should not change the state of the provisioner. You will need to upload the cookbook (both the one doing the provisioning and the one used in the provisioned machine's runlist) before running `chef-client`.
179
-
180
- ```
181
- knife cookbook upload my_cookbook
182
- chef-client -o 'my_cookbook::provision' -c .chef/knife.rb
183
- ```
184
-
185
- ### Prefix all SSH commands with 'sudo ', for installing on hosts where options[:bootstrap_options][:ssh][:user] is not 'root'. The user must have 'NOPASSWD:ALL' in /etc/sudoers. This is compatible with chef-provisioning-fog functionality
186
-
187
- ```
188
- chef_gem 'chef-provisioning-vsphere' do
189
- action :install
190
- compile_time true
191
- end
192
-
193
- require 'chef/provisioning/vsphere_driver'
194
-
195
- with_vsphere_driver host: 'vcenter-host-name',
196
- insecure: true,
197
- user: 'you_user_name',
198
- password: 'your_mothers_maiden_name'
199
-
200
- with_machine_options :bootstrap_options => {
201
- use_linked_clone: true,
202
- num_cpus: 2,
203
- memory_mb: 4096,
204
- network_name: ["vlan_20_172.21.20"],
205
- datacenter: 'datacenter_name',
206
- resource_pool: 'cluster',
207
- template_name: 'path to template',
208
- customization_spec: {
209
- ipsettings: {
210
- dnsServerList: ['1.2.3.31','1.2.3.41']
211
- },
212
- :domain => 'local'
213
- }
214
- :ssh => {
215
- :user => 'root',
216
- :password => 'password',
217
- :paranoid => false,
218
- }
219
- },
220
- :sudo => true
221
-
222
- machine "my_machine_name" do
223
- run_list ['my_cookbook::default']
224
- end
225
-
226
- ```
227
- ## Kitchen Driver
228
-
229
- This chef-provisioning-driver comes with a test-kitchen driver. Here are example driver options you can add to your `kitchen.yml`.
230
-
231
- ```
232
- driver_plugin: vsphere
233
- driver_config:
234
- driver_options:
235
- host: '1.2.3.5'
236
- user: 'user'
237
- password: 'pass'
238
- insecure: true
239
- machine_options:
240
- start_timeout: 600
241
- create_timeout: 600
242
- ready_timeout: 90
243
- bootstrap_options:
244
- use_linked_clone: true
245
- datacenter: 'DC'
246
- template_name: 'UBUNTU1264'
247
- vm_folder: 'TEST'
248
- num_cpus: 2,
249
- network_name:
250
- - vlan_20_1.2.3.4
251
- memory_mb: 4096
252
- resource_pool: 'CLSTR/TEST'
253
- ssh:
254
- user: root
255
- paranoid: false
256
- password: password
257
- port: 22
258
- convergence_options:
259
- customization_spec:
260
- domain: local
261
- ipsettings:
262
- dnsServerList:
263
- - 8.8.8.8
264
- - 8.8.4.4
265
- ```
266
-
267
- ## Contributions are welcome!
268
-
269
- We took care to make this driver as generic as possible but there wll certainly be implementation nuances that may not work for everyone. We are happy to accept contributions to improve the driver and make it more accessible to a broader set of use cases.
1
+ chef-provisioning-vsphere
2
+ ==================
3
+
4
+ This is a [chef-provisioning](https://github.com/opscode/chef-provisioning) provisioner for [VMware vSphere](http://www.vmware.com/products/vsphere).
5
+
6
+ chef-provisioning-vsphere supports provisioning Unix/ssh and Windows/winrm guest VMs.
7
+
8
+ ## Prerequisites
9
+
10
+ ### Vsphere infrastructure
11
+
12
+ A vcenter and valid login credentials.
13
+
14
+ ### VM Template
15
+
16
+ A VM template capable of installing Chef 11.8 or newer. This can be either windows or linux flavored.
17
+
18
+ ### A provisioning node (can be local)
19
+
20
+ An environment equipped with the chef client and the chef-provisioning-vsphere gem.
21
+
22
+ ## A basic provisioning recipe
23
+
24
+ This is a minimal machine definition that will use a dhcp assigned ip (it assumes the presense of a dhcp server). For test purposes this uses a linked clone for a faster provisioning time. This recipe should be used with a linux template. Windows provisioned servers need to point to a chef server for the cookbooks since winrm does not support port forwarding and there fore cannot reach back on the chef-zero port to get the local cookbooks. See examples below.
25
+
26
+ ```
27
+ chef_gem 'chef-provisioning-vsphere' do
28
+ action :install
29
+ compile_time true
30
+ end
31
+
32
+ require 'chef/provisioning/vsphere_driver'
33
+
34
+ with_vsphere_driver host: 'vcenter-host-name',
35
+ insecure: true,
36
+ user: 'you_user_name',
37
+ password: 'your_mothers_maiden_name'
38
+
39
+ with_machine_options :bootstrap_options => {
40
+ use_linked_clone: true,
41
+ num_cpus: 2,
42
+ memory_mb: 4096,
43
+ network_name: ["vlan_20_172.21.20"],
44
+ datacenter: 'datacenter_name',
45
+ resource_pool: 'cluster',
46
+ template_name: 'path to template',
47
+ customization_spec: {
48
+ ipsettings: {
49
+ dnsServerList: ['1.2.3.31','1.2.3.41']
50
+ },
51
+ :domain => 'local'
52
+ }
53
+ :ssh => {
54
+ :user => 'root',
55
+ :password => 'password',
56
+ :paranoid => false,
57
+ }
58
+ }
59
+
60
+ machine "my_machine_name" do
61
+ run_list ['my_cookbook::default']
62
+ end
63
+
64
+ ```
65
+
66
+ ## Provision!
67
+
68
+ ```
69
+ chef-client -z -o 'my_cookbook::provision'
70
+ ```
71
+
72
+ This will use chef-zero and needs no chef server (only works for ssh). Note that chef-zero does not support berkshelf style cookbook dependency resolution. So this works if the cookbook in the machine's runlist has no external dependencies. If it needs to reach out to supermarket or another berkshelf API server, perform a `berks vendor` to pull down the dependencies first.
73
+
74
+ ## Supported machine bootstrapping options
75
+
76
+ - `[:use_linked_clone]` - (true/false) great for testing but not recommended for production.
77
+ - `[:datacenter]` - Name of vsphere datacenter (*required*)
78
+ - `[:template_name]` - path to vmware template (can be template or a shutown vm) (*required*)
79
+ - `[:template_folder]` - path to a folder containing the template (do not use if template is in the root vm folder)
80
+ - `[:vm_folder]` - path to a folder where the machine will be created.
81
+ - `[:datastore]` - name of datastore to use
82
+ - `[:num_cpus]` - number of cpus to allocate to machine
83
+ - `[:network_name]` - array of network names to use. A NIC will be added for each
84
+ - `[:memory_mb]` - number of megabytes to allocate for machine
85
+ - `[:host]` - `{cluster}`/`{host}` to use during provisioning
86
+ - `[:resource_pool]` - `{cluster}`/`{resource pool}` to use during provisioning
87
+ - `[:additional_disk_size_gb]` - an array of numbers, each signifying the number of gigabytes to assign to an additional disk (*his requires a datastore to be specified*)
88
+ - `[:ssh][:user]` user to use for ssh/winrm (defaults to root on linux/administrator on windows)
89
+ - `[:ssh][:password]` - password to use for ssh/winrm
90
+ - `[:ssh][:paranoid]` - specifies the strictness of the host key verification checking
91
+ - `[:ssh][:port]` port to use for ssh/winrm (defaults to 22 for ssh or 5985 for winrm)
92
+ - `[:convergence_options][:install_msi_url]` - url to chef client msi to use (defaults to latest)
93
+ - `[:convergence_options][:install_sh_url]` - the bach script to install chef client on linux (defaults to latest)
94
+ - `[:customization_spec][:ipsettings][:ip]` static ip to assign to machine
95
+ - `[:customization_spec][:ipsettings][:subnetMask]` - subnet to use
96
+ - `[:customization_spec][:ipsettings][:gateway]` - array of possible gateways to use (this will most often be an array of 1)
97
+ - `[:customization_spec][:ipsettings][:dnsServerList]` - array of DNS servers to use
98
+ - `[:customization_spec][:domain]` - domain to use (if not 'local' on a windows machine it will attempt to domain join)
99
+ - `[:customization_spec][:domainAdmin]` - domain admin account to use for domain join on windows (should be `{user name}`@`{domain}`)
100
+ - `[:customization_spec][:domainAdminPassword]` - domain administrator password
101
+ - `[:customization_spec][:hostname]` - hostname to use. Defaults to machine resource name if not provided
102
+ - `[:customization_spec][:org_name]` - org name used in sysprep on windows
103
+ - `[:customization_spec][:product_id]` - windows product key
104
+ - `[:customization_spec][:time_zone]` - The case-sensitive timezone, such as Europe/Sofia based on the tz (timezone) database used by Linux and other Unix systems
105
+ - `[:customization_spec][:win_time_zone]` - numeric time zone for windows
106
+
107
+ ## Timeout options
108
+ These are settings set at the root of `machine_options`. Chances are the defaults for these settings do not need to be changed:
109
+
110
+ - `start_timeout` - number of seconds to wait for a machine to be accessible after a restart (default 10 minutes)
111
+ - `create_timeout` - number of seconds to wait for a machine to be accessible after initiating provisioning (default 10 minutes)
112
+ - `ready_timeout` - number of seconds to wait for customization to complete and vmware tools to come on line (default 5 minutes)
113
+
114
+ ## More config examples
115
+
116
+ ### Static IP and two additional disks of 20 and 50GB
117
+
118
+ ```
119
+ with_machine_options :bootstrap_options => {
120
+ use_linked_clone: true,
121
+ num_cpus: 2,
122
+ memory_mb: 4096,
123
+ network_name: ["vlan_20_172.21.20"],
124
+ datacenter: 'datacenter_name',
125
+ resource_pool: 'cluster',
126
+ template_name: 'path to template',
127
+ datastore: "my_data_store",
128
+ additional_disk_size_gb: [50,20],
129
+ customization_spec: {
130
+ ipsettings: {
131
+ ip: '192.168.3.4',
132
+ subnetMask: '255.255.255.0',
133
+ gateway: ["192.168.3.1"],
134
+ dnsServerList: ['1.2.3.31','1.2.3.41']
135
+ },
136
+ :domain => 'local'
137
+ }
138
+ :ssh => {
139
+ :user => 'root',
140
+ :password => 'password',
141
+ :paranoid => false,
142
+ }
143
+ }
144
+ ```
145
+
146
+ ### Domain joined windows machine
147
+
148
+ ```
149
+ with_machine_options :bootstrap_options => {
150
+ use_linked_clone: true,
151
+ num_cpus: 2,
152
+ memory_mb: 4096,
153
+ network_name: ['vlan_20_172.21.20'],
154
+ datacenter: 'datacenter_name',
155
+ resource_pool: 'cluster',
156
+ template_name: 'path to template',
157
+ customization_spec: {
158
+ ipsettings: {
159
+ dnsServerList: ['1.2.3.31','1.2.3.41']
160
+ },
161
+ domain: 'blah.com',
162
+ domainAdmin: 'administrator@blah.com',
163
+ domainAdminPassword: 'Passwordyoyoyo',
164
+ org_name: 'acme',
165
+ product_id: 'CDAA-87DC-3455-FF77-2AAC',
166
+ win_time_zone: 4
167
+ }
168
+ ssh: {
169
+ user: 'administrator',
170
+ password: 'password',
171
+ paranoid: false,
172
+ }
173
+ },
174
+ :convergence_options => {
175
+ :ssl_verify_mode => :verify_none
176
+ }
177
+ ```
178
+ Note: You must run chef-client against a server for a windows box. You can do this locally since the provisioning recipe should not change the state of the provisioner. You will need to upload the cookbook (both the one doing the provisioning and the one used in the provisioned machine's runlist) before running `chef-client`.
179
+
180
+ ```
181
+ knife cookbook upload my_cookbook
182
+ chef-client -o 'my_cookbook::provision' -c .chef/knife.rb
183
+ ```
184
+
185
+ ### Prefix all SSH commands with 'sudo ', for installing on hosts where options[:bootstrap_options][:ssh][:user] is not 'root'. The user must have 'NOPASSWD:ALL' in /etc/sudoers. This is compatible with chef-provisioning-fog functionality
186
+
187
+ ```
188
+ chef_gem 'chef-provisioning-vsphere' do
189
+ action :install
190
+ compile_time true
191
+ end
192
+
193
+ require 'chef/provisioning/vsphere_driver'
194
+
195
+ with_vsphere_driver host: 'vcenter-host-name',
196
+ insecure: true,
197
+ user: 'you_user_name',
198
+ password: 'your_mothers_maiden_name'
199
+
200
+ with_machine_options :bootstrap_options => {
201
+ use_linked_clone: true,
202
+ num_cpus: 2,
203
+ memory_mb: 4096,
204
+ network_name: ["vlan_20_172.21.20"],
205
+ datacenter: 'datacenter_name',
206
+ resource_pool: 'cluster',
207
+ template_name: 'path to template',
208
+ customization_spec: {
209
+ ipsettings: {
210
+ dnsServerList: ['1.2.3.31','1.2.3.41']
211
+ },
212
+ :domain => 'local'
213
+ }
214
+ :ssh => {
215
+ :user => 'root',
216
+ :password => 'password',
217
+ :paranoid => false,
218
+ }
219
+ },
220
+ :sudo => true
221
+
222
+ machine "my_machine_name" do
223
+ run_list ['my_cookbook::default']
224
+ end
225
+
226
+ ```
227
+ ## Kitchen Driver
228
+
229
+ This chef-provisioning-driver comes with a test-kitchen driver. Here are example driver options you can add to your `kitchen.yml`.
230
+
231
+ ```
232
+ driver_plugin: vsphere
233
+ driver_config:
234
+ driver_options:
235
+ host: '1.2.3.5'
236
+ user: 'user'
237
+ password: 'pass'
238
+ insecure: true
239
+ machine_options:
240
+ start_timeout: 600
241
+ create_timeout: 600
242
+ ready_timeout: 90
243
+ bootstrap_options:
244
+ use_linked_clone: true
245
+ datacenter: 'DC'
246
+ template_name: 'UBUNTU1264'
247
+ vm_folder: 'TEST'
248
+ num_cpus: 2,
249
+ network_name:
250
+ - vlan_20_1.2.3.4
251
+ memory_mb: 4096
252
+ resource_pool: 'CLSTR/TEST'
253
+ ssh:
254
+ user: root
255
+ paranoid: false
256
+ password: password
257
+ port: 22
258
+ convergence_options:
259
+ customization_spec:
260
+ domain: local
261
+ ipsettings:
262
+ dnsServerList:
263
+ - 8.8.8.8
264
+ - 8.8.4.4
265
+ ```
266
+
267
+ ## Contributions are welcome!
268
+
269
+ We took care to make this driver as generic as possible but there wll certainly be implementation nuances that may not work for everyone. We are happy to accept contributions to improve the driver and make it more accessible to a broader set of use cases.