djo-vagrant-vsphere 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.bumpversion.cfg +11 -0
  3. data/.gitignore +8 -0
  4. data/.rubocop.yml +13 -0
  5. data/.rubocop_todo.yml +80 -0
  6. data/.travis.yml +11 -0
  7. data/CHANGELOG.md +250 -0
  8. data/DEVELOPMENT.md +67 -0
  9. data/Gemfile +16 -0
  10. data/LICENSE.txt +24 -0
  11. data/README.md +310 -0
  12. data/Rakefile +20 -0
  13. data/example_box/metadata.json +3 -0
  14. data/lib/vSphere/action.rb +195 -0
  15. data/lib/vSphere/action/clone.rb +239 -0
  16. data/lib/vSphere/action/close_vsphere.rb +22 -0
  17. data/lib/vSphere/action/connect_vsphere.rb +29 -0
  18. data/lib/vSphere/action/destroy.rb +41 -0
  19. data/lib/vSphere/action/get_ssh_info.rb +37 -0
  20. data/lib/vSphere/action/get_state.rb +41 -0
  21. data/lib/vSphere/action/is_created.rb +16 -0
  22. data/lib/vSphere/action/is_running.rb +16 -0
  23. data/lib/vSphere/action/message_already_created.rb +18 -0
  24. data/lib/vSphere/action/message_not_created.rb +18 -0
  25. data/lib/vSphere/action/message_not_running.rb +18 -0
  26. data/lib/vSphere/action/power_off.rb +40 -0
  27. data/lib/vSphere/action/power_on.rb +28 -0
  28. data/lib/vSphere/cap/public_address.rb +15 -0
  29. data/lib/vSphere/config.rb +60 -0
  30. data/lib/vSphere/errors.rb +11 -0
  31. data/lib/vSphere/plugin.rb +44 -0
  32. data/lib/vSphere/provider.rb +39 -0
  33. data/lib/vSphere/util/vim_helpers.rb +91 -0
  34. data/lib/vSphere/util/vm_helpers.rb +39 -0
  35. data/lib/vSphere/version.rb +5 -0
  36. data/lib/vagrant-vsphere.rb +18 -0
  37. data/locales/en.yml +64 -0
  38. data/spec/action_spec.rb +162 -0
  39. data/spec/clone_spec.rb +102 -0
  40. data/spec/connect_vsphere_spec.rb +26 -0
  41. data/spec/destroy_spec.rb +31 -0
  42. data/spec/get_ssh_info_spec.rb +31 -0
  43. data/spec/get_state_spec.rb +55 -0
  44. data/spec/is_created_spec.rb +29 -0
  45. data/spec/power_off_spec.rb +35 -0
  46. data/spec/spec_helper.rb +147 -0
  47. data/vSphere.gemspec +30 -0
  48. data/vsphere_screenshot.png +0 -0
  49. metadata +212 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 62c8acac5acdbbe6fde0b9a73e2341d3b9aba10b
