vagrant-vsphere 1.3.0 → 1.4.0

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: c01f25efa00ea98bcb452252a6b12b97b1b0995f
4
- data.tar.gz: 884af0b718650b7e200da266d733d14da07481dd
3
+ metadata.gz: 4307c8c51431eff788268fadd75b40aa9ef11999
4
+ data.tar.gz: cef638026da154cdf1ef3f309bbd6c4d86c8a18a
5
5
  SHA512:
6
- metadata.gz: 323c6212de083fabb6201868fa1a5aaa244a8cc3cd8b9ee4eb80ff6350e4ee857019b44a0a7b82c59e5932d9572b2d4fd24e4426c43d71be17673edeb86d72b9
7
- data.tar.gz: f4c4eb69428cc68ea185704f2c4d8684541457061f8328ccc675f8ddeb424d115e733c01337eef87d5a86833ab51bd0d0d334e10731d644a0204df144ab01478
6
+ metadata.gz: aaab5d5374e8b531a597814518bc1af885f460a81261e4c58a3ee164a532c876614013ce59fddcdaa86a66c1b97f22178b7bdc1c04fc3f48e273ad8de8dccdf1
7
+ data.tar.gz: e33528a10e88ff7daa3d1261c0e03884d515bbbbc58526697170ef03adc99ae121a919ab077f95bc01beae1b62418d4bc49855aa7e4dbce191140e3bc2e26352
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 1.3.0
2
+ current_version = 1.4.0
3
3
  tag = true
4
4
  commit = true
5
5
 
data/.rubocop_todo.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  # This configuration was generated by `rubocop --auto-gen-config`
2
- # on 2015-07-15 14:24:31 -0600 using RuboCop version 0.32.1.
2
+ # on 2015-07-21 12:35:10 -0600 using RuboCop version 0.32.1.
3
3
  # The point is for the user to remove these configuration records
4
4
  # one by one as the offenses are removed from the code base.
5
5
  # Note that changes in the inspected code, or installation of new
@@ -11,18 +11,18 @@ Lint/NonLocalExitFromIterator:
11
11
 
12
12
  # Offense count: 11
13
13
  Metrics/AbcSize:
14
- Max: 113
14
+ Max: 117
15
15
 
16
16
  # Offense count: 1
17
17
  # Configuration parameters: CountComments.
18
18
  Metrics/ClassLength:
19
- Max: 157
19
+ Max: 166
20
20
 
21
21
  # Offense count: 3
22
22
  Metrics/CyclomaticComplexity:
23
- Max: 17
23
+ Max: 18
24
24
 
25
- # Offense count: 103
25
+ # Offense count: 106
26
26
  # Configuration parameters: AllowURI, URISchemes.
27
27
  Metrics/LineLength:
28
28
  Max: 177
@@ -30,7 +30,7 @@ Metrics/LineLength:
30
30
  # Offense count: 12
31
31
  # Configuration parameters: CountComments.
32
32
  Metrics/MethodLength:
33
- Max: 56
33
+ Max: 57
34
34
 
35
35
  # Offense count: 1
36
36
  # Configuration parameters: CountComments.
@@ -39,7 +39,7 @@ Metrics/ModuleLength:
39
39
 
40
40
  # Offense count: 3
41
41
  Metrics/PerceivedComplexity:
42
- Max: 18
42
+ Max: 19
43
43
 
44
44
  # Offense count: 25
45
45
  Style/Documentation:
@@ -56,7 +56,7 @@ Style/EmptyLiteral:
56
56
  Style/FirstParameterIndentation:
57
57
  Enabled: false
58
58
 
59
- # Offense count: 1
59
+ # Offense count: 5
60
60
  # Cop supports --auto-correct.
61
61
  # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
62
62
  Style/HashSyntax:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.4.0 (2015-07-29)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.4.0)
