knife-cloud 1.2.1 → 1.2.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.
- checksums.yaml +5 -5
- data/LICENSE +1 -1
- data/lib/chef/knife/cloud/chefbootstrap/bootstrap_distribution.rb +2 -2
- data/lib/chef/knife/cloud/chefbootstrap/bootstrap_options.rb +115 -133
- data/lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb +6 -6
- data/lib/chef/knife/cloud/chefbootstrap/bootstrapper.rb +11 -12
- data/lib/chef/knife/cloud/chefbootstrap/ssh_bootstrap_protocol.rb +49 -54
- data/lib/chef/knife/cloud/chefbootstrap/unix_distribution.rb +3 -3
- data/lib/chef/knife/cloud/chefbootstrap/windows_distribution.rb +3 -3
- data/lib/chef/knife/cloud/chefbootstrap/winrm_bootstrap_protocol.rb +11 -12
- data/lib/chef/knife/cloud/command.rb +24 -27
- data/lib/chef/knife/cloud/exceptions.rb +1 -2
- data/lib/chef/knife/cloud/fog/options.rb +8 -8
- data/lib/chef/knife/cloud/fog/service.rb +54 -60
- data/lib/chef/knife/cloud/helpers.rb +2 -3
- data/lib/chef/knife/cloud/list_resource_command.rb +6 -7
- data/lib/chef/knife/cloud/list_resource_options.rb +5 -5
- data/lib/chef/knife/cloud/server/create_command.rb +30 -35
- data/lib/chef/knife/cloud/server/create_options.rb +33 -34
- data/lib/chef/knife/cloud/server/delete_command.rb +12 -15
- data/lib/chef/knife/cloud/server/delete_options.rb +7 -8
- data/lib/chef/knife/cloud/server/list_command.rb +22 -22
- data/lib/chef/knife/cloud/server/list_options.rb +9 -10
- data/lib/chef/knife/cloud/server/options.rb +7 -7
- data/lib/chef/knife/cloud/server/show_command.rb +5 -5
- data/lib/chef/knife/cloud/server/show_options.rb +5 -6
- data/lib/chef/knife/cloud/service.rb +12 -13
- data/lib/knife-cloud/version.rb +2 -2
- data/lib/test/fixtures/knife.rb +3 -3
- data/lib/test/fixtures/validation.pem +27 -0
- data/lib/test/knife-utils/helper.rb +11 -11
- data/lib/test/knife-utils/knife_test_utils.rb +4 -4
- data/lib/test/knife-utils/matchers.rb +3 -3
- data/lib/test/knife-utils/test_bed.rb +38 -38
- data/lib/test/templates/windows-chef-client-msi.erb +3 -4
- data/lib/test/templates/windows-shell.erb +2 -2
- metadata +12 -152
- data/.gitignore +0 -33
- data/.travis.yml +0 -6
- data/CHANGELOG.md +0 -133
- data/CONTRIBUTING.md +0 -5
- data/Gemfile +0 -9
- data/README.md +0 -421
- data/Rakefile +0 -35
- data/ci.gemfile +0 -18
- data/knife-cloud.gemspec +0 -26
- data/spec/resource_spec_helper.rb +0 -49
- data/spec/server_command_common_spec_helper.rb +0 -48
- data/spec/spec_helper.rb +0 -25
- data/spec/support/shared_examples_for_command.rb +0 -35
- data/spec/support/shared_examples_for_servercreatecommand.rb +0 -144
- data/spec/support/shared_examples_for_serverdeletecommand.rb +0 -77
- data/spec/support/shared_examples_for_service.rb +0 -85
- data/spec/unit/bootstrap_protocol_spec.rb +0 -98
- data/spec/unit/bootstrapper_spec.rb +0 -171
- data/spec/unit/cloud_command_spec.rb +0 -35
- data/spec/unit/command_spec.rb +0 -49
- data/spec/unit/fog_service_spec.rb +0 -163
- data/spec/unit/list_resource_command_spec.rb +0 -140
- data/spec/unit/server_create_command_spec.rb +0 -198
- data/spec/unit/server_delete_command_spec.rb +0 -25
- data/spec/unit/server_list_command_spec.rb +0 -119
- data/spec/unit/server_show_command_spec.rb +0 -64
- data/spec/unit/service_spec.rb +0 -46
- data/spec/unit/ssh_bootstrap_protocol_spec.rb +0 -116
- data/spec/unit/unix_distribution_spec.rb +0 -37
- data/spec/unit/windows_distribution_spec.rb +0 -37
- data/spec/unit/winrm_bootstrap_protocol_spec.rb +0 -108
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3e9f12b223e859ae2666a230a73195fb48221bdf29edc0a3b345c0ddc40b6d3b
|
4
|
+
data.tar.gz: 80e5ff22aa5769a1e671526a6fe9a06436db5b3da5192f24dd02a63d5a961089
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c200c5564f6273a92472f0591bd04173b0e266488bddc3320ccccc5be2c00bdea7ac979f661083f559dd7ee4b92e82d8ca8c83335bebbcda033b81fd610106e
|
7
|
+
data.tar.gz: c79491de45e5a99dc43fdcb9204e425c75f1768d90e9518069a8b8cda69b675584fa9f76ccf64aede16e4fd00f8efa2ab27f438d8b965b5bd56f3123e5b90835
|
data/LICENSE
CHANGED
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
3
|
-
# Copyright:: Copyright (c) 2013
|
3
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef/knife/cloud/helpers"
|
19
19
|
|
20
20
|
class Chef
|
21
21
|
class Knife
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
|
2
2
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
3
3
|
#
|
4
|
-
# Copyright:: Copyright (c) 2013
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,9 +15,9 @@
|
|
15
15
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
# See the License for the specific language governing permissions and
|
17
17
|
# limitations under the License.
|
18
|
-
require
|
19
|
-
require
|
20
|
-
require
|
18
|
+
require "chef/knife/winrm_base"
|
19
|
+
require "chef/knife/core/bootstrap_context"
|
20
|
+
require "net/ssh/multi"
|
21
21
|
|
22
22
|
class Chef
|
23
23
|
class Knife
|
@@ -29,199 +29,181 @@ class Chef
|
|
29
29
|
includer.class_eval do
|
30
30
|
|
31
31
|
deps do
|
32
|
-
require
|
33
|
-
require
|
34
|
-
require
|
35
|
-
require
|
36
|
-
require 'chef/knife/ssh'
|
32
|
+
require "chef/json_compat"
|
33
|
+
require "tempfile"
|
34
|
+
require "net/ssh"
|
35
|
+
require "chef/knife/ssh"
|
37
36
|
Chef::Knife::Ssh.load_deps
|
38
37
|
end
|
39
38
|
|
40
39
|
include Chef::Knife::WinrmBase
|
41
40
|
|
42
41
|
option :ssh_user,
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
42
|
+
short: "-x USERNAME",
|
43
|
+
long: "--ssh-user USERNAME",
|
44
|
+
description: "The ssh username",
|
45
|
+
default: "root"
|
47
46
|
|
48
47
|
option :ssh_password,
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
48
|
+
short: "-P PASSWORD",
|
49
|
+
long: "--ssh-password PASSWORD",
|
50
|
+
description: "The ssh password"
|
52
51
|
|
53
52
|
option :ssh_port,
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
53
|
+
short: "-p PORT",
|
54
|
+
long: "--ssh-port PORT",
|
55
|
+
description: "The ssh port",
|
56
|
+
proc: Proc.new { |key| Chef::Config[:knife][:ssh_port] = key },
|
57
|
+
default: "22"
|
59
58
|
|
60
59
|
option :ssh_gateway,
|
61
|
-
:
|
62
|
-
:
|
63
|
-
:
|
60
|
+
long: "--ssh-gateway GATEWAY",
|
61
|
+
description: "The ssh gateway server. Any proxies configured in your ssh config are automatically used by default.",
|
62
|
+
proc: Proc.new { |key| Chef::Config[:knife][:ssh_gateway] = key }
|
64
63
|
|
65
64
|
option :ssh_gateway_identity,
|
66
|
-
:
|
67
|
-
:
|
68
|
-
:
|
65
|
+
long: "--ssh-gateway-identity IDENTITY_FILE",
|
66
|
+
description: "The private key for ssh gateway server",
|
67
|
+
proc: Proc.new { |key| Chef::Config[:knife][:ssh_gateway_identity] = key }
|
69
68
|
|
70
69
|
option :forward_agent,
|
71
|
-
:
|
72
|
-
:
|
73
|
-
:
|
70
|
+
long: "--forward-agent",
|
71
|
+
description: "Enable SSH agent forwarding",
|
72
|
+
boolean: true
|
74
73
|
|
75
74
|
option :identity_file,
|
76
|
-
:
|
77
|
-
:
|
78
|
-
:
|
75
|
+
short: "-i IDENTITY_FILE",
|
76
|
+
long: "--identity-file IDENTITY_FILE",
|
77
|
+
description: "The SSH identity file used for authentication"
|
79
78
|
|
80
79
|
option :chef_node_name,
|
81
|
-
:
|
82
|
-
:
|
83
|
-
:
|
80
|
+
short: "-N NAME",
|
81
|
+
long: "--node-name NAME",
|
82
|
+
description: "The Chef node name for your new node"
|
84
83
|
|
85
84
|
option :prerelease,
|
86
|
-
:
|
87
|
-
:
|
85
|
+
long: "--prerelease",
|
86
|
+
description: "Install the pre-release chef gems"
|
88
87
|
|
89
88
|
option :bootstrap_version,
|
90
|
-
:
|
91
|
-
:
|
92
|
-
:
|
89
|
+
long: "--bootstrap-version VERSION",
|
90
|
+
description: "The version of Chef to install",
|
91
|
+
proc: lambda { |v| Chef::Config[:knife][:bootstrap_version] = v }
|
93
92
|
|
94
93
|
option :bootstrap_proxy,
|
95
|
-
:
|
96
|
-
:
|
97
|
-
:
|
94
|
+
long: "--bootstrap-proxy PROXY_URL",
|
95
|
+
description: "The proxy server for the node being bootstrapped",
|
96
|
+
proc: Proc.new { |p| Chef::Config[:knife][:bootstrap_proxy] = p }
|
98
97
|
|
99
98
|
option :bootstrap_no_proxy,
|
100
|
-
:
|
101
|
-
:
|
102
|
-
:
|
103
|
-
|
104
|
-
option :distro,
|
105
|
-
:short => "-d DISTRO",
|
106
|
-
:long => "--distro DISTRO",
|
107
|
-
:description => "Bootstrap a distro using a template. [DEPRECATED] Use -t / --template option instead.",
|
108
|
-
:proc => Proc.new { |t|
|
109
|
-
Chef::Log.warn("[DEPRECATED] -d / --distro option is deprecated. Use -t / --template option instead.")
|
110
|
-
Chef::Config[:knife][:bootstrap_template] = t
|
111
|
-
}
|
99
|
+
long: "--bootstrap-no-proxy [NO_PROXY_URL|NO_PROXY_IP]",
|
100
|
+
description: "Do not proxy locations for the node being bootstrapped; this option is used internally by Chef",
|
101
|
+
proc: Proc.new { |np| Chef::Config[:knife][:bootstrap_no_proxy] = np }
|
112
102
|
|
113
103
|
option :bootstrap_template,
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
104
|
+
short: "-t TEMPLATE",
|
105
|
+
long: "--bootstrap-template TEMPLATE",
|
106
|
+
description: "Bootstrap Chef using a built-in or custom template. Set to the full path of an erb template or use one of the built-in templates."
|
117
107
|
|
118
108
|
option :use_sudo,
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
109
|
+
long: "--sudo",
|
110
|
+
description: "Execute the bootstrap via sudo",
|
111
|
+
boolean: true
|
122
112
|
|
123
113
|
option :use_sudo_password,
|
124
|
-
:
|
125
|
-
:
|
126
|
-
:
|
127
|
-
|
128
|
-
option :template_file,
|
129
|
-
:long => "--template-file TEMPLATE",
|
130
|
-
:description => "Full path to location of template to use. [DEPRECATED] Use -t / --bootstrap-template option instead.",
|
131
|
-
:proc => Proc.new { |v|
|
132
|
-
Chef::Log.warn("[DEPRECATED] --template-file option is deprecated. Use -t / --bootstrap-template option instead.")
|
133
|
-
v
|
134
|
-
}
|
114
|
+
long: "--use-sudo-password",
|
115
|
+
description: "Execute the bootstrap via sudo with password",
|
116
|
+
boolean: false
|
135
117
|
|
136
118
|
option :run_list,
|
137
|
-
:
|
138
|
-
:
|
139
|
-
:
|
140
|
-
:
|
141
|
-
:
|
119
|
+
short: "-r RUN_LIST",
|
120
|
+
long: "--run-list RUN_LIST",
|
121
|
+
description: "Comma separated list of roles/recipes to apply",
|
122
|
+
proc: lambda { |o| o.split(/[\s,]+/) },
|
123
|
+
default: []
|
142
124
|
|
143
125
|
option :first_boot_attributes,
|
144
|
-
:
|
145
|
-
:
|
146
|
-
:
|
147
|
-
:
|
148
|
-
:
|
126
|
+
short: "-j JSON_ATTRIBS",
|
127
|
+
long: "--json-attributes",
|
128
|
+
description: "A JSON string to be added to the first run of chef-client",
|
129
|
+
proc: lambda { |o| JSON.parse(o) },
|
130
|
+
default: {}
|
149
131
|
|
150
132
|
option :host_key_verify,
|
151
|
-
:
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
133
|
+
long: "--[no-]host-key-verify",
|
134
|
+
description: "Verify host key, enabled by default.",
|
135
|
+
boolean: true,
|
136
|
+
default: true
|
155
137
|
|
156
138
|
option :hint,
|
157
|
-
:
|
158
|
-
:
|
159
|
-
:
|
139
|
+
long: "--hint HINT_NAME[=HINT_FILE]",
|
140
|
+
description: "Specify Ohai Hint to be set on the bootstrap target. Use multiple --hint options to specify multiple hints.",
|
141
|
+
proc: Proc.new { |h|
|
160
142
|
Chef::Config[:knife][:hints] ||= Hash.new
|
161
143
|
name, path = h.split("=")
|
162
|
-
Chef::Config[:knife][:hints][name] = path ? JSON.parse(::File.read(path)) : Hash.new
|
144
|
+
Chef::Config[:knife][:hints][name] = path ? JSON.parse(::File.read(path)) : Hash.new }
|
163
145
|
|
164
146
|
option :secret,
|
165
|
-
:
|
166
|
-
:
|
167
|
-
:
|
147
|
+
short: "-s SECRET",
|
148
|
+
long: "--secret ",
|
149
|
+
description: "The secret key to use to encrypt data bag item values"
|
168
150
|
|
169
151
|
option :secret_file,
|
170
|
-
:
|
171
|
-
:
|
152
|
+
long: "--secret-file SECRET_FILE",
|
153
|
+
description: "A file containing the secret key to use to encrypt data bag item values"
|
172
154
|
|
173
155
|
option :bootstrap_url,
|
174
|
-
:
|
175
|
-
:
|
176
|
-
:
|
156
|
+
long: "--bootstrap-url URL",
|
157
|
+
description: "URL to a custom installation script",
|
158
|
+
proc: Proc.new { |u| Chef::Config[:knife][:bootstrap_url] = u }
|
177
159
|
|
178
160
|
option :bootstrap_curl_options,
|
179
|
-
:
|
180
|
-
:
|
181
|
-
:
|
161
|
+
long: "--bootstrap-curl-options OPTIONS",
|
162
|
+
description: "Add options to curl when install chef-client",
|
163
|
+
proc: Proc.new { |co| Chef::Config[:knife][:bootstrap_curl_options] = co }
|
182
164
|
|
183
165
|
option :auth_timeout,
|
184
|
-
:
|
185
|
-
:
|
186
|
-
:
|
166
|
+
long: "--auth-timeout MINUTES",
|
167
|
+
description: "The maximum time in minutes to wait to for authentication over the transport to the node to succeed. The default value is 25 minutes.",
|
168
|
+
default: 25
|
187
169
|
|
188
170
|
option :node_ssl_verify_mode,
|
189
|
-
:
|
190
|
-
:
|
191
|
-
:
|
192
|
-
valid_values =
|
171
|
+
long: "--node-ssl-verify-mode [peer|none]",
|
172
|
+
description: "Whether or not to verify the SSL cert for all HTTPS requests.",
|
173
|
+
proc: Proc.new { |v|
|
174
|
+
valid_values = %w{none peer}
|
193
175
|
unless valid_values.include?(v)
|
194
176
|
raise "Invalid value '#{v}' for --node-ssl-verify-mode. Valid values are: #{valid_values.join(", ")}"
|
195
177
|
end
|
196
178
|
}
|
197
179
|
|
198
180
|
option :node_verify_api_cert,
|
199
|
-
:
|
200
|
-
:
|
201
|
-
:
|
181
|
+
long: "--[no-]node-verify-api-cert",
|
182
|
+
description: "Verify the SSL cert for HTTPS requests to the Chef server API.",
|
183
|
+
boolean: true
|
202
184
|
|
203
185
|
option :bootstrap_install_command,
|
204
|
-
:
|
205
|
-
:
|
206
|
-
:
|
186
|
+
long: "--bootstrap-install-command COMMANDS",
|
187
|
+
description: "Custom command to install chef-client",
|
188
|
+
proc: Proc.new { |ic| Chef::Config[:knife][:bootstrap_install_command] = ic }
|
207
189
|
|
208
190
|
option :bootstrap_wget_options,
|
209
|
-
:
|
210
|
-
:
|
211
|
-
:
|
191
|
+
long: "--bootstrap-wget-options OPTIONS",
|
192
|
+
description: "Add options to wget when installing chef-client",
|
193
|
+
proc: Proc.new { |wo| Chef::Config[:knife][:bootstrap_wget_options] = wo }
|
212
194
|
|
213
195
|
option :bootstrap_vault_file,
|
214
|
-
:
|
215
|
-
:
|
196
|
+
long: "--bootstrap-vault-file VAULT_FILE",
|
197
|
+
description: "A JSON file with a list of vault(s) and item(s) to be updated"
|
216
198
|
|
217
199
|
option :bootstrap_vault_json,
|
218
|
-
:
|
219
|
-
:
|
200
|
+
long: "--bootstrap-vault-json VAULT_JSON",
|
201
|
+
description: "A JSON string with the vault(s) and item(s) to be updated"
|
220
202
|
|
221
203
|
option :bootstrap_vault_item,
|
222
|
-
:
|
223
|
-
:
|
224
|
-
:
|
204
|
+
long: "--bootstrap-vault-item VAULT_ITEM",
|
205
|
+
description: 'A single vault and item to update as "vault:item"',
|
206
|
+
proc: Proc.new { |i|
|
225
207
|
(vault, item) = i.split(/:/)
|
226
208
|
Chef::Config[:knife][:bootstrap_vault_item] ||= {}
|
227
209
|
Chef::Config[:knife][:bootstrap_vault_item][vault] ||= []
|
@@ -229,15 +211,15 @@ class Chef
|
|
229
211
|
Chef::Config[:knife][:bootstrap_vault_item]
|
230
212
|
}
|
231
213
|
option :msi_url,
|
232
|
-
:
|
233
|
-
:
|
234
|
-
:
|
235
|
-
:
|
236
|
-
|
214
|
+
short: "-u URL",
|
215
|
+
long: "--msi-url URL",
|
216
|
+
description: "Location of the Chef Client MSI. The default templates will prefer to download from this location. The MSI will be downloaded from chef.io if not provided.",
|
217
|
+
default: ""
|
218
|
+
|
237
219
|
option :install_as_service,
|
238
|
-
:
|
239
|
-
:
|
240
|
-
:
|
220
|
+
long: "--install-as-service",
|
221
|
+
description: "Install chef-client as service in windows machine",
|
222
|
+
default: false
|
241
223
|
|
242
224
|
end
|
243
225
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
|
2
2
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
3
3
|
#
|
4
|
-
# Copyright:: Copyright (c) 2013
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -17,8 +17,8 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
require
|
21
|
-
require
|
20
|
+
require "chef/knife/core/ui"
|
21
|
+
require "chef/knife/cloud/helpers"
|
22
22
|
|
23
23
|
class Chef
|
24
24
|
class Knife
|
@@ -35,7 +35,7 @@ class Chef
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def wait_for_server_ready
|
38
|
-
raise Chef::Exceptions::Override, "You must override wait_for_server_ready in #{self
|
38
|
+
raise Chef::Exceptions::Override, "You must override wait_for_server_ready in #{self}"
|
39
39
|
end
|
40
40
|
|
41
41
|
def send_bootstrap_command
|
@@ -60,8 +60,8 @@ class Chef
|
|
60
60
|
bootstrap.config[:first_boot_attributes] = locate_config_value(:first_boot_attributes)
|
61
61
|
bootstrap.config[:secret] = locate_config_value(:secret)
|
62
62
|
bootstrap.config[:secret_file] = locate_config_value(:secret_file)
|
63
|
-
bootstrap.config[:template_file] =
|
64
|
-
bootstrap.config[:bootstrap_template] =
|
63
|
+
bootstrap.config[:template_file] = locate_config_value(:template_file)
|
64
|
+
bootstrap.config[:bootstrap_template] = locate_config_value(:bootstrap_template)
|
65
65
|
bootstrap.config[:node_ssl_verify_mode] = locate_config_value(:node_ssl_verify_mode)
|
66
66
|
bootstrap.config[:node_verify_api_cert] = locate_config_value(:node_verify_api_cert)
|
67
67
|
bootstrap.config[:bootstrap_no_proxy] = locate_config_value(:bootstrap_no_proxy)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
|
2
2
|
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
|
3
3
|
#
|
4
|
-
# Copyright:: Copyright (c) 2013
|
4
|
+
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -17,12 +17,12 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require
|
23
|
-
require
|
24
|
-
require
|
25
|
-
require
|
20
|
+
require "chef/knife/core/ui"
|
21
|
+
require "chef/knife/cloud/chefbootstrap/ssh_bootstrap_protocol"
|
22
|
+
require "chef/knife/cloud/chefbootstrap/winrm_bootstrap_protocol"
|
23
|
+
require "chef/knife/cloud/chefbootstrap/windows_distribution"
|
24
|
+
require "chef/knife/cloud/chefbootstrap/unix_distribution"
|
25
|
+
require "chef/knife/cloud/exceptions"
|
26
26
|
|
27
27
|
class Chef
|
28
28
|
class Knife
|
@@ -47,9 +47,9 @@ class Chef
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def create_bootstrap_protocol
|
50
|
-
if @config[:bootstrap_protocol].nil?
|
50
|
+
if @config[:bootstrap_protocol].nil? || @config[:bootstrap_protocol] == "ssh"
|
51
51
|
SshBootstrapProtocol.new(@config)
|
52
|
-
elsif @config[:bootstrap_protocol] ==
|
52
|
+
elsif @config[:bootstrap_protocol] == "winrm"
|
53
53
|
WinrmBootstrapProtocol.new(@config)
|
54
54
|
else
|
55
55
|
# raise an exception, invalid bootstrap protocol.
|
@@ -60,9 +60,9 @@ class Chef
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def create_bootstrap_distribution
|
63
|
-
if @config[:image_os_type] ==
|
63
|
+
if @config[:image_os_type] == "windows"
|
64
64
|
Chef::Knife::Cloud::WindowsDistribution.new(@config)
|
65
|
-
elsif @config[:image_os_type] ==
|
65
|
+
elsif @config[:image_os_type] == "linux"
|
66
66
|
Chef::Knife::Cloud::UnixDistribution.new(@config)
|
67
67
|
else
|
68
68
|
# raise an exception, invalid bootstrap distribution.
|
@@ -75,4 +75,3 @@ class Chef
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
78
|
-
|