vagrant-ovirt4 1.2.3 → 2.1.3

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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +3 -0
  3. data/.gitignore +1 -2
  4. data/CHANGELOG +50 -0
  5. data/Gemfile +6 -11
  6. data/Gemfile.lock +99 -163
  7. data/README.md +39 -24
  8. data/Rakefile +3 -16
  9. data/SECURITY.md +23 -0
  10. data/lib/vagrant-ovirt4/action/connect_ovirt.rb +29 -7
  11. data/lib/vagrant-ovirt4/action/create_vm.rb +14 -11
  12. data/lib/vagrant-ovirt4/action/disconnect_ovirt.rb +4 -1
  13. data/lib/vagrant-ovirt4/action/halt_vm.rb +11 -0
  14. data/lib/vagrant-ovirt4/action/read_ssh_info.rb +20 -6
  15. data/lib/vagrant-ovirt4/action/read_state.rb +7 -1
  16. data/lib/vagrant-ovirt4/action/snapshot_list.rb +15 -19
  17. data/lib/vagrant-ovirt4/action/start_vm.rb +13 -4
  18. data/lib/vagrant-ovirt4/action/wait_till_up.rb +7 -1
  19. data/lib/vagrant-ovirt4/action.rb +17 -8
  20. data/lib/vagrant-ovirt4/config.rb +31 -1
  21. data/lib/vagrant-ovirt4/errors.rb +4 -0
  22. data/lib/vagrant-ovirt4/util/connection.rb +40 -0
  23. data/lib/vagrant-ovirt4/util/machine_names.rb +21 -0
  24. data/lib/vagrant-ovirt4/version.rb +1 -1
  25. data/lib/vagrant-ovirt4.rb +4 -0
  26. data/locales/en.yml +6 -0
  27. data/spec/spec_helper.rb +2 -0
  28. data/spec/support/shared_context.rb +39 -0
  29. data/spec/vagrant-ovirt4/action/create_vm_spec.rb +47 -0
  30. data/spec/vagrant-ovirt4/action/read_ssh_info_spec.rb +31 -17
  31. data/spec/vagrant-ovirt4/action/start_vm_spec.rb +54 -0
  32. data/spec/vagrant-ovirt4/config_spec.rb +90 -17
  33. data/spec/vagrant-ovirt4/util/connection_spec.rb +80 -0
  34. data/vagrant-ovirt4.gemspec +2 -1
  35. metadata +35 -19
  36. data/.kitchen.yml +0 -83
  37. data/Jenkinsfile +0 -70
  38. data/lib/vagrant-ovirt4/action/sync_folders.rb +0 -69
  39. data/test/integration/bios_serial/bios_serial_spec.rb +0 -6
  40. data/test/integration/dynamic_network/network_spec.rb +0 -6
  41. data/test/integration/optimized_for.sh +0 -4
  42. data/test/integration/singleton-static_network/network_spec.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f0791674c10129bc4c799c0edc0a69688c5afad9bf97d5330c8dbfd804fc303
4
- data.tar.gz: ff664c4cf2241450255854076a784cade3b519143e27c96cfe202f1af8bbb456
3
+ metadata.gz: 7f8d267202b71616a27bf1a4b721fe29264a7128d7643d0059a0558a3a6d76c8
4
+ data.tar.gz: 4dfc4ee00d4dfef59a9a9acf0e4639bdcd86bf4f030de479e6e0c526eb088441
5
5
  SHA512:
6
- metadata.gz: 462531777be650d20de06a80c170d435733e62b42e60aa52600e9f52a72a36dd407be247682b68dccc8fad93b8b7d71c42c0f89f2734637be7e79c996f63fc9b
7
- data.tar.gz: 7d5c64d01517722e218f6aed6110c47fcb60aa50fc6f00d2b66e5c1e55f5e84494bd961255524b9fe950b4dbd77e0356075069e0d78b0afe5ddedaf46da25571
6
+ metadata.gz: 013cbee883c91387751dcb150c4cae7af3e73275845d67f9019e6b508564ad756adc48d8d6d84b721188bd631e006511a58928c3e44b34b0086deac8a50d2d74
7
+ data.tar.gz: b281f7740fbc84ca12bc8c81a95a6b1ebfeeaa4246c0726384b389a0130716291bf3d859650fcc697a22a7f97a671e114745e403a0b5bb27137b24197e6dc3a5
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: myoung34
data/.gitignore CHANGED
@@ -6,5 +6,4 @@
6
6
  /.idea