4
+ data.tar.gz: 1a53f1d3d6ad0d4cb98f662471d79a76da717a4e
5
+ SHA512:
6
+ metadata.gz: d60e7c554575c31790d503f356e5e9f73fac76a028a19815aaaa1ae865baf8657b2763b21f5f5ca3f6cf7195faa6342934b31d416102379abaadc2cba5a3794d
7
+ data.tar.gz: 3f5ebfb413eb525f7617e21c4b5a1018820a1fd15ba89fc69d23681803e97cf4c901e2f2eee33b38b19947bbff94e5ce121249427b7821edbca22bfadd0a3b3e
data/.bumpversion.cfg ADDED
@@ -0,0 +1,11 @@
1
+ [bumpversion]
2
+ current_version = 1.6.0
3
+ tag = true
4
+ commit = true
5
+
6
+ [bumpversion:file:lib/vSphere/version.rb]
7
+
8
+ [bumpversion:file:README.md]
9
+ parse = version: (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
10
+ serialize = version: {major}.{minor}.{patch}
11
+
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ *~
2
+ .vagrant/*
3
+ Vagrantfile
4
+ pkg/*
5
+ *.box
6
+ Gemfile.lock
7
+ /vendor/
8
+ /synced_folders
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ Style/FileName:
4
+ Exclude:
5
+ - 'lib/vagrant-vsphere.rb'
6
+
7
+ Lint/RescueException:
8
+ Exclude:
9
+ # the logic in the method `find_clustercompute_or_compute_resource` does not
10
+ # work when rescuing StandardError, so exclude
11
+ # lib/vSphere/util/vim_helpers.rb to continue rescuing Exception in that
12
+ # method
13
+ - 'lib/vSphere/util/vim_helpers.rb'
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,80 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`
2
+ # on 2015-09-02 10:38:06 -0600 using RuboCop version 0.32.1.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ # Offense count: 1
9
+ Lint/NonLocalExitFromIterator:
10
+ Enabled: false
11
+
12
+ # Offense count: 11
13
+ Metrics/AbcSize:
14
+ Max: 120
15
+
16
+ # Offense count: 1
17
+ # Configuration parameters: CountComments.
18
+ Metrics/ClassLength:
19
+ Max: 169
20
+
21
+ # Offense count: 3
22
+ Metrics/CyclomaticComplexity:
23
+ Max: 18
24
+
25
+ # Offense count: 108
26
+ # Configuration parameters: AllowURI, URISchemes.
27
+ Metrics/LineLength:
28
+ Max: 177
29
+
30
+ # Offense count: 12
31
+ # Configuration parameters: CountComments.
32
+ Metrics/MethodLength:
33
+ Max: 60
34
+
35
+ # Offense count: 1
36
+ # Configuration parameters: CountComments.
37
+ Metrics/ModuleLength:
38
+ Max: 162
39
+
40
+ # Offense count: 3
41
+ Metrics/PerceivedComplexity:
42
+ Max: 19
43
+
44
+ # Offense count: 25
45
+ Style/Documentation:
46
+ Enabled: false
47
+
48
+ # Offense count: 1
49
+ # Cop supports --auto-correct.
50
+ Style/EmptyLiteral:
51
+ Enabled: false
52
+
53
+ # Offense count: 1
54
+ # Cop supports --auto-correct.
55
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
56
+ Style/FirstParameterIndentation:
57
+ Enabled: false
58
+
59
+ # Offense count: 5
60
+ # Cop supports --auto-correct.
61
+ # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
62
+ Style/HashSyntax:
63
+ Enabled: false
64
+
65
+ # Offense count: 2
66
+ # Cop supports --auto-correct.
67
+ # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
68
+ Style/RegexpLiteral:
69
+ Enabled: false
70
+
71
+ # Offense count: 3
72
+ # Cop supports --auto-correct.
73
+ # Configuration parameters: MultiSpaceAllowedForOperators.
74
+ Style/SpaceAroundOperators:
75
+ Enabled: false
76
+
77
+ # Offense count: 4
78
+ # Cop supports --auto-correct.
79
+ Style/SymbolLiteral:
80
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.0.0
5
+
6
+ before_install:
7
+ - rvm @global do gem uninstall bundler --all --executables
8
+ - gem uninstall bundler --all --executables
9
+ - gem install bundler --version '1.6.9'
10
+
11
+ sudo: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,250 @@
1
+ ## [1.6.0 (2016-01-21)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.6.0)
2
+
3
+ - Use Vagrant core API instead of waiting for SSH communicator, which should
4
+ resolve some WinRM connection issues
5
+ ([mkuzmin:wait-winrm](https://github.com/nsidc/vagrant-vsphere/pull/162)).
6
+
7
+ ## [1.5.0 (2015-09-08)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.5.0)
8
+
9
+ - Add support for custom attributes
10
+ ([michaeljb:custom-attributes](https://github.com/nsidc/vagrant-vsphere/pull/149)).
11
+
12
+ ## [1.4.1 (2015-09-01)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.4.1)
13
+
14
+ - Update dependency on [rbvmomi](https://github.com/vmware/rbvmomi) to 1.8.2
15
+ in order to resolve errors with parallelization
16
+ ([#139]((https://github.com/nsidc/vagrant-vsphere/issues/139)),
17
+ [edmcman:master](https://github.com/nsidc/vagrant-vsphere/pull/147)).
18
+
19
+ ## [1.4.0 (2015-07-29)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.4.0)
20
+
21
+ - Add ability to configure the address type (originally submitted in
22
+ [mreuvers:master](https://github.com/nsidc/vagrant-vsphere/pull/121), but
23
+ merged
24
+ [nsidc:address-type](https://github.com/nsidc/vagrant-vsphere/pull/142))
25
+
26
+ ## [1.3.0 (2015-07-21)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.3.0)
27
+
28
+ - Add ability to configure CPU and memory reservations
29
+ ([edmcman:resource_limit](https://github.com/nsidc/vagrant-vsphere/pull/137))
30
+ - Bypass "graceful" shut down attempts with `vagrant destroy --force`
31
+
32
+ ## [1.2.0 (2015-07-09)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.2.0)
33
+
34
+ - Add `public_address` provider capability
35
+ ([mkuzmin:public-address](https://github.com/nsidc/vagrant-vsphere/pull/130))
36
+ - Documentation update
37
+ ([standaloneSA:update-readme](https://github.com/nsidc/vagrant-vsphere/pull/133))
38
+
39
+ ## [1.1.0 (2015-07-09)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.1.0)
40
+
41
+ - Add explicit support for parallelization
42
+ ([xlucas:xlucas-patch-parallelization](https://github.com/nsidc/vagrant-vsphere/pull/126))
43
+ - Documentation updates
44
+ ([metrix78:metrix78-patch-1](https://github.com/nsidc/vagrant-vsphere/pull/127)
45
+ and
46
+ [fabriciocolombo:readme-ipaddress](https://github.com/nsidc/vagrant-vsphere/pull/128))
47
+
48
+ ## 1.0.1 (2015-01-06)
49
+
50
+ - Fix "undefined local variable or method datastore" error due to typo in a
51
+ variable name
52
+ ([#116 mkuzmin:datastore](https://github.com/nsidc/vagrant-vsphere/pull/116))
53
+ - Remove "missing required parameter uuid" error from `vagrant destroy` output
54
+ when no machine exists
55
+ ([#117 mkuzmin:destroy](https://github.com/nsidc/vagrant-vsphere/pull/117))
56
+
57
+ ## 1.0.0 (2015-01-05)
58
+
59
+ - Increase Vagrant requirement to 1.6.4+
60
+ - Update copyright date in LICENSE.txt
61
+
62
+ ## 0.19.1 (2014-12-31)
63
+
64
+ - Move version history and contributing notes out of `README.md` into separate
65
+ files
66
+ - Add RuboCop, fail the Travis-CI build if RuboCop or unit tests fail
67
+
68
+ ## 0.19.0 (2014-12-31)
69
+
70
+ - Add support for ClusterComputeResource and DatastoreCluster
71
+ ([#101 GregDomjan:StorageSDRS](https://github.com/nsidc/vagrant-vsphere/pull/101))
72
+
73
+ ## 0.18.0 (2014-12-30)
74
+
75
+ - Gracefully power off the VM with `vagrant halt`, and shutdown before
76
+ deleting the VM with `vagrant destroy`
77
+ ([#104 clintoncwolfe:shutdown-guest-on-halt](https://github.com/nsidc/vagrant-vsphere/pull/104))
78
+ - Add configuration option `mac` to specify a MAC address for the VM
79
+ ([#108 dataplayer:master](https://github.com/nsidc/vagrant-vsphere/pull/108))
80
+
81
+ ## 0.17.0 (2014-12-29)
82
+
83
+ - Add ability to configure the CPU Count
84
+ ([#96 rylarson:add-cpu-configuration](https://github.com/nsidc/vagrant-vsphere/pull/96))
85
+ - Prompt the user to enter a password if none is given, or the configuration
86
+ value is set to `:ask`
87
+ ([#97 topmedia:password-prompt](https://github.com/nsidc/vagrant-vsphere/pull/97))
88
+ - Add support for `vagrant reload`
89
+ ([#105 clintoncwolfe:add-reload-action](https://github.com/nsidc/vagrant-vsphere/pull/105))
90
+ - Fix compatibility with Vagrant 1.7 to use vSphere connection info from a
91
+ base box
92
+ ([#111 mkuzmin:get-state](https://github.com/nsidc/vagrant-vsphere/pull/111))
93
+
94
+ ## 0.16.0 (2014-10-01)
95
+
96
+ - Add ability to configure amount of memory the new cloned VM will have
97
+ ([#94 rylarson:add-memory-configuration](https://github.com/nsidc/vagrant-vsphere/pull/94))
98
+
99
+ ## 0.15.0 (2014-09-23)
100
+
101
+ - Make `vagrant destroy` work in all vm states
102
+ ([#93 rylarson:make-destroy-work-in-all-vm-states](https://github.com/nsidc/vagrant-vsphere/pull/93),
103
+ fixes [#77](https://github.com/nsidc/vagrant-vsphere/issues/77))
104
+ - If the VM is powered on, then it is powered off, and destroyed
105
+ - If the VM is powered off, it is just destroyed
106
+ - If the VM is suspended, it is powered on, then powered off, then
107
+ destroyed
108
+
109
+ ## 0.14.0 (2014-09-19)
110
+
111
+ - Add vlan configuration
112
+ ([#91 rylarson:add-vlan-configuration](https://github.com/nsidc/vagrant-vsphere/pull/91))
113
+ - Added a new configuration option `vlan` that lets you specify the vlan
114
+ string
115
+ - If vlan is set, the clone spec is modified with an edit action to connect
116
+ the first NIC on the VM to the configured VLAN
117
+
118
+ ## 0.13.1 (2014-09-18)
119
+
120
+ - Change Nokogiri major version dependency
121
+ ([#90 highsineburgh:SAITRADLab-master](https://github.com/nsidc/vagrant-vsphere/pull/90))
122
+
123
+ ## 0.13.0 (2014-09-03)
124
+
125
+ - Find and install box file for multi-provider boxes automatically
126
+ ([#86 mkuzmin:install-box](https://github.com/nsidc/vagrant-vsphere/pull/86)
127
+ &
128
+ [#87 mkuzmin/provider-name](https://github.com/nsidc/vagrant-vsphere/pull/87))
129
+
130
+ ## 0.12.0 (2014-08-16)
131
+
132
+ - Use a directory name where `Vagrantfile` is stored as a prefix for VM name
133
+ ([#82 mkuzmin:name-prefix](https://github.com/nsidc/vagrant-vsphere/pull/82))
134
+
135
+ ## 0.11.0 (2014-07-17)
136
+
137
+ - Create the VM target folder if it doesn't exist
138
+ ([#76 marnovdm:feature/create_vm_folder](https://github.com/nsidc/vagrant-vsphere/pull/76))
139
+
140
+ ## 0.10.0 (2014-07-07)
141
+
142
+ - New optional parameter to clone into custom folder in vSphere
143
+ ([#73 mikola-spb:vm-base-path](https://github.com/nsidc/vagrant-vsphere/pull/73))
144
+ - Follows [semver](http://semver.org/) better, this adds functionality in a
145
+ backwards compatible way, so bumps the minor. 0.9.0, should have been a
146
+ major version
147
+
148
+ ## 0.9.2 (2014-07-07)
149
+
150
+ - Instruct Vagrant to set the guest hostname according to `Vagrantfile`
151
+ ([#69 ddub:set-hostname](https://github.com/nsidc/vagrant-vsphere/pull/69))
152
+
153
+ ## 0.9.1 (2014-07-07)
154
+
155
+ - Reuse folder sync code from Vagrant core
156
+ ([#66 mkuzmin:sync-folders](https://github.com/nsidc/vagrant-vsphere/pull/66))
157
+
158
+ ## 0.9.0 (2014-07-07)
159
+
160
+ - Increases Vagrant requirements to 1.6.3+
161
+ - Supports differentiating between SSH/WinRM communicator
162
+ ([#67 marnovdm:feature/waiting-for-winrm](https://github.com/nsidc/vagrant-vsphere/pull/67))
163
+
164
+ ## 0.8.5 (2014-07-07)
165
+
166
+ - Fixed synced folders to work with WinRM communicator
167
+ ([#72 10thmagnitude:master](https://github.com/nsidc/vagrant-vsphere/pull/72))
168
+
169
+ ## 0.8.4 (2014-07-07)
170
+
171
+ - Use root resource pool when cloning from template
172
+ ([#63: matt-richardson:support-resource-pools-on-vsphere-standard-edition](https://github.com/nsidc/vagrant-vsphere/pull/63))
173
+
174
+ ## 0.8.3 (2014-07-03)
175
+
176
+ - Fixed "No error message" on rbvmomi method calls
177
+ ([#74: mkuzmin:rbvmomi-error-messages](https://github.com/nsidc/vagrant-vsphere/pull/74))
178
+
179
+ ## 0.8.2 (2014-04-23)
180
+
181
+ - Fixes no error messages
182
+ ([#58 leth:no-error-message](https://github.com/nsidc/vagrant-vsphere/pull/58))
183
+ - Fixes typo ([#57 marnovdm](https://github.com/nsidc/vagrant-vsphere/pull/57))
184
+ - Fixes additional no error messages
185
+
186
+ ## 0.8.1 (2014-04-10)
187
+
188
+ - Fixes [#47](https://github.com/nsidc/vagrant-vsphere/issues/47) via
189
+ [#52 olegz-alertlogic](https://github.com/nsidc/vagrant-vsphere/pull/52)
190
+
191
+ ## 0.8.0 (2014-04-08)
192
+
193
+ - Adds configuration for connecting via proxy server
194
+ ([#40 tkak:feature-proxy-connection](https://github.com/nsidc/vagrant-vsphere/pull/40))
195
+
196
+ ## 0.7.2 (2014-04-08)
197
+
198
+ - Includes template in get_location
199
+ ([#38 tim95030:issue-27](https://github.com/nsidc/vagrant-vsphere/pull/38))
200
+ - Updates `Gemfile` to fall back to old version of Vagrant if ruby < 2.0.0 is
201
+ available
202
+
203
+ ## 0.7.1 (2014-03-17)
204
+
205
+ - Fixes rsync error reporting
206
+ - Updates `locales/en.yaml`
207
+ - Restricts RbVmomi dependency
208
+
209
+ ## 0.7.0 (2013-12-31)
210
+
211
+ - Handle multiple private key paths
212
+ - Add auto name generation based on machine name
213
+ - Add support for linked clones
214
+
215
+ ## 0.6.0 (2013-11-21)
216
+
217
+ - Add support for the `vagrant ssh -c` command
218
+
219
+ ## 0.5.1 (2013-10-21)
220
+
221
+ - Fix rsync on Windows, adapted from
222
+ [mitchellh/vagrant-aws#77](https://github.com/mitchellh/vagrant-aws/pull/77)
223
+
224
+ ## 0.5.0 (2013-10-17)
225
+
226
+ - Allow setting static ip addresses using Vagrant private networks
227
+ - Allow cloning from VM or template
228
+
229
+ ## 0.4.0
230
+
231
+ - Add support for specifying datastore location for new VMs
232
+
233
+ ## 0.3.0
234
+
235
+ - Lock Nokogiri version at 1.5.10 to prevent library conflicts
236
+ - Add support for customization specs
237
+
238
+ ## 0.2.0
239
+
240
+ - Add halt action
241
+ ([#16 catharsis:haltaction](https://github.com/nsidc/vagrant-vsphere/pull/16))
242
+
243
+ ## 0.1.0
244
+
245
+ - Add folder syncing with guest OS
246
+ - Add provisioning
247
+
248
+ ## 0.0.1
249
+
250
+ - Initial release
data/DEVELOPMENT.md ADDED
@@ -0,0 +1,67 @@
1
+ ### Contributing
2
+
3
+ 1. Fork it
4
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
5
+ 3. Commit your RuboCop-compliant and test-passing changes (`git commit -am 'Add
6
+ some feature'`)
7
+ 4. Push to the branch (`git push origin my-new-feature`)
8
+ 5. Create new Pull Request
9
+
10
+ ### Versioning
11
+
12
+ This plugin follows the principles of
13
+ [Semantic Versioning 2.0.0](http://semver.org/).
14
+
15
+ ### Unit Tests
16
+
17
+ Please run the unit tests to verify your changes. To do this simply run `rake`.
18
+ If you want a quick merge, write a spec that fails before your changes are
19
+ applied and that passes after.
20
+
21
+ If you don't have rake installed, first install [bundler](http://bundler.io/)
22
+ and run `bundle install`. Then you can run `bundle exec rake`, even if rake is
23
+ still not installed to your `PATH`.
24
+
25
+ ### RuboCop
26
+
27
+ Please make changes [RuboCop](https://github.com/bbatsov/rubocop)-compliant.
28
+
29
+ Changes that eliminate rules from
30
+ [`.rubocop_todo.yml`](https://github.com/nsidc/vagrant-vsphere/blob/master/.rubocop_todo.yml)
31
+ are welcome.
32
+
33
+ ### Travis-CI
34
+
35
+ [Travis](https://travis-ci.org/nsidc/vagrant-vsphere) will automatically run
36
+ RuboCop and the unit tests when you create a new pull request. If there are any
37
+ failures, a notification will appear on the pull request. To update your pull
38
+ request, simply create a new commit on the branch that fixes the failures, and
39
+ push to the branch.
40
+
41
+ ### Development Without Building the Plugin
42
+
43
+ To test your changes when developing the plugin, you have two main
44
+ options. First, you can build and install the plugin from source every time you
45
+ make a change:
46
+
47
+ 1. Make changes
48
+ 2. `rake build`
49
+ 3. `vagrant plugin install ./pkg/vagrant-vsphere-$VERSION.gem`
50
+ 4. `vagrant up --provider=vsphere`
51
+
52
+ Second, you can use Bundler and the Vagrant gem to execute vagrant commands,
53
+ saving time as you never have to wait for the plugin to build and install:
54
+
55
+ 1. Make changes
56
+ 2. `bundle exec vagrant up --provider=vsphere`
57
+
58
+ This method uses the version of Vagrant specified in
59
+ [`Gemfile`](https://github.com/nsidc/vagrant-vsphere/blob/master/Gemfile). It
60
+ will also cause Bundler and Vagrant to output warnings every time you run
61
+ `bundle exec vagrant`, because `Gemfile` lists **vagrant-vsphere** twice (once
62
+ with `gemspec` and another time in the `group :plugins` block), and Vagrant
63
+ prefers to be run from the official installer rather than through the gem.
64
+
65
+ Despite those warning messages, this is the
66
+ [officially recommended](https://docs.vagrantup.com/v2/plugins/development-basics.html)
67
+ method for Vagrant plugin development.