2
+
3
+ - Add ability to configure the address type (originally submitted in
4
+ [mreuvers:master](https://github.com/nsidc/vagrant-vsphere/pull/121), but
5
+ merged
6
+ [nsidc:address-type](https://github.com/nsidc/vagrant-vsphere/pull/142))
7
+
1
8
  ## [1.3.0 (2015-07-21)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.3.0)
2
9
 
3
10
  - Add ability to configure CPU and memory reservations
data/README.md CHANGED
@@ -19,9 +19,9 @@ This provider is built on top of the
19
19
  * libxml2, libxml2-dev, libxslt, libxslt-dev
20
20
 
21
21
  ## Current Version
22
- **version: 1.3.0**
22
+ **version: 1.4.0**
23
23
 
24
- vagrant-vsphere (**version: 1.3.0**) is available from
24
+ vagrant-vsphere (**version: 1.4.0**) is available from
25
25
  [RubyGems.org](https://rubygems.org/gems/vagrant-vsphere)
26
26
 
27
27
  ## Installation
@@ -133,6 +133,8 @@ This provider has the following settings, all are required unless noted:
133
133
  * `mac` - _Optional_ Used to set the mac address of the new VM
134
134
  * `cpu_reservation` - _Optional_ Configure the CPU time (in MHz) to reserve for this VM
135
135
  * `mem_reservation` - _Optional_ Configure the memory (in MB) to reserve for this VM
136
+ * `addressType` - _Optional_ Configure the address type of the
137
+ [vSphere Virtual Ethernet Card](https://www.vmware.com/support/developer/vc-sdk/visdk2xpubs/ReferenceGuide/vim.vm.device.VirtualEthernetCard.html)
136
138
 
137
139
  ### Cloning from a VM rather than a template
138
140
 
@@ -194,9 +196,24 @@ executions.
194
196
  This is useful if running Vagrant from multiple directories or if multiple
195
197
  machines are defined in the Vagrantfile.
196
198
 
199
+ ### Setting addresType for network adapter
200
+
201
+ This sets the addressType of the network adapter, for example 'Manual' to
202
+ be able to set a manual mac address.
203
+ This value may depend on the version of vSphere you use. It may be necessary
204
+ to set this in combination with the mac field, in order to set a manual
205
+ mac address. For valid values for this field see VirtualEthernetCard api
206
+ documentation of vSphere.
207
+
208
+ ```ruby
209
+ vsphere.addressType = 'Manual'
210
+ ```
211
+
197
212
  ### Setting the MAC address
198
213
 
199
- To set a static MAC address, add a `vsphere.mac` to your `Vagrantfile`:
214
+ To set a static MAC address, add a `vsphere.mac` to your `Vagrantfile`.
215
+ In some cases you must also set `vsphere.addressType` (see above)
216
+ to make this work:
200
217
 
201
218
  ```ruby
202
219
  vsphere.mac = '00:50:56:XX:YY:ZZ'
@@ -36,6 +36,7 @@ module VagrantPlugins
36
36
  customization_info = get_customization_spec_info_by_name connection, machine
37
37
 
38
38
  spec[:customization] = get_customization_spec(machine, customization_info) unless customization_info.nil?
39
+ add_custom_address_type(template, spec, config.addressType) unless config.addressType.nil?
39
40
  add_custom_mac(template, spec, config.mac) unless config.mac.nil?
40
41
  add_custom_vlan(template, dc, spec, config.vlan) unless config.vlan.nil?
41
42
  add_custom_memory(spec, config.memory_mb) unless config.memory_mb.nil?
@@ -189,6 +190,15 @@ module VagrantPlugins
189
190
  spec[:config][:deviceChange].uniq!
190
191
  end
191
192
 
193
+ def add_custom_address_type(template, spec, addressType)
194
+ spec[:config][:deviceChange] = []
195
+ config = template.config
196
+ card = config.hardware.device.grep(RbVmomi::VIM::VirtualEthernetCard).first || fail(Errors::VSphereError, :missing_network_card)
197
+ card.addressType = addressType
198
+ card_spec = { :deviceChange => [{ :operation => :edit, :device => card }] }
199
+ template.ReconfigVM_Task(:spec => card_spec).wait_for_completion
200
+ end
201
+
192
202
  def add_custom_mac(template, spec, mac)
193
203
  modify_network_card(template, spec) do |card|
194
204
  card.macAddress = mac
@@ -20,6 +20,7 @@ module VagrantPlugins
20
20
  attr_accessor :proxy_host
21
21
  attr_accessor :proxy_port
22
22
  attr_accessor :vlan
23
+ attr_accessor :addressType
23
24
  attr_accessor :mac
24
25
  attr_accessor :memory_mb
25
26
  attr_accessor :cpu_count
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module VSphere
3
- VERSION = '1.3.0'
3
+ VERSION = '1.4.0'
4
4
  end
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -56,6 +56,7 @@ RSpec.configure do |config|
56
56
  memory_mb: nil,
57
57
  cpu_count: nil,
58
58
  mac: nil,
59
+ addressType: nil,
59
60
  cpu_reservation: nil,
60
61
  mem_reservation: nil)
61
62
  vm_config = double(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Grauch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-21 00:00:00.000000000 Z
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  requirements: []
199
199
  rubyforge_project:
200
- rubygems_version: 2.4.6
200
+ rubygems_version: 2.4.8
201
201
  signing_key:
202
202
  specification_version: 4
203
203
  summary: VMWare vSphere provider