7
7
  *.gem
8
8
  /manifests
9
- hiera.yaml
10
- .kitchen
9
+ vendor
data/CHANGELOG ADDED
@@ -0,0 +1,50 @@
1
+ v2.1.2
2
+ 79a0074 Fix lock file
3
+
4
+ v2.1.1
5
+ 605663e Bump nokogiri from 1.13.3 to 1.13.4
6
+ 2981f5c Default to disabling run-once mode
7
+ f048313 Enable oVirt conn debugging when VAGRANT_LOG=info
8
+ 3555e36 Add safe connection closing methods
9
+ cdb765c Support :timeout and :timeout_connect options
10
+ tomeon/test-all-vmtype-andvmaffinity-values
11
+ 2a9a653 Rakefile: add RSpec task
12
+ 7641780 test all valid VmType and VmAffinity values
13
+ 54efcde Add tests for vmname and hostname settings
14
+ dc3ab3e Add "vmname" provider option
15
+ 233e4bb read_ssh_info: return nil on IPv4 lookup failure
16
+ fcff147 Bump nokogiri from 1.12.5 to 1.13.3
17
+ da44f24 Bump nokogiri from 1.11.4 to 1.12.5
18
+ 9025f4e Bump nokogiri from 1.11.3 to 1.11.4
19
+
20
+ v2.1.0
21
+ 41b8c63 Move where rspec-mocks is included.
22
+ 0015c45 Update engine binding.
23
+ b2a0015 Not actually using the vagrant-spec thing.
24
+ a598043 Address the change in parsing.
25
+ 0ad3b72 Get the tests runnable.
26
+ a8f1d5f Test the connection before passing it on for use.
27
+ 8adf277 list only snapshots for vm's defined in the environment
28
+ a2ee89b Add security.md
29
+ 3399aab Add CHANGELOG
30
+
31
+ v2.0.0
32
+
33
+ 1810832 Attempt to fix gem push
34
+ 9d1ef6b handle fallback with rescue
35
+ 6cc0f90 fix for backwards compatibility with ovirt 4.3
36
+ 2298314 Make no assumptions on biosdevname/systemd device naming
37
+ 1d870df Support for network interfaces named by biosdevname
38
+ 5c8035a add missing translation
39
+ f9b6e28 fixed double disconnect due to action_up used in combination wth with_ovirt
40
+ 96f17c0 fixed doule disconnect on reload due to use of with_ovirt
41
+ 697e3d4 fixed inconsistent usages of memory units (MB/MiB and GB/GiB)
42
+ 5a68e8b vagrant destroy only calls halt if vm is up
43
+ 8772ee9 fix for erroneous rsync and state error due to missing ip address
44
+ 5b49114 Bump nokogiri from 1.10.9 to 1.11.0
45
+ b8314fb fix for waiting indefinitely for an ip when deploying on ovirt 4.4
46
+ 722f2e0 Default to rsync instead of NFS like before
47
+ 2582f53 Use vagrant builtin rsync folder sync
48
+ 84c6c53 In case graceful shutdown failed, fallback to stopping VM immediately
49
+ 640d640 Fix up dependencies
50
+ 029b53b give guests a chance to shutdown gracefully before pulling the plug with a poweroff
data/Gemfile CHANGED
@@ -1,20 +1,15 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
3
  group :development do
4
- gem 'vagrant', :git => 'git://github.com/myoung34/vagrant.git'
4
+ gem 'rake'
5
+ gem 'rspec-core'
6
+ gem 'rspec-its'
7
+ gem "rspec-mocks", "~> 3.5"
5
8
  gem 'pry'
6
9
  gem 'byebug'
7
10
  gem 'pry-byebug'
8
- end
9
-
10
- group :testing do
11
- gem 'rspec-its'
12
- gem 'rspec'
13
- gem 'rake'
14
- gem 'kitchen-vagrant'
15
- gem 'kitchen-inspec'
16
- gem 'test-kitchen'
17
- gem 'net-scp', "~>1.2"
11
+ gem 'rake-release'
12
+ gem "vagrant", git: "https://github.com/hashicorp/vagrant.git"
18
13
  end
19
14
 
20
15
  group :plugins do
data/Gemfile.lock CHANGED
@@ -1,211 +1,149 @@
1
1
  GIT
