28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# File 'lib/chef/knife/bootstrap/common_bootstrap_options.rb', line 28
def self.included(includer)
includer.class_eval do
deps do
require 'chef/knife/bootstrap'
Chef::Knife::Bootstrap.load_deps
end
option :chef_node_name,
:short => "-N NAME",
:long => "--node-name NAME",
:description => "The Chef node name for your new node"
option :bootstrap_version,
:long => "--bootstrap-version VERSION",
:description => "The version of Chef to install",
:proc => Proc.new { |v| Chef::Config[:knife][:bootstrap_version] = v }
option :run_list,
:short => "-r RUN_LIST",
:long => "--run-list RUN_LIST",
:description => "Comma separated list of roles/recipes to apply",
:proc => lambda { |o| o.split(/[\s,]+/) },
:default => []
option :json_attributes,
:short => "-j JSON",
:long => "--json-attributes JSON",
:description => "A JSON string to be added to the first run of chef-client",
:proc => lambda { |o| JSON.parse(o) }
option :bootstrap_proxy,
:long => "--bootstrap-proxy PROXY_URL",
:description => "The proxy server for the node being bootstrapped",
:proc => Proc.new { |p| Chef::Config[:knife][:bootstrap_proxy] = p }
option :cert_path,
:long => "--cert-path PATH",
:description => "SSL Certificate Path"
option :node_ssl_verify_mode,
:long => "--node-ssl-verify-mode [peer|none]",
:description => "Whether or not to verify the SSL cert for all HTTPS requests.",
:proc => Proc.new { |v|
valid_values = ["none", "peer"]
unless valid_values.include?(v)
raise "Invalid value '#{v}' for --node-ssl-verify-mode. Valid values are: #{valid_values.join(", ")}"
end
}
option :node_verify_api_cert,
:long => "--[no-]node-verify-api-cert",
:description => "Verify the SSL cert for HTTPS requests to the Chef server API.",
:boolean => true
option :azure_extension_client_config,
:long => "--azure-extension-client-config CLIENT_PATH",
:description => "Optional. Path to a client.rb file for use by the bootstrapped node."
option :encrypted_data_bag_secret,
:short => "-s SECRET",
:long => "--secret ",
:description => "The secret key to use to encrypt data bag item values. Can also be defaulted in your config with the key 'secret'"
option :encrypted_data_bag_secret_file,
:long => "--secret-file SECRET_FILE",
:description => "A file containing the secret key to use to encrypt data bag item values. Can also be defaulted in your config with the key 'secret_file'"
option :extended_logs,
:long => "--extended-logs",
:boolean => true,
:default => false,
:description => "Optional. It shows chef convergence logs in detail."
option :chef_daemon_interval,
:long => "--chef-daemon-interval INTERVAL",
:description => "Optional. It specifies the frequency (in minutes) at which the chef-service runs.
Pass 0 if you don't want the chef-service to be installed on the target machine."
option :daemon,
:long => "--daemon DAEMON",
:description => "Optional. Configures the chef-client service for unattended execution. Requires --bootstrap-protocol to be 'cloud-api' and the node platform to be Windows.
Options: 'none' or 'service' or 'task'.
none - Currently prevents the chef-client service from being configured as a service.
service - Configures the chef-client to run automatically in the background as a service.
task - Configures the chef-client to run automatically in the background as a scheduled task."
end
end
|