knife-solo 0.6.0 → 0.7.0.pre
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 +4 -4
- data/README.rdoc +2 -0
- data/lib/chef/knife/solo_cook.rb +11 -0
- data/lib/knife-solo/bootstraps/linux.rb +1 -1
- data/lib/knife-solo/info.rb +1 -1
- data/lib/knife-solo/resources/solo.rb.erb +1 -0
- data/test/gemfiles/Gemfile.chef-10 +9 -1
- data/test/gemfiles/Gemfile.chef-11 +7 -0
- data/test/gemfiles/Gemfile.chef-master +2 -0
- data/test/solo_cook_test.rb +22 -0
- metadata +5 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54b796b366bee333a0859d7f76c02c00aace3dfa
|
4
|
+
data.tar.gz: a7544fec3cd45386282288640a98b928da7265a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2f863db00f02c4f16402e7964178bca9f2c7d5dee8ef4c7699938227c1e3010a7c98be098ac4a4db07f5fdf4665d56d7f0accb29fae762a1db3ce3a7d17508b
|
7
|
+
data.tar.gz: 1d6ba62ef6d0e1d27c1e1d0ca11beece9f95623fad826e0bcd61548f8b3c0425b8ebe9bb947dc7f35f60e90391d0af3201818badd966231f92a613ca4465ff8f
|
data/README.rdoc
CHANGED
@@ -99,6 +99,8 @@ This also supports encrypted data bags. To use them, set the path to your key wi
|
|
99
99
|
|
100
100
|
The built-in knife commands for working with data bags don't work well without a Chef server so we recommend using the {knife-solo_data_bag}[https://github.com/thbishop/knife-solo_data_bag] gem. This will provide "solo" versions of all the typical data bag commands. The default kitchen structure generated by <tt>knife solo init</tt> should be compatible with all the operations listed in the documentation for that gem.
|
101
101
|
|
102
|
+
If you want to run chef-solo in legacy mode, you may use +--legacy-mode+ option or put +solo_legacy_mode true+ into .chef/knife.rb.
|
103
|
+
|
102
104
|
=== Bootstrap command
|
103
105
|
|
104
106
|
The bootstrap command takes the same arguments and most of the options as prepare and cook:
|
data/lib/chef/knife/solo_cook.rb
CHANGED
@@ -75,6 +75,10 @@ class Chef
|
|
75
75
|
:long => '--clean-up',
|
76
76
|
:description => 'Run the clean command after cooking'
|
77
77
|
|
78
|
+
option :legacy_mode,
|
79
|
+
:long => '--legacy-mode',
|
80
|
+
:description => 'Run chef-solo in legacy mode'
|
81
|
+
|
78
82
|
def run
|
79
83
|
time('Run') do
|
80
84
|
|
@@ -135,6 +139,10 @@ class Chef
|
|
135
139
|
Chef::Config[:ssl_verify_mode] || :verify_peer
|
136
140
|
end
|
137
141
|
|
142
|
+
def solo_legacy_mode
|
143
|
+
Chef::Config[:solo_legacy_mode] || false
|
144
|
+
end
|
145
|
+
|
138
146
|
def expand_path(path)
|
139
147
|
Pathname.new(path).expand_path
|
140
148
|
end
|
@@ -308,6 +316,9 @@ class Chef
|
|
308
316
|
cmd << " -N #{config[:chef_node_name]}" if config[:chef_node_name]
|
309
317
|
cmd << " -W" if config[:why_run]
|
310
318
|
cmd << " -o #{config[:override_runlist]}" if config[:override_runlist]
|
319
|
+
if Gem::Version.new(::Chef::VERSION) >= Gem::Version.new("12.10.54")
|
320
|
+
cmd << " --legacy-mode" if config[:legacy_mode]
|
321
|
+
end
|
311
322
|
|
312
323
|
ui.msg "Running Chef: #{cmd}"
|
313
324
|
|
@@ -100,7 +100,7 @@ module KnifeSolo::Bootstraps
|
|
100
100
|
{:type => "yum_omnibus"}
|
101
101
|
when %r{SUSE Linux Enterprise Server 1[12]}
|
102
102
|
{:type => "omnibus"}
|
103
|
-
when %r{openSUSE 1[23]}
|
103
|
+
when %r{openSUSE 1[23]}, %r{openSUSE Leap 42}
|
104
104
|
{:type => "zypper_omnibus"}
|
105
105
|
when %r{This is \\n\.\\O \(\\s \\m \\r\) \\t}
|
106
106
|
{:type => "emerge_gem"}
|
data/lib/knife-solo/info.rb
CHANGED
@@ -9,6 +9,7 @@ encrypted_data_bag_secret File.join(base, 'data_bag_key')
|
|
9
9
|
environment_path File.join(base, 'environments')
|
10
10
|
environment <%= node_environment.inspect %>
|
11
11
|
ssl_verify_mode <%= ssl_verify_mode.inspect %>
|
12
|
+
solo_legacy_mode <%= solo_legacy_mode.inspect %>
|
12
13
|
|
13
14
|
cookbook_path []
|
14
15
|
<% cookbook_paths.each_with_index do |path, i| -%>
|
@@ -2,12 +2,20 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec :path => '../..'
|
4
4
|
|
5
|
-
gem 'chef', '~> 10'
|
5
|
+
gem 'chef', '~> 10.34'
|
6
6
|
|
7
7
|
platform :ruby_19 do
|
8
8
|
gem 'berkshelf-api-client', '~> 1.3.1'
|
9
|
+
gem 'tins', '~> 1.6.0'
|
9
10
|
gem 'varia_model', '~> 0.4.0'
|
10
11
|
gem 'json', '~> 1.8.1'
|
11
12
|
gem 'mixlib-config', '~> 1.1.2'
|
12
13
|
gem 'ohai', '~> 6.24.2'
|
14
|
+
gem 'nio4r', '~> 1.2.1'
|
15
|
+
gem 'buff-ignore', '~> 1.1.1'
|
16
|
+
gem 'rack', '~> 1.6.5'
|
17
|
+
gem 'net-http-persistent', '~> 2.9.4'
|
18
|
+
gem 'dep_selector', '<= 1.0.3'
|
19
|
+
gem 'term-ansicolor', '~> 1.3.2'
|
20
|
+
gem 'nokogiri', '~> 1.6.8'
|
13
21
|
end
|
@@ -9,4 +9,11 @@ platform :ruby_19 do
|
|
9
9
|
gem 'tins', '~> 1.6.0'
|
10
10
|
gem 'varia_model', '~> 0.4.0'
|
11
11
|
gem 'ohai', '~> 7.4.1'
|
12
|
+
gem 'nio4r', '~> 1.2.1'
|
13
|
+
gem 'buff-ignore', '~> 1.1.1'
|
14
|
+
gem 'rack', '~> 1.6.5'
|
15
|
+
gem 'net-http-persistent', '~> 2.9.4'
|
16
|
+
gem 'dep_selector', '<= 1.0.3'
|
17
|
+
gem 'term-ansicolor', '~> 1.3.2'
|
18
|
+
gem 'nokogiri', '~> 1.6.8'
|
12
19
|
end
|
data/test/solo_cook_test.rb
CHANGED
@@ -44,6 +44,11 @@ class SoloCookTest < TestCase
|
|
44
44
|
assert_equal :verify_none, command.ssl_verify_mode
|
45
45
|
end
|
46
46
|
|
47
|
+
def test_sets_solo_legacy_mode
|
48
|
+
Chef::Config[:solo_legacy_mode] = true
|
49
|
+
assert_equal true, command.solo_legacy_mode
|
50
|
+
end
|
51
|
+
|
47
52
|
def test_rsync_without_gateway_connection_options
|
48
53
|
in_kitchen do
|
49
54
|
|
@@ -347,6 +352,23 @@ class SoloCookTest < TestCase
|
|
347
352
|
assert_chef_solo_option "--override-runlist=sandbox::default", "-o sandbox::default"
|
348
353
|
end
|
349
354
|
|
355
|
+
def test_passes_legacy_mode_to_chef_solo
|
356
|
+
if Gem::Version.new(::Chef::VERSION) >= Gem::Version.new("12.10.54")
|
357
|
+
assert_chef_solo_option "--legacy-mode", "--legacy-mode"
|
358
|
+
else
|
359
|
+
matcher = regexp_matches(/\s#{Regexp.quote("--legacy-mode")}(\s|$)/)
|
360
|
+
in_kitchen do
|
361
|
+
cmd = command("somehost", "--legacy-mode")
|
362
|
+
cmd.expects(:stream_command).with(Not(matcher)).returns(SuccessfulResult.new)
|
363
|
+
cmd.run
|
364
|
+
|
365
|
+
cmd = command("somehost")
|
366
|
+
cmd.expects(:stream_command).with(Not(matcher)).returns(SuccessfulResult.new)
|
367
|
+
cmd.run
|
368
|
+
end
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
350
372
|
# Asserts that the chef_solo_option is passed to chef-solo iff cook_option
|
351
373
|
# is specified for the cook command
|
352
374
|
def assert_chef_solo_option(cook_option, chef_solo_option)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-solo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Schaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: berkshelf
|
@@ -185,9 +185,6 @@ dependencies:
|
|
185
185
|
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '2.7'
|
188
|
-
- - "<"
|
189
|
-
- !ruby/object:Gem::Version
|
190
|
-
version: '4.0'
|
191
188
|
type: :runtime
|
192
189
|
prerelease: false
|
193
190
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -195,9 +192,6 @@ dependencies:
|
|
195
192
|
- - ">="
|
196
193
|
- !ruby/object:Gem::Version
|
197
194
|
version: '2.7'
|
198
|
-
- - "<"
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
version: '4.0'
|
201
195
|
- !ruby/object:Gem::Dependency
|
202
196
|
name: erubis
|
203
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -357,12 +351,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
357
351
|
version: '0'
|
358
352
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
359
353
|
requirements:
|
360
|
-
- - "
|
354
|
+
- - ">"
|
361
355
|
- !ruby/object:Gem::Version
|
362
|
-
version:
|
356
|
+
version: 1.3.1
|
363
357
|
requirements: []
|
364
358
|
rubyforge_project:
|
365
|
-
rubygems_version: 2.
|
359
|
+
rubygems_version: 2.6.8
|
366
360
|
signing_key:
|
367
361
|
specification_version: 4
|
368
362
|
summary: A collection of knife plugins for dealing with chef solo
|