2
- remote: git://github.com/myoung34/vagrant.git
3
- revision: 4572267c33f4ba569f68ad4bff026e9a7ef63b56
2
+ remote: https://github.com/hashicorp/vagrant.git
3
+ revision: 22795b161bf67a4c0ebbe32c9ce8777cb888c4a7
4
4
  specs:
5
- vagrant (1.9.3.dev)
6
- childprocess (~> 0.5.0)
7
- erubis (~> 2.7.0)
8
- hashicorp-checkpoint (~> 0.1.1)
9
- i18n (>= 0.6.0, <= 0.8.0)
10
- listen (~> 3.1.5)
5
+ vagrant (2.2.11.dev)
6
+ bcrypt_pbkdf (~> 1.0.0)
7
+ childprocess (~> 4.0.0)
8
+ ed25519 (~> 1.2.4)
9
+ erubi
10
+ hashicorp-checkpoint (~> 0.1.5)
11
+ i18n (~> 1.8)
12
+ listen (~> 3.1)
11
13
  log4r (~> 1.1.9, < 1.1.11)
14
+ mime (~> 0.4.4)
12
15
  net-scp (~> 1.2.0)
13
- net-sftp (~> 2.1)
14
- net-ssh (~> 3.0.1)
15
- nokogiri (= 1.6.7.1)
16
+ net-sftp (~> 3.0)
17
+ net-ssh (~> 6.0)
16
18
  rb-kqueue (~> 0.2.0)
17
19
  rest-client (>= 1.6.0, < 3.0)
18
20
  ruby_dep (<= 1.3.1)
21
+ rubyzip (~> 2.0)
22
+ vagrant_cloud (~> 2.0.3)
19
23
  wdm (~> 0.1.0)
20
- winrm (~> 2.1)
21
- winrm-elevated (~> 1.1)
22
- winrm-fs (~> 1.0)
24
+ winrm (>= 2.3.4, < 3.0)
25
+ winrm-elevated (>= 1.2.1, < 2.0)
26
+ winrm-fs (>= 1.3.4, < 2.0)
23
27
 
24
28
  PATH
25
29
  remote: .
26
30
  specs:
27
- vagrant-ovirt4 (1.2.1)
31
+ vagrant-ovirt4 (2.1.3)
28
32
  filesize (~> 0)
29
- ovirt-engine-sdk (~> 4.0.1)
33
+ nokogiri (~> 1)
34
+ ovirt-engine-sdk (~> 4)
30
35
 
31
36
  GEM
32
37
  remote: http://rubygems.org/
33
38
  specs:
34
- artifactory (2.7.0)
35
- blankslate (2.1.2.4)
36
- builder (3.2.3)
37
- byebug (9.0.6)
38
- childprocess (0.5.9)
39
- ffi (~> 1.0, >= 1.0.11)
40
- coderay (1.1.1)
41
- diff-lcs (1.3)
42
- docker-api (1.33.2)
43
- excon (>= 0.38.0)
44
- json
45
- domain_name (0.5.20170223)
39
+ bcrypt_pbkdf (1.0.1)
40
+ builder (3.2.4)
41
+ byebug (11.1.3)
42
+ childprocess (4.0.0)
43
+ coderay (1.1.3)
44
+ concurrent-ruby (1.1.10)
45
+ diff-lcs (1.5.0)
46
+ domain_name (0.5.20190701)
46
47
  unf (>= 0.0.5, < 1.0.0)
47
- erubis (2.7.0)
48
- excon (0.71.0)
49
- faraday (0.11.0)
50
- multipart-post (>= 1.2, < 3)
51
- ffi (1.11.1)
52
- filesize (0.1.1)
53
- gssapi (1.2.0)
48
+ ed25519 (1.2.4)
49
+ erubi (1.10.0)
50
+ ffi (1.15.5)
51
+ filesize (0.2.0)
52
+ gssapi (1.3.1)
54
53
  ffi (>= 1.0.1)
55
- gyoku (1.3.1)
54
+ gyoku (1.4.0)
56
55
  builder (>= 2.1.2)
57
- hashicorp-checkpoint (0.1.4)
58
- hashie (3.5.5)
59
- http-cookie (1.0.3)
56
+ rexml (~> 3.0)
57
+ hashicorp-checkpoint (0.1.5)
58
+ http-cookie (1.0.4)
60
59
  domain_name (~> 0.5)
