chef 10.14.0.beta.3 → 10.14.0.rc.0
Sign up to get free protection for your applications and to get access to all the features.
- data/distro/common/html/chef-client.8.html +4 -6
- data/distro/common/html/chef-expander.8.html +4 -4
- data/distro/common/html/chef-expanderctl.8.html +4 -4
- data/distro/common/html/chef-server-webui.8.html +4 -4
- data/distro/common/html/chef-server.8.html +4 -4
- data/distro/common/html/chef-solo.8.html +4 -4
- data/distro/common/html/chef-solr.8.html +4 -4
- data/distro/common/html/knife-bootstrap.1.html +4 -4
- data/distro/common/html/knife-client.1.html +4 -4
- data/distro/common/html/knife-configure.1.html +5 -5
- data/distro/common/html/knife-cookbook-site.1.html +7 -7
- data/distro/common/html/knife-cookbook.1.html +4 -4
- data/distro/common/html/knife-data-bag.1.html +4 -4
- data/distro/common/html/knife-environment.1.html +4 -4
- data/distro/common/html/knife-exec.1.html +4 -4
- data/distro/common/html/knife-index.1.html +4 -4
- data/distro/common/html/knife-node.1.html +5 -5
- data/distro/common/html/knife-role.1.html +4 -4
- data/distro/common/html/knife-search.1.html +4 -4
- data/distro/common/html/knife-ssh.1.html +5 -5
- data/distro/common/html/knife-status.1.html +4 -4
- data/distro/common/html/knife-tag.1.html +4 -4
- data/distro/common/html/knife.1.html +5 -5
- data/distro/common/html/shef.1.html +4 -4
- data/distro/common/man/man1/knife-bootstrap.1 +1 -1
- data/distro/common/man/man1/knife-client.1 +1 -1
- data/distro/common/man/man1/knife-configure.1 +1 -1
- data/distro/common/man/man1/knife-cookbook-site.1 +1 -1
- data/distro/common/man/man1/knife-cookbook.1 +1 -1
- data/distro/common/man/man1/knife-data-bag.1 +1 -1
- data/distro/common/man/man1/knife-environment.1 +1 -1
- data/distro/common/man/man1/knife-exec.1 +1 -1
- data/distro/common/man/man1/knife-index.1 +1 -1
- data/distro/common/man/man1/knife-node.1 +1 -1
- data/distro/common/man/man1/knife-role.1 +1 -1
- data/distro/common/man/man1/knife-search.1 +1 -1
- data/distro/common/man/man1/knife-ssh.1 +1 -1
- data/distro/common/man/man1/knife-status.1 +1 -1
- data/distro/common/man/man1/knife-tag.1 +1 -1
- data/distro/common/man/man1/knife.1 +5 -5
- data/distro/common/man/man1/shef.1 +1 -1
- data/distro/common/man/man8/chef-client.8 +1 -5
- data/distro/common/man/man8/chef-expander.8 +1 -1
- data/distro/common/man/man8/chef-expanderctl.8 +1 -1
- data/distro/common/man/man8/chef-server-webui.8 +1 -1
- data/distro/common/man/man8/chef-server.8 +1 -1
- data/distro/common/man/man8/chef-solo.8 +1 -1
- data/distro/common/man/man8/chef-solr.8 +1 -1
- data/distro/common/markdown/man1/knife.mkd +2 -2
- data/distro/common/markdown/man8/chef-client.mkd +0 -3
- data/lib/chef/client.rb +13 -3
- data/lib/chef/config.rb +29 -0
- data/lib/chef/environment.rb +5 -2
- data/lib/chef/file_access_control/unix.rb +3 -3
- data/lib/chef/knife.rb +11 -5
- data/lib/chef/knife/bootstrap.rb +9 -5
- data/lib/chef/knife/bootstrap/archlinux-gems.erb +1 -1
- data/lib/chef/knife/bootstrap/centos5-gems.erb +1 -1
- data/lib/chef/knife/bootstrap/chef-full.erb +1 -1
- data/lib/chef/knife/bootstrap/fedora13-gems.erb +1 -1
- data/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb +1 -1
- data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +1 -1
- data/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb +1 -1
- data/lib/chef/knife/cookbook_create.rb +24 -1
- data/lib/chef/knife/ssh.rb +14 -2
- data/lib/chef/platform.rb +22 -2
- data/lib/chef/provider/file.rb +9 -3
- data/lib/chef/provider/group/usermod.rb +7 -4
- data/lib/chef/provider/mdadm.rb +3 -3
- data/lib/chef/provider/package/ips.rb +101 -0
- data/lib/chef/provider/package/solaris.rb +21 -12
- data/lib/chef/provider/service/solaris.rb +0 -3
- data/lib/chef/provider/user/dscl.rb +1 -1
- data/lib/chef/providers.rb +1 -0
- data/lib/chef/resource/ips_package.rb +42 -0
- data/lib/chef/resource/package.rb +6 -7
- data/lib/chef/resources.rb +1 -0
- data/lib/chef/rest/auth_credentials.rb +4 -3
- data/lib/chef/scan_access_control.rb +3 -9
- data/lib/chef/shef/ext.rb +22 -0
- data/lib/chef/version.rb +1 -1
- data/spec/functional/knife/cookbook_delete_spec.rb +5 -2
- data/spec/functional/knife/exec_spec.rb +5 -2
- data/spec/functional/knife/ssh_spec.rb +4 -2
- data/spec/functional/resource/link_spec.rb +4 -4
- data/spec/functional/resource/remote_file_spec.rb +17 -1
- data/spec/support/platform_helpers.rb +8 -0
- data/spec/support/shared/functional/securable_resource.rb +2 -2
- data/spec/tiny_server.rb +5 -1
- data/spec/unit/client_spec.rb +24 -0
- data/spec/unit/environment_spec.rb +26 -0
- data/spec/unit/knife/bootstrap_spec.rb +34 -11
- data/spec/unit/knife/config_file_selection_spec.rb +2 -2
- data/spec/unit/knife/configure_spec.rb +6 -0
- data/spec/unit/knife/cookbook_create_spec.rb +20 -0
- data/spec/unit/knife/ssh_spec.rb +145 -0
- data/spec/unit/mixin/command_spec.rb +8 -4
- data/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +2 -1
- data/spec/unit/mixin/securable_spec.rb +2 -2
- data/spec/unit/provider/file_spec.rb +6 -4
- data/spec/unit/provider/group/usermod_spec.rb +6 -1
- data/spec/unit/provider/link_spec.rb +4 -1
- data/spec/unit/provider/mdadm_spec.rb +10 -13
- data/spec/unit/provider/package/ips_spec.rb +210 -0
- data/spec/unit/provider/package/solaris_spec.rb +6 -4
- data/spec/unit/provider/subversion_spec.rb +2 -2
- data/spec/unit/provider/user/dscl_spec.rb +15 -0
- data/spec/unit/resource/ips_package_spec.rb +43 -0
- data/spec/unit/rest/auth_credentials_spec.rb +36 -14
- data/spec/unit/scan_access_control_spec.rb +20 -0
- metadata +13 -8
@@ -24,9 +24,6 @@ __chef-client__ _(options)_
|
|
24
24
|
* `-L`, `--logfile LOGLOCATION`:
|
25
25
|
Set the log file location, defaults to STDOUT - recommended for
|
26
26
|
daemonizing
|
27
|
-
* `-V`, `--verbose`:
|
28
|
-
Ensures logging goes to STDOUT as well as to other configured
|
29
|
-
log location(s).
|
30
27
|
* `-N`, `--node-name NODE_NAME`:
|
31
28
|
The node name for this client
|
32
29
|
* `-o`, `--override-runlist`:
|
data/lib/chef/client.rb
CHANGED
@@ -224,6 +224,12 @@ class Chef
|
|
224
224
|
raise Chef::Exceptions::CannotDetermineNodeName, msg
|
225
225
|
end
|
226
226
|
|
227
|
+
# node names > 90 bytes only work with authentication protocol >= 1.1
|
228
|
+
# see discussion in config.rb.
|
229
|
+
if name.bytesize > 90
|
230
|
+
Chef::Config[:authentication_protocol_version] = "1.1"
|
231
|
+
end
|
232
|
+
|
227
233
|
name
|
228
234
|
end
|
229
235
|
|
@@ -421,10 +427,14 @@ class Chef
|
|
421
427
|
@events.run_completed(node)
|
422
428
|
true
|
423
429
|
rescue Exception => e
|
424
|
-
|
425
|
-
run_status.exception = e
|
426
|
-
run_failed
|
430
|
+
# CHEF-3336: Send the error first in case something goes wrong below and we don't know why
|
427
431
|
Chef::Log.debug("Re-raising exception: #{e.class} - #{e.message}\n#{e.backtrace.join("\n ")}")
|
432
|
+
# If we failed really early, we may not have a run_status yet. Too early for these to be of much use.
|
433
|
+
if run_status
|
434
|
+
run_status.stop_clock
|
435
|
+
run_status.exception = e
|
436
|
+
run_failed
|
437
|
+
end
|
428
438
|
@events.run_failed(e)
|
429
439
|
raise
|
430
440
|
ensure
|
data/lib/chef/config.rb
CHANGED
@@ -232,7 +232,36 @@ class Chef
|
|
232
232
|
# (persist across rabbitmq restarts)
|
233
233
|
amqp_consumer_id "default"
|
234
234
|
|
235
|
+
# Sets the version of the signed header authentication protocol to use (see
|
236
|
+
# the 'mixlib-authorization' project for more detail). Currently, versions
|
237
|
+
# 1.0 and 1.1 are available; however, the chef-server must first be
|
238
|
+
# upgraded to support version 1.1 before clients can begin using it.
|
239
|
+
#
|
240
|
+
# Version 1.1 of the protocol is required when using a `node_name` greater
|
241
|
+
# than ~90 bytes (~90 ascii characters), so chef-client will automatically
|
242
|
+
# switch to using version 1.1 when `node_name` is too large for the 1.0
|
243
|
+
# protocol. If you intend to use large node names, ensure that your server
|
244
|
+
# supports version 1.1. Automatic detection of large node names means that
|
245
|
+
# users will generally not need to manually configure this.
|
246
|
+
#
|
247
|
+
# In the future, this configuration option may be replaced with an
|
248
|
+
# automatic negotiation scheme.
|
249
|
+
authentication_protocol_version "1.0"
|
250
|
+
|
251
|
+
# This key will be used to sign requests to the Chef server. This location
|
252
|
+
# must be writable by Chef during initial setup when generating a client
|
253
|
+
# identity on the server.
|
254
|
+
#
|
255
|
+
# The chef-server will look up the public key for the client using the
|
256
|
+
# `node_name` of the client.
|
235
257
|
client_key platform_specific_path("/etc/chef/client.pem")
|
258
|
+
|
259
|
+
# If there is no file in the location given by `client_key`, chef-client
|
260
|
+
# will temporarily use the "validator" identity to generate one. If the
|
261
|
+
# `client_key` is not present and the `validation_key` is also not present,
|
262
|
+
# chef-client will not be able to authenticate to the server.
|
263
|
+
#
|
264
|
+
# The `validation_key` is never used if the `client_key` exists.
|
236
265
|
validation_key platform_specific_path("/etc/chef/validation.pem")
|
237
266
|
validation_client_name "chef-validator"
|
238
267
|
web_ui_client_name "chef-webui"
|
data/lib/chef/environment.rb
CHANGED
@@ -265,8 +265,11 @@ class Chef
|
|
265
265
|
|
266
266
|
def self.list(inflate=false)
|
267
267
|
if inflate
|
268
|
-
|
269
|
-
|
268
|
+
response = Hash.new
|
269
|
+
Chef::Search::Query.new.search(:environment) do |e|
|
270
|
+
response[e.name] = e unless e.nil?
|
271
|
+
end
|
272
|
+
response
|
270
273
|
else
|
271
274
|
chef_server_rest.get_rest("environments")
|
272
275
|
end
|
@@ -60,7 +60,7 @@ class Chef
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def should_update_owner?
|
63
|
-
target_uid != current_uid
|
63
|
+
!target_uid.nil? && target_uid != current_uid
|
64
64
|
end
|
65
65
|
|
66
66
|
def set_owner!
|
@@ -103,7 +103,7 @@ class Chef
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def should_update_group?
|
106
|
-
target_gid != current_gid
|
106
|
+
!target_gid.nil? && target_gid != current_gid
|
107
107
|
end
|
108
108
|
|
109
109
|
def set_group!
|
@@ -136,7 +136,7 @@ class Chef
|
|
136
136
|
end
|
137
137
|
|
138
138
|
def should_update_mode?
|
139
|
-
current_mode != target_mode
|
139
|
+
!target_mode.nil? && current_mode != target_mode
|
140
140
|
end
|
141
141
|
|
142
142
|
def set_mode!
|
data/lib/chef/knife.rb
CHANGED
@@ -269,6 +269,10 @@ class Chef
|
|
269
269
|
msg opt_parser
|
270
270
|
exit 1
|
271
271
|
end
|
272
|
+
|
273
|
+
# copy Mixlib::CLI over so that it cab be configured in knife.rb
|
274
|
+
# config file
|
275
|
+
Chef::Config[:verbosity] = config[:verbosity]
|
272
276
|
end
|
273
277
|
|
274
278
|
def parse_options(args)
|
@@ -320,7 +324,7 @@ class Chef
|
|
320
324
|
|
321
325
|
Chef::Config[:color] = config[:color]
|
322
326
|
|
323
|
-
case
|
327
|
+
case Chef::Config[:verbosity]
|
324
328
|
when 0
|
325
329
|
Chef::Config[:log_level] = :error
|
326
330
|
when 1
|
@@ -345,9 +349,11 @@ class Chef
|
|
345
349
|
Chef::Log.level(Chef::Config[:log_level] || :error)
|
346
350
|
|
347
351
|
Chef::Log.debug("Using configuration from #{config[:config_file]}")
|
348
|
-
|
349
|
-
if Chef::Config[:node_name].
|
350
|
-
#
|
352
|
+
|
353
|
+
if Chef::Config[:node_name] && Chef::Config[:node_name].bytesize > 90
|
354
|
+
# node names > 90 bytes only work with authentication protocol >= 1.1
|
355
|
+
# see discussion in config.rb.
|
356
|
+
Chef::Config[:authentication_protocol_version] = "1.1"
|
351
357
|
end
|
352
358
|
end
|
353
359
|
|
@@ -401,7 +407,7 @@ class Chef
|
|
401
407
|
enforce_path_sanity
|
402
408
|
run
|
403
409
|
rescue Exception => e
|
404
|
-
raise if
|
410
|
+
raise if Chef::Config[:verbosity] == 2
|
405
411
|
humanize_exception(e)
|
406
412
|
exit 100
|
407
413
|
end
|
data/lib/chef/knife/bootstrap.rb
CHANGED
@@ -128,7 +128,7 @@ class Chef
|
|
128
128
|
name, path = h.split("=")
|
129
129
|
Chef::Config[:knife][:hints][name] = path ? JSON.parse(::File.read(path)) : Hash.new }
|
130
130
|
|
131
|
-
def
|
131
|
+
def find_template(template=nil)
|
132
132
|
# Are we bootstrapping using an already shipped template?
|
133
133
|
if config[:template_file]
|
134
134
|
bootstrap_files = config[:template_file]
|
@@ -153,7 +153,7 @@ class Chef
|
|
153
153
|
|
154
154
|
Chef::Log.debug("Found bootstrap template in #{File.dirname(template)}")
|
155
155
|
|
156
|
-
|
156
|
+
template
|
157
157
|
end
|
158
158
|
|
159
159
|
def render_template(template=nil)
|
@@ -161,13 +161,17 @@ class Chef
|
|
161
161
|
Erubis::Eruby.new(template).evaluate(context)
|
162
162
|
end
|
163
163
|
|
164
|
-
def
|
164
|
+
def read_template
|
165
|
+
IO.read(@template_file).chomp
|
166
|
+
end
|
165
167
|
|
168
|
+
def run
|
166
169
|
validate_name_args!
|
170
|
+
@template_file = find_template(config[:bootstrap_template])
|
167
171
|
@node_name = Array(@name_args).first
|
168
172
|
# back compat--templates may use this setting:
|
169
173
|
config[:server_name] = @node_name
|
170
|
-
|
174
|
+
|
171
175
|
$stdout.sync = true
|
172
176
|
|
173
177
|
ui.info("Bootstrapping Chef on #{ui.color(@node_name, :bold)}")
|
@@ -216,7 +220,7 @@ class Chef
|
|
216
220
|
end
|
217
221
|
|
218
222
|
def ssh_command
|
219
|
-
command = render_template(
|
223
|
+
command = render_template(read_template)
|
220
224
|
|
221
225
|
if config[:use_sudo]
|
222
226
|
command = "sudo #{command}"
|
@@ -31,7 +31,6 @@ rm /tmp/encrypted_data_bag_secret
|
|
31
31
|
<%# Generate Ohai Hints -%>
|
32
32
|
<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
|
33
33
|
mkdir -p /etc/chef/ohai/hints
|
34
|
-
<% end -%>
|
35
34
|
|
36
35
|
<% @chef_config[:knife][:hints].each do |name, hash| -%>
|
37
36
|
(
|
@@ -40,6 +39,7 @@ cat <<'EOP'
|
|
40
39
|
EOP
|
41
40
|
) > /etc/chef/ohai/hints/<%= name %>.json
|
42
41
|
<% end -%>
|
42
|
+
<% end -%>
|
43
43
|
|
44
44
|
(
|
45
45
|
cat <<'EOP'
|
@@ -44,7 +44,6 @@ rm /tmp/encrypted_data_bag_secret
|
|
44
44
|
<%# Generate Ohai Hints -%>
|
45
45
|
<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
|
46
46
|
mkdir -p /etc/chef/ohai/hints
|
47
|
-
<% end -%>
|
48
47
|
|
49
48
|
<% @chef_config[:knife][:hints].each do |name, hash| -%>
|
50
49
|
(
|
@@ -53,6 +52,7 @@ cat <<'EOP'
|
|
53
52
|
EOP
|
54
53
|
) > /etc/chef/ohai/hints/<%= name %>.json
|
55
54
|
<% end -%>
|
55
|
+
<% end -%>
|
56
56
|
|
57
57
|
(
|
58
58
|
cat <<'EOP'
|
@@ -47,7 +47,6 @@ rm /tmp/encrypted_data_bag_secret
|
|
47
47
|
<%# Generate Ohai Hints -%>
|
48
48
|
<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
|
49
49
|
mkdir -p /etc/chef/ohai/hints
|
50
|
-
<% end -%>
|
51
50
|
|
52
51
|
<% @chef_config[:knife][:hints].each do |name, hash| -%>
|
53
52
|
(
|
@@ -56,6 +55,7 @@ cat <<'EOP'
|
|
56
55
|
EOP
|
57
56
|
) > /etc/chef/ohai/hints/<%= name %>.json
|
58
57
|
<% end -%>
|
58
|
+
<% end -%>
|
59
59
|
|
60
60
|
(
|
61
61
|
cat <<'EOP'
|
@@ -31,7 +31,6 @@ rm /tmp/encrypted_data_bag_secret
|
|
31
31
|
<%# Generate Ohai Hints -%>
|
32
32
|
<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
|
33
33
|
mkdir -p /etc/chef/ohai/hints
|
34
|
-
<% end -%>
|
35
34
|
|
36
35
|
<% @chef_config[:knife][:hints].each do |name, hash| -%>
|
37
36
|
(
|
@@ -40,6 +39,7 @@ cat <<'EOP'
|
|
40
39
|
EOP
|
41
40
|
) > /etc/chef/ohai/hints/<%= name %>.json
|
42
41
|
<% end -%>
|
42
|
+
<% end -%>
|
43
43
|
|
44
44
|
(
|
45
45
|
cat <<'EOP'
|
@@ -31,7 +31,6 @@ rm /tmp/encrypted_data_bag_secret
|
|
31
31
|
<%# Generate Ohai Hints -%>
|
32
32
|
<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
|
33
33
|
mkdir -p /etc/chef/ohai/hints
|
34
|
-
<% end -%>
|
35
34
|
|
36
35
|
<% @chef_config[:knife][:hints].each do |name, hash| -%>
|
37
36
|
(
|
@@ -40,6 +39,7 @@ cat <<'EOP'
|
|
40
39
|
EOP
|
41
40
|
) > /etc/chef/ohai/hints/<%= name %>.json
|
42
41
|
<% end -%>
|
42
|
+
<% end -%>
|
43
43
|
|
44
44
|
<% unless @chef_config[:validation_client_name] == "chef-validator" -%>
|
45
45
|
[ `grep -qx "validation_client_name \"<%= @chef_config[:validation_client_name] %>\"" /etc/chef/client.rb` ] || echo "validation_client_name \"<%= @chef_config[:validation_client_name] %>\"" >> /etc/chef/client.rb
|
@@ -38,7 +38,6 @@ rm /tmp/encrypted_data_bag_secret
|
|
38
38
|
<%# Generate Ohai Hints -%>
|
39
39
|
<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
|
40
40
|
mkdir -p /etc/chef/ohai/hints
|
41
|
-
<% end -%>
|
42
41
|
|
43
42
|
<% @chef_config[:knife][:hints].each do |name, hash| -%>
|
44
43
|
(
|
@@ -47,6 +46,7 @@ cat <<'EOP'
|
|
47
46
|
EOP
|
48
47
|
) > /etc/chef/ohai/hints/<%= name %>.json
|
49
48
|
<% end -%>
|
49
|
+
<% end -%>
|
50
50
|
|
51
51
|
(
|
52
52
|
cat <<'EOP'
|
@@ -33,7 +33,6 @@ rm /tmp/encrypted_data_bag_secret
|
|
33
33
|
<%# Generate Ohai Hints -%>
|
34
34
|
<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
|
35
35
|
mkdir -p /etc/chef/ohai/hints
|
36
|
-
<% end -%>
|
37
36
|
|
38
37
|
<% @chef_config[:knife][:hints].each do |name, hash| -%>
|
39
38
|
(
|
@@ -42,6 +41,7 @@ cat <<'EOP'
|
|
42
41
|
EOP
|
43
42
|
) > /etc/chef/ohai/hints/<%= name %>.json
|
44
43
|
<% end -%>
|
44
|
+
<% end -%>
|
45
45
|
|
46
46
|
(
|
47
47
|
cat <<'EOP'
|
@@ -75,6 +75,7 @@ class Chef
|
|
75
75
|
readme_format = ((config[:readme_format] != "false") && config[:readme_format]) || "md"
|
76
76
|
create_cookbook(cookbook_path,cookbook_name, copyright, license)
|
77
77
|
create_readme(cookbook_path,cookbook_name,readme_format)
|
78
|
+
create_changelog(cookbook_path,cookbook_name)
|
78
79
|
create_metadata(cookbook_path,cookbook_name, copyright, email, license,readme_format)
|
79
80
|
end
|
80
81
|
|
@@ -179,6 +180,28 @@ EOH
|
|
179
180
|
end
|
180
181
|
end
|
181
182
|
|
183
|
+
def create_changelog(dir, cookbook_name)
|
184
|
+
msg("** Creating CHANGELOG for cookbook: #{cookbook_name}")
|
185
|
+
unless File.exists?(File.join(dir,cookbook_name,'CHANGELOG.md'))
|
186
|
+
open(File.join(dir, cookbook_name, 'CHANGELOG.md'),'w') do |file|
|
187
|
+
file.puts <<-EOH
|
188
|
+
# CHANGELOG for #{cookbook_name}
|
189
|
+
|
190
|
+
This file is used to list changes made in each version of #{cookbook_name}.
|
191
|
+
|
192
|
+
## 0.1.0:
|
193
|
+
|
194
|
+
* Initial release of #{cookbook_name}
|
195
|
+
|
196
|
+
- - -
|
197
|
+
Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.
|
198
|
+
|
199
|
+
The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.
|
200
|
+
EOH
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
182
205
|
def create_readme(dir, cookbook_name,readme_format)
|
183
206
|
msg("** Creating README for cookbook: #{cookbook_name}")
|
184
207
|
unless File.exists?(File.join(dir, cookbook_name, "README.#{readme_format}"))
|
@@ -253,7 +276,7 @@ maintainer_email "#{email}"
|
|
253
276
|
license "#{license_name}"
|
254
277
|
description "Installs/Configures #{cookbook_name}"
|
255
278
|
#{long_description}
|
256
|
-
version "0.0
|
279
|
+
version "0.1.0"
|
257
280
|
EOH
|
258
281
|
end
|
259
282
|
end
|
data/lib/chef/knife/ssh.rb
CHANGED
@@ -79,7 +79,7 @@ class Chef
|
|
79
79
|
:short => "-G GATEWAY",
|
80
80
|
:long => "--ssh-gateway GATEWAY",
|
81
81
|
:description => "The ssh gateway",
|
82
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:
|
82
|
+
:proc => Proc.new { |key| Chef::Config[:knife][:ssh_gateway] = key }
|
83
83
|
|
84
84
|
option :identity_file,
|
85
85
|
:short => "-i IDENTITY_FILE",
|
@@ -124,7 +124,13 @@ class Chef
|
|
124
124
|
q = Chef::Search::Query.new
|
125
125
|
@action_nodes = q.search(:node, @name_args[0])[0]
|
126
126
|
@action_nodes.each do |item|
|
127
|
-
|
127
|
+
# if a command line attribute was not passed, and we have a cloud public_hostname, use that.
|
128
|
+
# see #configure_attribute for the source of config[:attribute] and config[:override_attribute]
|
129
|
+
if !config[:override_attribute] && item[:cloud] and item[:cloud][:public_hostname]
|
130
|
+
i = format_for_display(item)[:cloud][:public_hostname]
|
131
|
+
else
|
132
|
+
i = format_for_display(item)[config[:attribute]]
|
133
|
+
end
|
128
134
|
r.push(i) unless i.nil?
|
129
135
|
end
|
130
136
|
r
|
@@ -334,6 +340,12 @@ class Chef
|
|
334
340
|
end
|
335
341
|
|
336
342
|
def configure_attribute
|
343
|
+
# Setting 'knife[:ssh_attribute] = "foo"' in knife.rb => Chef::Config[:knife][:ssh_attribute] == 'foo'
|
344
|
+
# Running 'knife ssh -a foo' => both Chef::Config[:knife][:ssh_attribute] && config[:attribute] == foo
|
345
|
+
# Thus we can differentiate between a config file value and a command line override at this point by checking config[:attribute]
|
346
|
+
# We can tell here if fqdn was passed from the command line, rather than being the default, by checking config[:attribute]
|
347
|
+
# However, after here, we cannot tell these things, so we must preserve config[:attribute]
|
348
|
+
config[:override_attribute] = config[:attribute]
|
337
349
|
config[:attribute] = (Chef::Config[:knife][:ssh_attribute] ||
|
338
350
|
config[:attribute] ||
|
339
351
|
"fqdn").strip
|
data/lib/chef/platform.rb
CHANGED
@@ -211,7 +211,7 @@ class Chef
|
|
211
211
|
:openindiana => {
|
212
212
|
:default => {
|
213
213
|
:service => Chef::Provider::Service::Solaris,
|
214
|
-
:package => Chef::Provider::Package::
|
214
|
+
:package => Chef::Provider::Package::Ips,
|
215
215
|
:cron => Chef::Provider::Cron::Solaris,
|
216
216
|
:group => Chef::Provider::Group::Usermod
|
217
217
|
}
|
@@ -219,7 +219,7 @@ class Chef
|
|
219
219
|
:opensolaris => {
|
220
220
|
:default => {
|
221
221
|
:service => Chef::Provider::Service::Solaris,
|
222
|
-
:package => Chef::Provider::Package::
|
222
|
+
:package => Chef::Provider::Package::Ips,
|
223
223
|
:cron => Chef::Provider::Cron::Solaris,
|
224
224
|
:group => Chef::Provider::Group::Usermod
|
225
225
|
}
|
@@ -232,8 +232,28 @@ class Chef
|
|
232
232
|
:group => Chef::Provider::Group::Usermod
|
233
233
|
}
|
234
234
|
},
|
235
|
+
:omnios => {
|
236
|
+
:default => {
|
237
|
+
:service => Chef::Provider::Service::Solaris,
|
238
|
+
:package => Chef::Provider::Package::Ips,
|
239
|
+
:cron => Chef::Provider::Cron::Solaris,
|
240
|
+
:group => Chef::Provider::Group::Usermod
|
241
|
+
}
|
242
|
+
},
|
235
243
|
:solaris2 => {
|
236
244
|
:default => {
|
245
|
+
:service => Chef::Provider::Service::Solaris,
|
246
|
+
:package => Chef::Provider::Package::Ips,
|
247
|
+
:cron => Chef::Provider::Cron::Solaris,
|
248
|
+
:group => Chef::Provider::Group::Usermod
|
249
|
+
},
|
250
|
+
"5.9" => {
|
251
|
+
:service => Chef::Provider::Service::Solaris,
|
252
|
+
:package => Chef::Provider::Package::Solaris,
|
253
|
+
:cron => Chef::Provider::Cron::Solaris,
|
254
|
+
:group => Chef::Provider::Group::Usermod
|
255
|
+
},
|
256
|
+
"5.10" => {
|
237
257
|
:service => Chef::Provider::Service::Solaris,
|
238
258
|
:package => Chef::Provider::Package::Solaris,
|
239
259
|
:cron => Chef::Provider::Cron::Solaris,
|