chef-provisioning-vsphere 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +11 -6
- data/.travis.yml +3 -1
- data/CHANGELOG.md +17 -2
- data/README.md +3 -0
- data/chef-provisioning-vsphere.gemspec +8 -2
- data/lib/chef/provisioning/vsphere_driver/driver.rb +31 -0
- data/lib/chef/provisioning/vsphere_driver/version.rb +1 -1
- data/lib/chef/provisioning/vsphere_driver/vsphere_helpers.rb +7 -0
- data/lib/chef/provisioning/vsphere_driver/vsphere_url.rb +1 -1
- metadata +88 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 289ce4f36eb3464e0dee8507d8dce304be531298
|
4
|
+
data.tar.gz: 8ee5162a4546e66817898e591863afdfae034b3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bd7374ef470c24daf2eb2145b6243a93794b6c40a454c9995e75c497dd5f8acdf0d0723259a901c71c42b31a0d2383878bd35a08457192390c45fab7d7ccb1a
|
7
|
+
data.tar.gz: b350176f887d25256b507ba0f66ef38a87a6b856854a471d9c694e305481d59587e9b83a7925d0c4f00b88830e5a4045fcdb13fd21e98b87aff40636c28820d6
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2017-04-
|
3
|
+
# on 2017-04-20 16:38:44 -0500 using RuboCop version 0.47.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -36,10 +36,15 @@ Lint/UselessAssignment:
|
|
36
36
|
- 'lib/chef/provisioning/vsphere_driver/vsphere_helpers.rb'
|
37
37
|
- 'lib/kitchen/driver/vsphere.rb'
|
38
38
|
|
39
|
-
# Offense count:
|
39
|
+
# Offense count: 31
|
40
40
|
Metrics/AbcSize:
|
41
41
|
Max: 47
|
42
42
|
|
43
|
+
# Offense count: 1
|
44
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
45
|
+
Metrics/BlockLength:
|
46
|
+
Max: 27
|
47
|
+
|
43
48
|
# Offense count: 1
|
44
49
|
# Configuration parameters: CountBlocks.
|
45
50
|
Metrics/BlockNesting:
|
@@ -48,19 +53,19 @@ Metrics/BlockNesting:
|
|
48
53
|
# Offense count: 3
|
49
54
|
# Configuration parameters: CountComments.
|
50
55
|
Metrics/ClassLength:
|
51
|
-
Max:
|
56
|
+
Max: 599
|
52
57
|
|
53
|
-
# Offense count:
|
58
|
+
# Offense count: 7
|
54
59
|
Metrics/CyclomaticComplexity:
|
55
60
|
Max: 12
|
56
61
|
|
57
|
-
# Offense count:
|
62
|
+
# Offense count: 89
|
58
63
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
59
64
|
# URISchemes: http, https
|
60
65
|
Metrics/LineLength:
|
61
66
|
Max: 189
|
62
67
|
|
63
|
-
# Offense count:
|
68
|
+
# Offense count: 40
|
64
69
|
# Configuration parameters: CountComments.
|
65
70
|
Metrics/MethodLength:
|
66
71
|
Max: 62
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,25 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [1.
|
4
|
-
[Full Changelog](https://github.com/chef-partners/chef-provisioning-vsphere/compare/
|
3
|
+
## [1.1.0](https://github.com/chef-partners/chef-provisioning-vsphere/tree/1.1.0) (2017-04-20)
|
4
|
+
[Full Changelog](https://github.com/chef-partners/chef-provisioning-vsphere/compare/v1.0.0...1.1.0)
|
5
|
+
|
6
|
+
**Closed issues:**
|
7
|
+
|
8
|
+
- Skip bootstrap after provisioning [\#6](https://github.com/chef-partners/chef-provisioning-vsphere/issues/6)
|
9
|
+
|
10
|
+
**Merged pull requests:**
|
11
|
+
|
12
|
+
- document reqd fields for sysprep [\#11](https://github.com/chef-partners/chef-provisioning-vsphere/pull/11) ([nealbrown](https://github.com/nealbrown))
|
13
|
+
- Updated some depenant gems [\#10](https://github.com/chef-partners/chef-provisioning-vsphere/pull/10) ([jjasghar](https://github.com/jjasghar))
|
14
|
+
- Metalseargolid feature/ipv4 bootstrap [\#8](https://github.com/chef-partners/chef-provisioning-vsphere/pull/8) ([jjasghar](https://github.com/jjasghar))
|
15
|
+
- Add proxy support [\#7](https://github.com/chef-partners/chef-provisioning-vsphere/pull/7) ([jjasghar](https://github.com/jjasghar))
|
16
|
+
|
17
|
+
## [v1.0.0](https://github.com/chef-partners/chef-provisioning-vsphere/tree/v1.0.0) (2017-04-17)
|
18
|
+
[Full Changelog](https://github.com/chef-partners/chef-provisioning-vsphere/compare/v0.8.1...v1.0.0)
|
5
19
|
|
6
20
|
**Merged pull requests:**
|
7
21
|
|
22
|
+
- v1.0.0 release [\#4](https://github.com/chef-partners/chef-provisioning-vsphere/pull/4) ([jjasghar](https://github.com/jjasghar))
|
8
23
|
- Added links to the README [\#3](https://github.com/chef-partners/chef-provisioning-vsphere/pull/3) ([jjasghar](https://github.com/jjasghar))
|
9
24
|
- Cleanup for new release [\#2](https://github.com/chef-partners/chef-provisioning-vsphere/pull/2) ([jjasghar](https://github.com/jjasghar))
|
10
25
|
- ensure machine\_options and configs are symbolised for chef13 [\#1](https://github.com/chef-partners/chef-provisioning-vsphere/pull/1) ([jjlimepoint](https://github.com/jjlimepoint))
|
data/README.md
CHANGED
@@ -87,6 +87,8 @@ This will use chef-zero and needs no chef server (only works for ssh). Note that
|
|
87
87
|
- `[:host]` - `{cluster}`/`{host}` to use during provisioning
|
88
88
|
- `[:resource_pool]` - `{cluster}`/`{resource pool}` to use during provisioning
|
89
89
|
- `[:additional_disk_size_gb]` - an array of numbers, each signifying the number of gigabytes to assign to an additional disk (*this requires a datastore to be specified*)
|
90
|
+
- `[:bootstrap_ipv4]` - `true` / `false`, set to `true` to wait for an IPv4 address to become available before bootstrapping.
|
91
|
+
- `[:ipv4_timeout]` - use with `[:bootstrap_ipv4]`, set the time in seconds to wait before an IPv4 address is received (defaults to 30)
|
90
92
|
- `[:ssh][:user]` user to use for ssh/winrm (defaults to root on linux/administrator on windows)
|
91
93
|
- `[:ssh][:password]` - password to use for ssh/winrm
|
92
94
|
- `[:ssh][:paranoid]` - specifies the strictness of the host key verification checking
|
@@ -149,6 +151,7 @@ with_machine_options :bootstrap_options => {
|
|
149
151
|
```
|
150
152
|
|
151
153
|
### Domain joined windows machine
|
154
|
+
NOTE: customization_spec `org_name` and `product_id` are required for sysprep Windows machines.
|
152
155
|
|
153
156
|
```ruby
|
154
157
|
with_machine_options :bootstrap_options => {
|
@@ -21,11 +21,17 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.files = `git ls-files -z`.split("\x0")
|
22
22
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
23
23
|
|
24
|
-
s.add_dependency 'rbvmomi', '~> 1.
|
25
|
-
s.add_dependency 'chef-provisioning', '~>
|
24
|
+
s.add_dependency 'rbvmomi', '~> 1.10'
|
25
|
+
s.add_dependency 'chef-provisioning', '~> 2.0'
|
26
26
|
s.add_dependency 'github_changelog_generator'
|
27
|
+
s.add_dependency 'chef', '~> 12'
|
28
|
+
s.add_dependency 'cheffish', '~> 4'
|
27
29
|
|
28
30
|
s.add_development_dependency 'rspec'
|
29
31
|
s.add_development_dependency 'rake'
|
30
32
|
s.add_development_dependency 'chefstyle'
|
33
|
+
s.add_development_dependency 'pry'
|
34
|
+
s.add_development_dependency 'pry-byebug'
|
35
|
+
s.add_development_dependency 'pry-stack_explorer'
|
36
|
+
s.add_development_dependency 'rb-readline'
|
31
37
|
end
|
@@ -730,8 +730,39 @@ module ChefProvisioningVsphere
|
|
730
730
|
bootstrap_options[:customization_spec][:ipsettings][:ip]
|
731
731
|
end
|
732
732
|
else
|
733
|
+
if use_ipv4_during_bootstrap?(bootstrap_options)
|
734
|
+
wait_for_ipv4(bootstrap_ip_timeout(bootstrap_options), vm)
|
735
|
+
end
|
733
736
|
vm.guest.ipAddress
|
734
737
|
end
|
735
738
|
end
|
739
|
+
|
740
|
+
def use_ipv4_during_bootstrap?(bootstrap_options)
|
741
|
+
if bootstrap_options.key?(:bootstrap_ipv4)
|
742
|
+
return bootstrap_options[:bootstrap_ipv4] == true
|
743
|
+
end
|
744
|
+
false
|
745
|
+
end
|
746
|
+
|
747
|
+
def bootstrap_ip_timeout(bootstrap_options)
|
748
|
+
if bootstrap_options.key?(:ipv4_timeout)
|
749
|
+
return bootstrap_options[:ipv4_timeout].to_i
|
750
|
+
end
|
751
|
+
30
|
752
|
+
end
|
753
|
+
|
754
|
+
def wait_for_ipv4(timeout, vm)
|
755
|
+
sleep_time = 5
|
756
|
+
print 'Waiting for ipv4 address.'
|
757
|
+
tries = 0
|
758
|
+
max_tries = timeout > sleep_time ? timeout / sleep_time : 1
|
759
|
+
while (vm.guest.ipAddress.nil? || !IPAddr.new(vm.guest.ipAddress).ipv4?) && (tries += 1) <= max_tries
|
760
|
+
print '.'
|
761
|
+
sleep sleep_time
|
762
|
+
end
|
763
|
+
raise 'Timed out waiting for ipv4 address!' if tries > max_tries && !IPAddr.new(vm.guest.ipAddress).ipv4?
|
764
|
+
puts 'Found ipv4 address!'
|
765
|
+
true
|
766
|
+
end
|
736
767
|
end
|
737
768
|
end
|
@@ -1,11 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'rbvmomi'
|
3
|
+
require 'uri'
|
4
|
+
require 'net/http'
|
3
5
|
|
4
6
|
module ChefProvisioningVsphere
|
5
7
|
class VsphereHelper
|
6
8
|
$guest_op_managers = {} unless $guest_op_managers
|
7
9
|
|
8
10
|
def initialize(connect_options, datacenter_name)
|
11
|
+
http = Net::HTTP.new(connect_options[:host], connect_options[:port])
|
12
|
+
if http.proxy?
|
13
|
+
connect_options[:proxyHost] = http.proxy_address
|
14
|
+
connect_options[:proxyPort] = http.proxy_port
|
15
|
+
end
|
9
16
|
@connect_options = connect_options
|
10
17
|
@datacenter_name = datacenter_name
|
11
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-provisioning-vsphere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CenturyLink Cloud
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-04-
|
12
|
+
date: 2017-04-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rbvmomi
|
@@ -17,20 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 1.8.2
|
20
|
+
version: '1.10'
|
24
21
|
type: :runtime
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
27
24
|
requirements:
|
28
25
|
- - "~>"
|
29
26
|
- !ruby/object:Gem::Version
|
30
|
-
version: 1.
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.8.2
|
27
|
+
version: '1.10'
|
34
28
|
- !ruby/object:Gem::Dependency
|
35
29
|
name: chef-provisioning
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,9 +32,6 @@ dependencies:
|
|
38
32
|
- - "~>"
|
39
33
|
- !ruby/object:Gem::Version
|
40
34
|
version: '2.0'
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 2.0.1
|
44
35
|
type: :runtime
|
45
36
|
prerelease: false
|
46
37
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -48,9 +39,6 @@ dependencies:
|
|
48
39
|
- - "~>"
|
49
40
|
- !ruby/object:Gem::Version
|
50
41
|
version: '2.0'
|
51
|
-
- - ">="
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 2.0.1
|
54
42
|
- !ruby/object:Gem::Dependency
|
55
43
|
name: github_changelog_generator
|
56
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,6 +53,34 @@ dependencies:
|
|
65
53
|
- - ">="
|
66
54
|
- !ruby/object:Gem::Version
|
67
55
|
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: chef
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '12'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '12'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: cheffish
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '4'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '4'
|
68
84
|
- !ruby/object:Gem::Dependency
|
69
85
|
name: rspec
|
70
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,6 +123,62 @@ dependencies:
|
|
107
123
|
- - ">="
|
108
124
|
- !ruby/object:Gem::Version
|
109
125
|
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: pry
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: pry-byebug
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: pry-stack_explorer
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
type: :development
|
162
|
+
prerelease: false
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: rb-readline
|
170
|
+
requirement: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
175
|
+
type: :development
|
176
|
+
prerelease: false
|
177
|
+
version_requirements: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
110
182
|
description: Provisioner for creating vSphere VM instances in Chef Provisioning.
|
111
183
|
email: jj@chef.io
|
112
184
|
executables: []
|