61
60
  httpclient (2.8.3)
62
- i18n (0.8.0)
63
- inspec (1.15.0)
64
- faraday (>= 0.9.0)
65
- hashie (~> 3.4)
66
- json (>= 1.8, < 3.0)
67
- method_source (~> 0.8)
68
- mixlib-log
69
- parallel (~> 1.9)
70
- pry (~> 0)
71
- rainbow (~> 2)
72
- rspec (~> 3)
73
- rspec-its (~> 1.2)
74
- rspec_junit_formatter (~> 0.2.3)
75
- rubyzip (~> 1.1)
76
- sslshake (~> 1)
77
- thor (~> 0.19)
78
- toml (~> 0.1)
79
- train (>= 0.22.0, < 1.0)
80
- json (2.0.3)
81
- kitchen-inspec (0.17.0)
82
- hashie (~> 3.4)
83
- inspec (>= 0.34.0, < 2.0.0)
84
- test-kitchen (~> 1.6)
85
- kitchen-vagrant (1.0.2)
86
- test-kitchen (~> 1.4)
87
- listen (3.1.5)
88
- rb-fsevent (~> 0.9, >= 0.9.4)
89
- rb-inotify (~> 0.9, >= 0.9.7)
90
- ruby_dep (~> 1.2)
61
+ i18n (1.10.0)
62
+ concurrent-ruby (~> 1.0)
63
+ json (2.6.1)
64
+ listen (3.7.1)
65
+ rb-fsevent (~> 0.10, >= 0.10.3)
66
+ rb-inotify (~> 0.9, >= 0.9.10)
91
67
  little-plugger (1.1.4)
92
68
  log4r (1.1.10)
93
- logging (2.1.0)
69
+ logging (2.3.0)
94
70
  little-plugger (~> 1.1)
95
- multi_json (~> 1.10)
96
- method_source (0.8.2)
97
- mime-types (3.1)
71
+ multi_json (~> 1.14)
72
+ method_source (1.0.0)
73
+ mime (0.4.4)
74
+ mime-types (3.4.1)
98
75
  mime-types-data (~> 3.2015)
99
- mime-types-data (3.2016.0521)
100
- mini_portile2 (2.0.0)
101
- mixlib-install (2.1.12)
102
- artifactory
103
- mixlib-shellout
104
- mixlib-versioning
105
- thor
106
- mixlib-log (1.7.1)
107
- mixlib-shellout (2.2.7)
108
- mixlib-versioning (1.1.0)
109
- multi_json (1.12.1)
110
- multipart-post (2.0.0)
76
+ mime-types-data (3.2022.0105)
77
+ multi_json (1.15.0)
111
78
  net-scp (1.2.1)
112
79
  net-ssh (>= 2.6.5)
113
- net-sftp (2.1.2)
114
- net-ssh (>= 2.6.5)
115
- net-ssh (3.0.2)
116
- net-ssh-gateway (1.3.0)
117
- net-ssh (>= 2.6.5)
80
+ net-sftp (3.0.0)
81
+ net-ssh (>= 5.0.0, < 7.0.0)
82
+ net-ssh (6.1.0)
118
83
  netrc (0.11.0)
119
- nokogiri (1.6.7.1)
120
- mini_portile2 (~> 2.0.0.rc2)
84
+ nokogiri (1.13.4-x86_64-darwin)
85
+ racc (~> 1.4)
121
86
  nori (2.6.0)
122
- ovirt-engine-sdk (4.0.12)
123
- json
124
- parallel (1.10.0)
125
- parslet (1.5.0)
126
- blankslate (~> 2.0)
127
- pry (0.10.4)
128
- coderay (~> 1.1.0)
129
- method_source (~> 0.8.1)
130
- slop (~> 3.4)
131
- pry-byebug (3.4.0)
132
- byebug (~> 9.0)
133
- pry (~> 0.10)
134
- rainbow (2.2.1)
135
- rake (13.0.1)
136
- rb-fsevent (0.9.8)
137
- rb-inotify (0.9.8)
87
+ ovirt-engine-sdk (4.4.1)
88
+ json (>= 1, < 3)
89
+ pry (0.13.1)
90
+ coderay (~> 1.1)
91
+ method_source (~> 1.0)
92
+ pry-byebug (3.9.0)
93
+ byebug (~> 11.0)
94
+ pry (~> 0.13.0)
95
+ racc (1.6.0)
96
+ rake (13.0.6)
97
+ rake-release (1.3.0)
98
+ bundler (>= 1.11, < 3)
99
+ rb-fsevent (0.11.1)
100
+ rb-inotify (0.10.1)
101
+ ffi (~> 1.0)
102
+ rb-kqueue (0.2.8)
138
103
  ffi (>= 0.5.0)
