knife-azure 1.9.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/azure/azure_interface.rb +2 -3
- data/lib/azure/custom_errors.rb +1 -1
- data/lib/azure/helpers.rb +1 -1
- data/lib/azure/resource_management/ARM_deployment_template.rb +157 -162
- data/lib/azure/resource_management/ARM_interface.rb +72 -73
- data/lib/azure/resource_management/vnet_config.rb +11 -10
- data/lib/azure/resource_management/windows_credentials.rb +19 -19
- data/lib/azure/service_management/ASM_interface.rb +6 -5
- data/lib/azure/service_management/ag.rb +11 -11
- data/lib/azure/service_management/certificate.rb +7 -5
- data/lib/azure/service_management/connection.rb +10 -10
- data/lib/azure/service_management/deploy.rb +12 -14
- data/lib/azure/service_management/disk.rb +4 -2
- data/lib/azure/service_management/host.rb +7 -4
- data/lib/azure/service_management/image.rb +4 -4
- data/lib/azure/service_management/loadbalancer.rb +2 -2
- data/lib/azure/service_management/rest.rb +9 -8
- data/lib/azure/service_management/role.rb +67 -70
- data/lib/azure/service_management/storageaccount.rb +5 -3
- data/lib/azure/service_management/utility.rb +1 -1
- data/lib/azure/service_management/vnet.rb +1 -1
- data/lib/chef/knife/azure_ag_create.rb +13 -13
- data/lib/chef/knife/azure_ag_list.rb +1 -1
- data/lib/chef/knife/azure_base.rb +49 -66
- data/lib/chef/knife/azure_image_list.rb +6 -6
- data/lib/chef/knife/azure_internal-lb_create.rb +14 -14
- data/lib/chef/knife/azure_internal-lb_list.rb +1 -1
- data/lib/chef/knife/azure_server_create.rb +233 -268
- data/lib/chef/knife/azure_server_delete.rb +31 -31
- data/lib/chef/knife/azure_server_list.rb +1 -1
- data/lib/chef/knife/azure_server_show.rb +1 -1
- data/lib/chef/knife/azure_vnet_create.rb +15 -19
- data/lib/chef/knife/azure_vnet_list.rb +1 -1
- data/lib/chef/knife/azurerm_base.rb +39 -28
- data/lib/chef/knife/azurerm_server_create.rb +112 -177
- data/lib/chef/knife/azurerm_server_delete.rb +13 -13
- data/lib/chef/knife/azurerm_server_list.rb +1 -1
- data/lib/chef/knife/azurerm_server_show.rb +1 -1
- data/lib/chef/knife/bootstrap/bootstrapper.rb +34 -238
- data/lib/chef/knife/bootstrap/common_bootstrap_options.rb +77 -76
- data/lib/chef/knife/bootstrap_azure.rb +56 -33
- data/lib/chef/knife/bootstrap_azurerm.rb +46 -29
- data/lib/knife-azure/version.rb +18 -1
- metadata +28 -16
- data/lib/chef/knife/bootstrap/bootstrap_options.rb +0 -105
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Aliasgar Batterywala (aliasgar.batterywala@clogeny.com)
|
3
|
-
# Copyright:: Copyright
|
3
|
+
# Copyright:: Copyright 2010-2019, 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");
|
@@ -17,13 +17,13 @@
|
|
17
17
|
#
|
18
18
|
|
19
19
|
require "chef/knife/azure_base"
|
20
|
+
require "chef/knife/bootstrap"
|
20
21
|
require "chef/knife/bootstrap/common_bootstrap_options"
|
21
22
|
require "chef/knife/bootstrap/bootstrapper"
|
22
23
|
|
23
24
|
class Chef
|
24
25
|
class Knife
|
25
|
-
class BootstrapAzure < Knife
|
26
|
-
|
26
|
+
class BootstrapAzure < Knife::Bootstrap
|
27
27
|
include Knife::AzureBase
|
28
28
|
include Knife::Bootstrap::CommonBootstrapOptions
|
29
29
|
include Knife::Bootstrap::Bootstrapper
|
@@ -31,45 +31,70 @@ class Chef
|
|
31
31
|
banner "knife bootstrap azure SERVER (options)"
|
32
32
|
|
33
33
|
option :azure_dns_name,
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
34
|
+
short: "-d DNS_NAME",
|
35
|
+
long: "--azure-dns-name DNS_NAME",
|
36
|
+
description: "Optional. The DNS prefix name that is used to access the cloud service."
|
37
|
+
|
38
|
+
# run() would be executing from parent class
|
39
|
+
# Chef::Knife::Bootstrap, defined in core.
|
40
|
+
# Required methods have been overridden here
|
41
|
+
#### run() execution begins ####
|
42
|
+
|
43
|
+
def plugin_setup!; end
|
37
44
|
|
38
|
-
def
|
45
|
+
def validate_name_args!; end
|
46
|
+
|
47
|
+
def plugin_validate_options!
|
39
48
|
ui.info "Validating..."
|
40
49
|
validate_asm_keys!
|
50
|
+
end
|
41
51
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
51
|
-
else
|
52
|
-
raise ArgumentError, "Please specify the SERVER name which needs to be bootstrapped via the Chef Extension." if @name_args.length == 0
|
53
|
-
raise ArgumentError, "Please specify only one SERVER name which needs to be bootstrapped via the Chef Extension." if @name_args.length > 1
|
52
|
+
def plugin_create_instance!
|
53
|
+
if @name_args.length == 1
|
54
|
+
service.add_extension(@name_args[0], set_ext_params)
|
55
|
+
if locate_config_value(:extended_logs)
|
56
|
+
print "\n\nWaiting for the Chef Extension to become available/ready"
|
57
|
+
wait_until_extension_available(Time.now, 10)
|
58
|
+
print "\n\nWaiting for the first chef-client run"
|
59
|
+
fetch_chef_client_logs(Time.now, 35)
|
54
60
|
end
|
55
|
-
|
56
|
-
|
57
|
-
Chef
|
58
|
-
exit
|
61
|
+
else
|
62
|
+
raise ArgumentError, "Please specify the SERVER name which needs to be bootstrapped via the Chef Extension." if @name_args.empty?
|
63
|
+
raise ArgumentError, "Please specify only one SERVER name which needs to be bootstrapped via the Chef Extension." if @name_args.length > 1
|
59
64
|
end
|
65
|
+
rescue StandardError => error
|
66
|
+
ui.error(error.message.to_s)
|
67
|
+
Chef::Log.debug(error.backtrace.join("\n").to_s)
|
68
|
+
exit
|
60
69
|
end
|
61
70
|
|
71
|
+
def plugin_finalize; end
|
72
|
+
|
73
|
+
# Following methods are not required
|
74
|
+
#
|
75
|
+
def connect!; end
|
76
|
+
|
77
|
+
def register_client; end
|
78
|
+
|
79
|
+
def render_template; end
|
80
|
+
|
81
|
+
def upload_bootstrap(content); end
|
82
|
+
|
83
|
+
def perform_bootstrap(bootstrap_path); end
|
84
|
+
|
85
|
+
#### run() execution ends ####
|
86
|
+
|
62
87
|
def set_ext_params
|
63
88
|
begin
|
64
89
|
ui.info "Looking for the server #{@name_args[0]}..."
|
65
|
-
server = service.find_server(
|
66
|
-
|
67
|
-
|
68
|
-
|
90
|
+
server = service.find_server(
|
91
|
+
name: @name_args[0],
|
92
|
+
azure_dns_name: locate_config_value(:azure_dns_name)
|
93
|
+
)
|
69
94
|
|
70
95
|
## if azure_dns_name value not passed by user then set it using the hostedservicename attribute from the retrieved server's object ##
|
71
96
|
config[:azure_dns_name] = server.hostedservicename if locate_config_value(:azure_dns_name).nil? && (server.instance_of? Azure::Role)
|
72
|
-
|
97
|
+
unless server.instance_of? Azure::Role
|
73
98
|
if server.nil?
|
74
99
|
if !locate_config_value(:azure_dns_name).nil?
|
75
100
|
raise "Hosted service #{locate_config_value(:azure_dns_name)} does not exist."
|
@@ -83,7 +108,7 @@ class Chef
|
|
83
108
|
|
84
109
|
ui.info "\nServer #{@name_args[0]} found."
|
85
110
|
ui.info "Setting the Chef Extension parameters."
|
86
|
-
ext_params =
|
111
|
+
ext_params = {}
|
87
112
|
case server.os_type.downcase
|
88
113
|
when "windows"
|
89
114
|
ext_params[:chef_extension] = "ChefClient"
|
@@ -137,9 +162,7 @@ class Chef
|
|
137
162
|
extension = fetch_extension(my_role)
|
138
163
|
## check if Chef Extension not found (which means it is not available/ready yet) then sleep_and_wait OR
|
139
164
|
## if found (which means it is available/ready now) then proceed further with chef-client run logs fetch process ##
|
140
|
-
if extension.nil?
|
141
|
-
sleep_and_wait = true
|
142
|
-
end
|
165
|
+
sleep_and_wait = true if extension.nil?
|
143
166
|
else
|
144
167
|
## given role not found or GuestAgent not ready yet ##
|
145
168
|
sleep_and_wait = true
|
@@ -151,7 +174,7 @@ class Chef
|
|
151
174
|
|
152
175
|
## wait for some time and then re-fetch the status ##
|
153
176
|
if sleep_and_wait == true
|
154
|
-
print "#{ui.color(
|
177
|
+
print "#{ui.color(".", :bold)}"
|
155
178
|
sleep 30
|
156
179
|
wait_until_extension_available(
|
157
180
|
extension_deploy_start_time,
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Nimisha Sharad (nimisha.sharad@clogeny.com)
|
3
|
-
#
|
4
|
-
# Copyright:: Copyright 2016-2018 Chef Software, Inc.
|
3
|
+
# Copyright:: Copyright 2010-2019, Chef Software Inc.
|
5
4
|
# License:: Apache License, Version 2.0
|
6
5
|
#
|
7
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -18,6 +17,7 @@
|
|
18
17
|
#
|
19
18
|
|
20
19
|
require "chef/knife/azurerm_base"
|
20
|
+
require "chef/knife/bootstrap"
|
21
21
|
require "chef/knife/bootstrap/common_bootstrap_options"
|
22
22
|
require "chef/knife/bootstrap/bootstrapper"
|
23
23
|
require "azure/resource_management/ARM_interface"
|
@@ -25,46 +25,64 @@ require "time"
|
|
25
25
|
|
26
26
|
class Chef
|
27
27
|
class Knife
|
28
|
-
class BootstrapAzurerm < Knife
|
28
|
+
class BootstrapAzurerm < Knife::Bootstrap
|
29
29
|
include Knife::AzurermBase
|
30
30
|
include Knife::Bootstrap::CommonBootstrapOptions
|
31
31
|
include Knife::Bootstrap::Bootstrapper
|
32
32
|
|
33
33
|
banner "knife bootstrap azurerm SERVER (options)"
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
# run() would be executing from parent class
|
36
|
+
# Chef::Knife::Bootstrap, defined in core.
|
37
|
+
# Required methods have been overridden here
|
38
|
+
#### run() execution begins ####
|
39
|
+
|
40
|
+
def plugin_setup!; end
|
41
41
|
|
42
|
-
def
|
42
|
+
def validate_name_args!; end
|
43
|
+
|
44
|
+
def plugin_validate_options!
|
43
45
|
ui.log("Validating...")
|
44
46
|
validate_arm_keys!(:azure_resource_group_name, :azure_service_location)
|
47
|
+
end
|
45
48
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
55
|
-
ui.log("VirtualMachineExtension creation successfull.")
|
56
|
-
ui.log("Virtual Machine Extension name is: #{vm_extension.name}")
|
57
|
-
ui.log("Virtual Machine Extension ID is: #{vm_extension.id}")
|
49
|
+
def plugin_create_instance!
|
50
|
+
if @name_args.length == 1
|
51
|
+
ui.log("Creating VirtualMachineExtension....")
|
52
|
+
ext_params = set_ext_params
|
53
|
+
vm_extension = service.create_vm_extension(ext_params)
|
54
|
+
if vm_extension
|
55
|
+
if ext_params[:chef_extension_public_param][:extendedLogs] == "true"
|
56
|
+
service.fetch_chef_client_logs(ext_params[:azure_resource_group_name], ext_params[:azure_vm_name], ext_params[:chef_extension], Time.now)
|
58
57
|
end
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
ui.log("VirtualMachineExtension creation successfull.")
|
59
|
+
ui.log("Virtual Machine Extension name is: #{vm_extension.name}")
|
60
|
+
ui.log("Virtual Machine Extension ID is: #{vm_extension.id}")
|
62
61
|
end
|
63
|
-
|
64
|
-
|
62
|
+
else
|
63
|
+
raise ArgumentError, "Please specify the SERVER name which needs to be bootstrapped via the Chef Extension." if @name_args.empty?
|
64
|
+
raise ArgumentError, "Please specify only one SERVER name which needs to be bootstrapped via the Chef Extension." if @name_args.length > 1
|
65
65
|
end
|
66
|
+
rescue StandardError => error
|
67
|
+
service.common_arm_rescue_block(error)
|
66
68
|
end
|
67
69
|
|
70
|
+
def plugin_finalize; end
|
71
|
+
|
72
|
+
# Following methods are not required
|
73
|
+
#
|
74
|
+
def connect!; end
|
75
|
+
|
76
|
+
def register_client; end
|
77
|
+
|
78
|
+
def render_template; end
|
79
|
+
|
80
|
+
def upload_bootstrap(content); end
|
81
|
+
|
82
|
+
def perform_bootstrap(bootstrap_path); end
|
83
|
+
|
84
|
+
#### run() execution ends ####
|
85
|
+
|
68
86
|
def set_ext_params
|
69
87
|
server = service.find_server(locate_config_value(:azure_resource_group_name), name_args[0])
|
70
88
|
|
@@ -72,7 +90,7 @@ class Chef
|
|
72
90
|
if service.extension_already_installed?(server)
|
73
91
|
raise "Virtual machine #{server.name} already has Chef extension installed on it."
|
74
92
|
else
|
75
|
-
ext_params =
|
93
|
+
ext_params = {}
|
76
94
|
case server.storage_profile.os_disk.os_type.downcase
|
77
95
|
when "windows"
|
78
96
|
ext_params[:chef_extension] = "ChefClient"
|
@@ -100,7 +118,6 @@ class Chef
|
|
100
118
|
|
101
119
|
ext_params
|
102
120
|
end
|
103
|
-
|
104
121
|
end
|
105
122
|
end
|
106
123
|
end
|
data/lib/knife-azure/version.rb
CHANGED
@@ -1,6 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright 2010-2019, Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
1
18
|
module Knife
|
2
19
|
module Azure
|
3
|
-
VERSION = "
|
20
|
+
VERSION = "2.0.1".freeze
|
4
21
|
MAJOR, MINOR, TINY = VERSION.split(".")
|
5
22
|
end
|
6
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barry Davis
|
@@ -9,36 +9,50 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: chef
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1
|
20
|
+
version: '15.1'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 1
|
27
|
+
version: '15.1'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: chef-bin
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '1
|
34
|
+
version: '15.1'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '1
|
41
|
+
version: '15.1'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: nokogiri
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.5.5
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.5.5
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: azure_mgmt_resources
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,14 +139,14 @@ dependencies:
|
|
125
139
|
requirements:
|
126
140
|
- - "~>"
|
127
141
|
- !ruby/object:Gem::Version
|
128
|
-
version: '3.
|
142
|
+
version: '3.1'
|
129
143
|
type: :runtime
|
130
144
|
prerelease: false
|
131
145
|
version_requirements: !ruby/object:Gem::Requirement
|
132
146
|
requirements:
|
133
147
|
- - "~>"
|
134
148
|
- !ruby/object:Gem::Version
|
135
|
-
version: '3.
|
149
|
+
version: '3.1'
|
136
150
|
- !ruby/object:Gem::Dependency
|
137
151
|
name: ipaddress
|
138
152
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,7 +222,6 @@ files:
|
|
208
222
|
- lib/chef/knife/azurerm_server_delete.rb
|
209
223
|
- lib/chef/knife/azurerm_server_list.rb
|
210
224
|
- lib/chef/knife/azurerm_server_show.rb
|
211
|
-
- lib/chef/knife/bootstrap/bootstrap_options.rb
|
212
225
|
- lib/chef/knife/bootstrap/bootstrapper.rb
|
213
226
|
- lib/chef/knife/bootstrap/common_bootstrap_options.rb
|
214
227
|
- lib/chef/knife/bootstrap_azure.rb
|
@@ -226,15 +239,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
239
|
requirements:
|
227
240
|
- - ">="
|
228
241
|
- !ruby/object:Gem::Version
|
229
|
-
version: '2.
|
242
|
+
version: '2.5'
|
230
243
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
244
|
requirements:
|
232
245
|
- - ">="
|
233
246
|
- !ruby/object:Gem::Version
|
234
247
|
version: '0'
|
235
248
|
requirements: []
|
236
|
-
|
237
|
-
rubygems_version: 2.7.6
|
249
|
+
rubygems_version: 3.0.3
|
238
250
|
signing_key:
|
239
251
|
specification_version: 4
|
240
252
|
summary: A plugin to the Chef knife tool for creating instances on the Microsoft Azure
|
@@ -1,105 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Aliasgar Batterywala (aliasgar.batterywala@clogeny.com)
|
3
|
-
#
|
4
|
-
# Copyright:: Copyright 2016-2018 Chef Software, Inc.
|
5
|
-
# License:: Apache License, Version 2.0
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# Bootstrap options listed here are in accordance with the options supported by
|
21
|
-
# Chef's bootstrap which bootstraps the target system through protocols like ssh
|
22
|
-
# or winrm. In addition it contains additional options which gives the users a
|
23
|
-
# choice to bootstrap the target system through cloud-api protocol.
|
24
|
-
#
|
25
|
-
|
26
|
-
require "chef/knife/winrm_base"
|
27
|
-
require "chef/knife/bootstrap_windows_base"
|
28
|
-
class Chef
|
29
|
-
class Knife
|
30
|
-
class Bootstrap
|
31
|
-
module BootstrapOptions
|
32
|
-
|
33
|
-
def self.included(includer)
|
34
|
-
includer.class_eval do
|
35
|
-
|
36
|
-
include Knife::WinrmBase
|
37
|
-
include Knife::BootstrapWindowsBase
|
38
|
-
deps do
|
39
|
-
require "chef/knife/bootstrap"
|
40
|
-
Chef::Knife::Bootstrap.load_deps
|
41
|
-
end
|
42
|
-
|
43
|
-
option :forward_agent,
|
44
|
-
:short => "-A",
|
45
|
-
:long => "--forward-agent",
|
46
|
-
:description => "Enable SSH agent forwarding",
|
47
|
-
:boolean => true
|
48
|
-
|
49
|
-
option :json_attributes,
|
50
|
-
:short => "-j JSON",
|
51
|
-
:long => "--json-attributes JSON",
|
52
|
-
:description => "A JSON string to be added to the first run of chef-client",
|
53
|
-
:proc => lambda { |o| JSON.parse(o) }
|
54
|
-
|
55
|
-
option :host_key_verify,
|
56
|
-
:long => "--[no-]host-key-verify",
|
57
|
-
:description => "Verify host key, enabled by default.",
|
58
|
-
:boolean => true,
|
59
|
-
:default => true
|
60
|
-
|
61
|
-
option :bootstrap_url,
|
62
|
-
:long => "--bootstrap-url URL",
|
63
|
-
:description => "URL to a custom installation script",
|
64
|
-
:proc => Proc.new { |u| Chef::Config[:knife][:bootstrap_url] = u }
|
65
|
-
|
66
|
-
option :bootstrap_wget_options,
|
67
|
-
:long => "--bootstrap-wget-options OPTIONS",
|
68
|
-
:description => "Add options to wget when installing chef-client",
|
69
|
-
:proc => Proc.new { |wo| Chef::Config[:knife][:bootstrap_wget_options] = wo }
|
70
|
-
|
71
|
-
option :bootstrap_curl_options,
|
72
|
-
:long => "--bootstrap-curl-options OPTIONS",
|
73
|
-
:description => "Add options to curl when install chef-client",
|
74
|
-
:proc => Proc.new { |co| Chef::Config[:knife][:bootstrap_curl_options] = co }
|
75
|
-
|
76
|
-
option :use_sudo_password,
|
77
|
-
:long => "--use-sudo-password",
|
78
|
-
:description => "Execute the bootstrap via sudo with password",
|
79
|
-
:boolean => false
|
80
|
-
|
81
|
-
option :extended_logs,
|
82
|
-
:long => "--extended-logs",
|
83
|
-
:boolean => true,
|
84
|
-
:default => false,
|
85
|
-
:description => "Optional. Provide this option when --bootstrap-protocol is set to 'cloud-api'. It shows chef converge logs in detail."
|
86
|
-
|
87
|
-
option :chef_daemon_interval,
|
88
|
-
:long => "--chef-daemon-interval INTERVAL",
|
89
|
-
:description => "Optional. Provide this option when --bootstrap-protocol is set to 'cloud-api'.
|
90
|
-
It specifies the frequency (in minutes) at which the chef-service runs.
|
91
|
-
Pass 0 if you don't want the chef-service to be installed on the target machine."
|
92
|
-
|
93
|
-
option :daemon,
|
94
|
-
:long => "--daemon DAEMON",
|
95
|
-
:description => "Optional. Configures the chef-client service for unattended execution. Requires --bootstrap-protocol to be 'cloud-api' and the node platform to be Windows.
|
96
|
-
Options: 'none' or 'service' or 'task'.
|
97
|
-
none - Currently prevents the chef-client service from being configured as a service.
|
98
|
-
service - Configures the chef-client to run automatically in the background as a service.
|
99
|
-
task - Configures the chef-client to run automatically in the background as a scheduled task."
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|