139
- rb-kqueue (0.2.4)
140
- ffi (>= 0.5.0)
141
- rest-client (2.0.1)
104
+ rest-client (2.0.2)
142
105
  http-cookie (>= 1.0.2, < 2.0)
143
106
  mime-types (>= 1.16, < 4.0)
144
107
  netrc (~> 0.8)
145
- rspec (3.5.0)
146
- rspec-core (~> 3.5.0)
147
- rspec-expectations (~> 3.5.0)
148
- rspec-mocks (~> 3.5.0)
149
- rspec-core (3.5.4)
150
- rspec-support (~> 3.5.0)
151
- rspec-expectations (3.5.0)
108
+ rexml (3.2.5)
109
+ rspec-core (3.11.0)
110
+ rspec-support (~> 3.11.0)
111
+ rspec-expectations (3.11.0)
152
112
  diff-lcs (>= 1.2.0, < 2.0)
153
- rspec-support (~> 3.5.0)
154
- rspec-its (1.2.0)
113
+ rspec-support (~> 3.11.0)
114
+ rspec-its (1.3.0)
155
115
  rspec-core (>= 3.0.0)
156
116
  rspec-expectations (>= 3.0.0)
157
- rspec-mocks (3.5.0)
117
+ rspec-mocks (3.11.1)
158
118
  diff-lcs (>= 1.2.0, < 2.0)
159
- rspec-support (~> 3.5.0)
160
- rspec-support (3.5.0)
161
- rspec_junit_formatter (0.2.3)
162
- builder (< 4)
163
- rspec-core (>= 2, < 4, != 2.12.0)
119
+ rspec-support (~> 3.11.0)
120
+ rspec-support (3.11.0)
164
121
  ruby_dep (1.3.1)
165
- rubyntlm (0.6.1)
166
- rubyzip (1.3.0)
167
- safe_yaml (1.0.4)
168
- slop (3.6.0)
169
- sslshake (1.0.13)
170
- test-kitchen (1.15.0)
171
- mixlib-install (>= 1.2, < 3.0)
172
- mixlib-shellout (>= 1.2, < 3.0)
173
- net-scp (~> 1.1)
174
- net-ssh (>= 2.9, < 5.0)
175
- net-ssh-gateway (~> 1.2)
176
- safe_yaml (~> 1.0)
177
- thor (~> 0.18)
178
- thor (0.19.4)
179
- toml (0.1.2)
180
- parslet (~> 1.5.0)
181
- train (0.22.1)
182
- docker-api (~> 1.26)
183
- json (>= 1.8, < 3.0)
184
- mixlib-shellout (~> 2.0)
185
- net-scp (~> 1.2)
186
- net-ssh (>= 2.9, < 5.0)
187
- winrm (~> 2.0)
188
- winrm-fs (~> 1.0)
122
+ rubyntlm (0.6.3)
123
+ rubyzip (2.3.2)
189
124
  unf (0.1.4)
190
125
  unf_ext
191
- unf_ext (0.0.7.2)
126
+ unf_ext (0.0.8.1)
127
+ vagrant_cloud (2.0.3)
128
+ rest-client (~> 2.0.2)
192
129
  wdm (0.1.1)
193
- winrm (2.1.2)
130
+ winrm (2.3.6)
194
131
  builder (>= 2.1.2)
195
- erubis (~> 2.7)
132
+ erubi (~> 1.8)
196
133
  gssapi (~> 1.2)
197
134
  gyoku (~> 1.0)
198
135
  httpclient (~> 2.2, >= 2.2.0.2)
199
136
  logging (>= 1.6.1, < 3.0)
200
137
  nori (~> 2.0)
201
- rubyntlm (~> 0.6.0, >= 0.6.1)
202
- winrm-elevated (1.1.0)
138
+ rubyntlm (~> 0.6.0, >= 0.6.3)
139
+ winrm-elevated (1.2.3)
140
+ erubi (~> 1.8)
203
141
  winrm (~> 2.0)
204
142
  winrm-fs (~> 1.0)
205
- winrm-fs (1.0.1)
206
- erubis (~> 2.7)
143
+ winrm-fs (1.3.5)
144
+ erubi (~> 1.8)
207
145
  logging (>= 1.6.1, < 3.0)
208
- rubyzip (~> 1.1)
146
+ rubyzip (~> 2.0)
209
147
  winrm (~> 2.0)
210
148
 
211
149
  PLATFORMS
@@ -213,17 +151,15 @@ PLATFORMS
213
151
 
214
152
  DEPENDENCIES
215
153
  byebug
216
- kitchen-inspec
217
- kitchen-vagrant
218
- net-scp (~> 1.2)
219
154
  pry
220
155
  pry-byebug
221
156
  rake
222
- rspec
157
+ rake-release
158
+ rspec-core
223
159
  rspec-its
224
- test-kitchen
160
+ rspec-mocks (~> 3.5)
225
161
  vagrant!
226
162
  vagrant-ovirt4!
227
163
 
228
164
  BUNDLED WITH
229
- 1.14.4
165
+ 1.17.2
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [OvirtSDK4::Connection#initialize]: https://rubydoc.info/gems/ovirt-engine-sdk/OvirtSDK4%2FConnection:initialize
2
+
1
3
  # Vagrant oVirt v4 Provider
2
4
 
3
5
  This is a [Vagrant](http://www.vagrantup.com) 1.1+ plugin that adds an
@@ -63,6 +65,12 @@ Vagrant.configure("2") do |config|
63
65
  :ovirt__network_name => 'ovirtmgmt' #DHCP
64
66
  # Static configuration
65
67
  #:ovirt__ip => '192.168.2.198', :ovirt__network_name => 'ovirtmgmt', :ovirt__gateway => '192.168.2.125', :ovirt__netmask => '255.255.0.0', :ovirt__dns_servers => '192.168.2.1', :ovirt__dns_search => 'test.local'
68
+ # Static configuration with biosdevname. Guest OS assigns interface names (ens3, em1 or something else). ovirt__interface_name has to match that name.
69
+ #:ovirt__ip => '192.168.2.198', :ovirt__network_name => 'ovirtmgmt', :ovirt__gateway => '192.168.2.125', :ovirt__netmask => '255.255.0.0', :ovirt__dns_servers => '192.168.2.1', :ovirt__dns_search => 'test.local', :ovirt__interface_name => 'ens3'
70
+
71
+ # configure additional interface
72
+ # config.vm.network :private_network,
73
+ # :ovirt__ip => '192.168.2.199', :ovirt__network_name => 'ovirtmgmt', :ovirt__netmask => '255.255.0.0', :ovirt__interface_name => 'ens4'
66
74
 
67
75
  config.vm.provider :ovirt4 do |ovirt|
68
76
  ovirt.url = 'https://server/ovirt-engine/api'
@@ -70,13 +78,17 @@ Vagrant.configure("2") do |config|
70
78
  ovirt.password = "password"
71
79
  ovirt.insecure = true
72
80
  ovirt.debug = true
81
+ ovirt.timeout = 120 # seconds
82
+ ovirt.connect_timeout = 30 # seconds
73
83
  ovirt.filtered_api = true #see http://www.ovirt.org/develop/release-management/features/infra/user-portal-permissions/
74
84
  ovirt.cluster = 'Default'
85
+ ovirt.vmname = 'my-vm'
86
+ ovirt.run_once = false
75
87
  ovirt.template = 'Vagrant-Centos7-test'
76
88
  ovirt.console = 'vnc'
77
- ovirt.disk_size = '15 GB' # only growing is supported. works the same way as below memory settings
89
+ ovirt.disk_size = '15 GiB' # only growing is supported. works the same way as below memory settings
78
90
  ovirt.memory_size = '1 GiB' #see https://github.com/dominikh/filesize for usage
79
- ovirt.memory_guaranteed = '256 MB' #see https://github.com/dominikh/filesize for usage
91
+ ovirt.memory_guaranteed = '256 MiB' #see https://github.com/dominikh/filesize for usage
80
92
  ovirt.cpu_cores = 2
81
93
  ovirt.cpu_sockets = 2
82
94
  ovirt.cpu_threads = 2
@@ -99,8 +111,8 @@ end
99
111
  ### Configuration options
100
112
 
101
113
  1. Vagrant specific
102
- 1. `config.vm.hostname` => Sets the hostname of the VM
103
- a. Is the 'name' in the Virtual Machine tab of the UI
114
+ 1. `config.vm.hostname` => Sets the hostname of the VM. Optional. String.
115
+ Default is `"vagrant"`.
104
116
  a. Is the 'hostname' of the VM configured by `cloud-init`
105
117
  1. `config.vm.network` => Sets the network information of the VM.
106
118
  a. Note: `:ip` => is ignored, but `:ovirt__ip` is used and merged with `:ip`
@@ -112,7 +124,22 @@ end
112
124
  1. `username` => The username for the API. Required. String. No default value.
113
125
  1. `password` => The password for the API. Required. String. No default value.
114
126
  1. `insecure` => Allow connecting to SSL sites without certificates. Optional. Bool. Default is `false`
115
- 1. `debug` => Turn on additional log statements. Optional. Bool. Default is `false`.
127
+ 1. `debug` => Turn on additional log statements. Optional. Bool. Default is
128
+ `true` if Vagrant's logging verbosity is set to `info` or above
129
+ (`VAGRANT_LOG={info,debug,...}`); otherwise, the default is `false`.
130
+ 1. `timeout` => Per [the oVirt SDK docs][OvirtSDK4::Connection#initialize],
131
+ "The maximun (_sic_) total time to wait for the response, in seconds. A value of
132
+ zero (the default) means wait for ever." Optional. Integer. Uses the
133
+ `OvirtSDK4::Connection` default if omitted; as of the time of writing,
134
+ this is `0` (i.e. wait forever).
135
+ 1. `connect_timeout` => Per [the oVirt SDK docs][OvirtSDK4::Connection#initialize],
136
+ "The maximun (_sic_) time to wait for connection establishment, in
137
+ seconds." Optional. Integer. Uses the `OvirtSDK4::Connection` default if
138
+ omitted; as of the time of writing, this is `300`.
139
+ 1. `vmname` => Sets the name of the VM. Optional. String. Default is
140
+ `config.vm.hostname`, if defined, otherwise `"vagrant"`.
141
+ a. Is the 'name' in the Virtual Machine tab of the UI
142
+ 1. `run_once` => Launch VM in run-once mode. Optional. Default is `false`.
116
143
  1. `template` => The name of the template to use for creation. Required. String. No Default value.
117
144
  1. `cluster` => The name of the ovirt cluster to create within. Required. String. No Default value.
118
145
  1. `console` => The type of remote viewing protocol to use. Required. String. No Default value.
@@ -132,25 +159,6 @@ end
132
159
  a. `storage_domain`: the storage domain where the disk should be created
133
160
 
134
161
 
135
- ## Testing
136
-
137
- Currently pull-requests are tested via [test-kitchen using kitchen-vagrant](https://github.com/test-kitchen/kitchen-vagrant).
138
- See [Jenkinsfile](Jenkinsfile) for more information.
139
- If you'd like to run them yourself, however, they make not work in all setups. For example they assume `192.168.2.0/24`, host pinning will probably not have a host that's in all set ups, and the template names might not match.
140
-
141
- To run Unit tests: `bundle install; bundle exec rspec`
142
-
143
- To run acceptance tests:
144
-
145
- ```bash
146
- export OVIRT_URL='https://yoururl/ovirt-engine/api''
147
- export OVIRT_USERNAME='yourname@internal'
148
- export OVIRT_PASSWORD='yourpassword!'
149
- gem build *.gemspec
150
- vagrant plugin install *.gem
151
- bundle exec kitchen test all
152
- ```
153
-
154
162
  ## Contributing
155
163
 
156
164
  1. Fork it
@@ -158,3 +166,10 @@ bundle exec kitchen test all
158
166
  3. Commit your changes (`git commit -am 'Add some feature'`)
159
167
  4. Push to the branch (`git push origin my-new-feature`)
160
168
  5. Create new Pull Request
169
+
170
+ Some pointers:
171
+
172
+ * To install the requirements when developing:
173
+ * `bundle install`
174
+ * To run the test suite:
175
+ * `bundle exec rspec spec/`
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'bundler/setup'
3
+ require 'rake/release'
3
4
  require 'rspec/core/rake_task'
4
- require 'kitchen/rake_tasks'
5
5
 
6
6
  # Immediately sync all stdout so that tools like buildbot can
7
7
  # immediately load in the output.
@@ -15,19 +15,6 @@ Dir.chdir(File.expand_path("../", __FILE__))
15
15
  # publishing.
16
16
  Bundler::GemHelper.install_tasks
17
17
 
18
- # Install the `spec` task so that we can run tests.
19
- RSpec::Core::RakeTask.new(:spec) do |t|
20
- t.rspec_opts = "--order defined"
21
- end
18
+ RSpec::Core::RakeTask.new
22
19
 
23
- # Default task is to run all tests
24
- namespace :test do
25
- task :all do
26
- RSpec::Core::RakeTask.new(:spec)
27
- Rake::Task["spec"].execute
28
- Kitchen::RakeTasks.new
29
- Rake::Task['kitchen:all'].invoke
30
- end
31
- end
32
-
33
- task :default => 'test:all'
20
+ task :default => [:spec]
data/SECURITY.md ADDED
@@ -0,0 +1,23 @@
1
+ ## Security
2
+
3
+ If you believe you have found a security vulnerability, please report it to me as described below.
4
+
5
+ ## Reporting Security Issues
6
+
7
+ **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to me directly at [myoung34@my.apsu.edu](mailto:myoung34@my.apsu.edu).
8
+
9
+ If you'd like to communicate securely, my keybase is [here](https://keybase.io/3vilpenguin)
10
+
11
+ Please include the requested information listed below (as much as you can provide) to help better understand the nature and scope of the possible issue:
12
+
13
+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
14
+ * Full paths of source file(s) related to the manifestation of the issue
15
+ * The location of the affected source code (tag/branch/commit or direct URL)
16
+ * Any special configuration required to reproduce the issue
17
+ * Step-by-step instructions to reproduce the issue
18
+ * Proof-of-concept or exploit code (if possible)
19
+ * Impact of the issue, including how an attacker might exploit the issue
20
+
21
+ ## Preferred Languages
22
+
23
+ I prefer all communications to be in English.
@@ -19,17 +19,39 @@ module VagrantPlugins
19
19
  conn_attr[:url] = "#{config.url}"
20
20
  conn_attr[:username] = config.username if config.username
21
21
  conn_attr[:password] = config.password if config.password
22
- conn_attr[:debug] = config.debug if config.debug
23
22
  conn_attr[:insecure] = true if config.insecure
24
23
  conn_attr[:headers] = {'Filter' => true} if config.filtered_api
24
+ conn_attr[:timeout] = config.timeout unless config.timeout.nil?
25
+ conn_attr[:connect_timeout] = config.connect_timeout unless config.connect_timeout.nil?
25
26
 
26
- @logger.info("Connecting to oVirt (#{config.url}) ...")
27
- OVirtProvider.ovirt_connection = OvirtSDK4::Connection.new(conn_attr)
28
- OVirtProvider.vms_service = OVirtProvider.ovirt_connection.system_service.vms_service
29
- env[:connection] = OVirtProvider.ovirt_connection
30
- env[:vms_service] = OVirtProvider.vms_service
27
+ # Respect VAGRANT_LOG setting -- any level at least as verbose as
28
+ # "info" will result in logging oVirt connection debugging messages
29
+ # (read: libcurl verbose output).
30
+ conn_attr[:debug] = config.debug or @logger.info?
31
+
32
+ # Inject our own logger so that messages are namespaced under
33
+ # "connect_ovirt"
34
+ conn_attr[:log] = @logger
31
35
 
32
- @app.call(env)
36
+ @logger.info("Connecting to oVirt (#{config.url}) ...")
37
+ ovirt_connection = OvirtSDK4::Connection.new(conn_attr)
38
+ vms_service = ovirt_connection.system_service.vms_service
39
+
40
+ # XXX: Continue setting deprecated global properties. Use of the
41
+ # related values from env should be preferred.
42
+ OVirtProvider.ovirt_connection = ovirt_connection
43
+ OVirtProvider.vms_service = vms_service
44
+
45
+ begin
46
+ ovirt_connection.test(true, 30)
47
+ rescue => error
48
+ raise Errors::ServiceConnectionError,
49
+ :error_message => error.message
50
+ else
51
+ env[:connection] = ovirt_connection
52
+ env[:vms_service] = vms_service
53
+ @app.call(env)
54
+ end
33
55
  end
34
56
 
35
57
  end