knife-zero 1.8.3 → 1.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/knife-zero.gemspec +1 -1
- data/lib/knife-zero/net-ssh-multi-patch.rb +1 -1
- data/lib/knife-zero/version.rb +1 -1
- metadata +3 -27
- data/.gitignore +0 -43
- data/Dockerfile +0 -25
- data/Gemfile +0 -4
- data/Guardfile +0 -5
- data/LICENSE.txt +0 -13
- data/Rakefile +0 -2
- data/circle.yml +0 -15
- data/integration_test/chef-repo/knife.rb +0 -2
- data/integration_test/chef-repo/run.sh +0 -10
- data/integration_test/pre/Dockerfile +0 -11
- data/test/chef/knife/test_zero_bootstrap.rb +0 -33
- data/test/chef/knife/test_zero_chef_client.rb +0 -18
- data/test/knife-zero/core/test_bootstrap_context.rb +0 -20
- data/test/knife-zero/core/test_zerohelper.rb +0 -43
- data/test/knife-zero/test_bootstrap_ssh.rb +0 -8
- data/test/knife-zero/test_versioin.rb +0 -7
- data/test/run_test.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ab2834fd2beeea31094b0febd081c29a15db310
|
4
|
+
data.tar.gz: 189892d9e4dedadeaec7f94ca9f2e25e7aad4528
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 731464bccd0cbe722eac85f62191d0345ae86ad77fa4969a30f8ef055d741b3defb8d589db89091c379fd02990ec4afc0bf9c1798961172313a35b32fae60dfb
|
7
|
+
data.tar.gz: 2fe821ece3692371730f722942d55d0c74f9f1faea4d4655d132be4257d6c142f7e65fa9a07fa8dd9109713e1e748c6f9f4f6fd6087afe1e1a12eb66bafb60c1
|
data/CHANGELOG.md
CHANGED
data/knife-zero.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "Apache2"
|
15
15
|
|
16
|
-
spec.files =
|
16
|
+
spec.files = Dir['README.md','CHANGELOG.md','knife-zero.gemspec','lib/**/*']
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'net/ssh/multi/version'
|
2
2
|
|
3
|
-
if Net::SSH::Multi::Version::STRING == "1.1.0" || Net::SSH::Multi::Version::STRING == "1.2.0"
|
3
|
+
if Net::SSH::Multi::Version::STRING == "1.1.0" || Net::SSH::Multi::Version::STRING == "1.2.0" || Net::SSH::Multi::Version::STRING == "1.2.1"
|
4
4
|
|
5
5
|
require 'net/ssh/multi'
|
6
6
|
|
data/lib/knife-zero/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawanoboly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -158,18 +158,8 @@ executables: []
|
|
158
158
|
extensions: []
|
159
159
|
extra_rdoc_files: []
|
160
160
|
files:
|
161
|
-
- ".gitignore"
|
162
161
|
- CHANGELOG.md
|
163
|
-
- Dockerfile
|
164
|
-
- Gemfile
|
165
|
-
- Guardfile
|
166
|
-
- LICENSE.txt
|
167
162
|
- README.md
|
168
|
-
- Rakefile
|
169
|
-
- circle.yml
|
170
|
-
- integration_test/chef-repo/knife.rb
|
171
|
-
- integration_test/chef-repo/run.sh
|
172
|
-
- integration_test/pre/Dockerfile
|
173
163
|
- knife-zero.gemspec
|
174
164
|
- lib/chef/knife/zero_base.rb
|
175
165
|
- lib/chef/knife/zero_bootstrap.rb
|
@@ -181,13 +171,6 @@ files:
|
|
181
171
|
- lib/knife-zero/helper.rb
|
182
172
|
- lib/knife-zero/net-ssh-multi-patch.rb
|
183
173
|
- lib/knife-zero/version.rb
|
184
|
-
- test/chef/knife/test_zero_bootstrap.rb
|
185
|
-
- test/chef/knife/test_zero_chef_client.rb
|
186
|
-
- test/knife-zero/core/test_bootstrap_context.rb
|
187
|
-
- test/knife-zero/core/test_zerohelper.rb
|
188
|
-
- test/knife-zero/test_bootstrap_ssh.rb
|
189
|
-
- test/knife-zero/test_versioin.rb
|
190
|
-
- test/run_test.rb
|
191
174
|
homepage: ''
|
192
175
|
licenses:
|
193
176
|
- Apache2
|
@@ -213,12 +196,5 @@ signing_key:
|
|
213
196
|
specification_version: 4
|
214
197
|
summary: Run chef-client at remote node with chef-zero(local-mode) via HTTP over SSH
|
215
198
|
port fowarding.
|
216
|
-
test_files:
|
217
|
-
- test/chef/knife/test_zero_bootstrap.rb
|
218
|
-
- test/chef/knife/test_zero_chef_client.rb
|
219
|
-
- test/knife-zero/core/test_bootstrap_context.rb
|
220
|
-
- test/knife-zero/core/test_zerohelper.rb
|
221
|
-
- test/knife-zero/test_bootstrap_ssh.rb
|
222
|
-
- test/knife-zero/test_versioin.rb
|
223
|
-
- test/run_test.rb
|
199
|
+
test_files: []
|
224
200
|
has_rdoc:
|
data/.gitignore
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
*.bundle
|
19
|
-
*.so
|
20
|
-
*.o
|
21
|
-
*.a
|
22
|
-
mkmf.log
|
23
|
-
# Created by http://www.gitignore.io
|
24
|
-
|
25
|
-
### vim ###
|
26
|
-
[._]*.s[a-w][a-z]
|
27
|
-
[._]s[a-w][a-z]
|
28
|
-
*.un~
|
29
|
-
Session.vim
|
30
|
-
.netrwhist
|
31
|
-
*~
|
32
|
-
|
33
|
-
## Development
|
34
|
-
|
35
|
-
.rvmrc
|
36
|
-
|
37
|
-
## Integration
|
38
|
-
nodes/
|
39
|
-
roles/
|
40
|
-
environments/
|
41
|
-
data_bags/
|
42
|
-
clients/
|
43
|
-
cookbooks/
|
data/Dockerfile
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
FROM higanworks/knife-zero-edgebase
|
2
|
-
MAINTAINER sawanoboriyu@higanworks.com
|
3
|
-
|
4
|
-
ADD .git/index /index
|
5
|
-
|
6
|
-
WORKDIR /home
|
7
|
-
RUN wget https://codeload.github.com/chef/chef/legacy.tar.gz/master
|
8
|
-
RUN tar xvzf master && mv chef-chef-* chef
|
9
|
-
|
10
|
-
WORKDIR /home/chef
|
11
|
-
|
12
|
-
RUN gem build chef.gemspec
|
13
|
-
RUN gem install -V -b chef*.gem --no-ri --no-rdoc
|
14
|
-
|
15
|
-
ADD . /home/knife-zero/
|
16
|
-
ADD integration_test/chef-repo /chef-repo/
|
17
|
-
|
18
|
-
WORKDIR /home/knife-zero
|
19
|
-
|
20
|
-
RUN gem build knife-zero.gemspec
|
21
|
-
RUN gem install -V -l knife-zero-*.gem
|
22
|
-
|
23
|
-
WORKDIR /chef-repo
|
24
|
-
|
25
|
-
CMD ["sh", "run.sh"]
|
data/Gemfile
DELETED
data/Guardfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Copyright (c) 2014-2015 sawanoboly@higanworks.com
|
2
|
-
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
you may not use this file except in compliance with the License.
|
5
|
-
You may obtain a copy of the License at
|
6
|
-
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
See the License for the specific language governing permissions and
|
13
|
-
limitations under the License.
|
data/Rakefile
DELETED
data/circle.yml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
machine:
|
3
|
-
ruby:
|
4
|
-
version: 2.1.5
|
5
|
-
services:
|
6
|
-
- docker
|
7
|
-
test:
|
8
|
-
override:
|
9
|
-
- bundle exec ruby test/run_test.rb -v
|
10
|
-
deployment:
|
11
|
-
integration:
|
12
|
-
branch: integration_testedge
|
13
|
-
commands:
|
14
|
-
- docker build -t local/knife-zero .
|
15
|
-
- docker run -it local/knife-zero sh run.sh
|
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
set -e
|
4
|
-
|
5
|
-
/usr/sbin/sshd -E /tmp/log -o 'LogLevel DEBUG'
|
6
|
-
knife zero diagnose
|
7
|
-
knife zero bootstrap 127.0.0.1 -N zerohost -x docker -P docker --sudo -V
|
8
|
-
knife node show zerohost
|
9
|
-
knife zero chef_client "name:zerohost" -a ipaddress -x docker -P docker --sudo -V
|
10
|
-
|
@@ -1,11 +0,0 @@
|
|
1
|
-
FROM ubuntu:15.04
|
2
|
-
MAINTAINER sawanoboriyu@higanworks.com
|
3
|
-
|
4
|
-
RUN apt-get -y update
|
5
|
-
RUN apt-get -y install sudo git build-essential ruby2.1 ruby2.1-dev openssh-server wget vim net-tools
|
6
|
-
|
7
|
-
|
8
|
-
RUN mkdir /var/run/sshd
|
9
|
-
RUN useradd -p $(perl -e'print crypt("docker", "docker")') -m docker
|
10
|
-
RUN echo '%docker ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/docker
|
11
|
-
CMD ["/bin/true"]
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'chef/knife/zero_bootstrap'
|
2
|
-
|
3
|
-
class TC_ZeroBootstrap < Test::Unit::TestCase
|
4
|
-
sub_test_case "called with no options" do
|
5
|
-
def setup
|
6
|
-
@app = Chef::Knife::ZeroBootstrap.new
|
7
|
-
@app.merge_configs
|
8
|
-
require 'chef/knife/ssh'
|
9
|
-
Chef::Knife::ZeroBootstrap.load_deps
|
10
|
-
end
|
11
|
-
|
12
|
-
test "returns true from Chef::Config[:knife_zero]" do
|
13
|
-
assert_equal({}, Chef::Config[:knife_zero])
|
14
|
-
end
|
15
|
-
|
16
|
-
test "returns expected bootstrap template(for notice changes of core to me)" do
|
17
|
-
assert_equal("chef-full", @app.default_bootstrap_template)
|
18
|
-
end
|
19
|
-
|
20
|
-
test "returns BootstrapSsh via knife_ssh" do
|
21
|
-
ssh = @app.knife_ssh
|
22
|
-
assert_kind_of(Chef::Knife::BootstrapSsh, ssh)
|
23
|
-
end
|
24
|
-
|
25
|
-
sub_test_case "overwrite ssh_configuration from ssh/config" do
|
26
|
-
test "overwrite port number" do
|
27
|
-
stub(Net::SSH).configuration_for { {port: 10022} }
|
28
|
-
ssh = @app.knife_ssh
|
29
|
-
assert_equal(10022, ssh.config[:port])
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'chef/knife/zero_chef_client'
|
2
|
-
class TC_ZeroChefClient < Test::Unit::TestCase
|
3
|
-
sub_test_case "called with no options" do
|
4
|
-
def setup
|
5
|
-
@app = Chef::Knife::ZeroChefClient.new
|
6
|
-
@app.merge_configs
|
7
|
-
end
|
8
|
-
|
9
|
-
test "returns true from Chef::Config[:knife_zero]" do
|
10
|
-
assert(Chef::Config[:knife_zero])
|
11
|
-
end
|
12
|
-
|
13
|
-
test "returns changed value from core" do
|
14
|
-
assert_nil(@app.config[:concurrency])
|
15
|
-
assert_nil(@app.config[:override_runlist])
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'chef/knife/zero_chef_client'
|
2
|
-
require 'knife-zero/core/bootstrap_context'
|
3
|
-
|
4
|
-
class TC_BootstrapContext < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
Chef::Config[:validation_key] = nil
|
7
|
-
app = Chef::Knife::ZeroBootstrap.new
|
8
|
-
app.merge_configs
|
9
|
-
@bsc = Chef::Knife::Core::BootstrapContext.new(app.config, [], Chef::Config.configuration)
|
10
|
-
stub(OpenSSL::PKey::RSA).new{"knife-zerozero"}
|
11
|
-
end
|
12
|
-
|
13
|
-
test "Should use aliased validation_key" do
|
14
|
-
assert_equal("knife-zerozero", @bsc.validation_key)
|
15
|
-
end
|
16
|
-
|
17
|
-
test "Should use aliased start_chef" do
|
18
|
-
assert_match('-S http://127.0.0.1', @bsc.start_chef)
|
19
|
-
end
|
20
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'chef/knife/zero_base'
|
2
|
-
require 'knife-zero/helper'
|
3
|
-
|
4
|
-
class TC_ZeroHelper < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@config = Chef::Config
|
7
|
-
end
|
8
|
-
|
9
|
-
test "Should returns 18889 as zero_remote_port by default" do
|
10
|
-
assert_equal(18889, ::Knife::Zero::Helper.zero_remote_port)
|
11
|
-
end
|
12
|
-
|
13
|
-
sub_test_case "override" do
|
14
|
-
test "Should returns 10000 + chef_zero_port as zero_remote_port" do
|
15
|
-
@config[:chef_zero_port] = 2500
|
16
|
-
assert_equal(12500, ::Knife::Zero::Helper.zero_remote_port)
|
17
|
-
end
|
18
|
-
|
19
|
-
test "Should returns 10000 + knife:chef_zero_port as zero_remote_port" do
|
20
|
-
@config[:knife][:chef_zero_port] = 2500
|
21
|
-
assert_equal(12500, ::Knife::Zero::Helper.zero_remote_port)
|
22
|
-
end
|
23
|
-
|
24
|
-
def teardown
|
25
|
-
@config[:chef_zero_port] = nil
|
26
|
-
@config[:knife][:chef_zero_port] = nil
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
sub_test_case "force set by remote_chef_zero_port" do
|
31
|
-
|
32
|
-
test "Should returns passed remote_chef_zero_port as zero_remote_port" do
|
33
|
-
@config[:remote_chef_zero_port] = 8888
|
34
|
-
@config[:chef_zero_port] = 2500
|
35
|
-
assert_equal(8888, ::Knife::Zero::Helper.zero_remote_port)
|
36
|
-
end
|
37
|
-
|
38
|
-
def teardown
|
39
|
-
@config[:remote_chef_zero_port] = nil
|
40
|
-
@config[:chef_zero_port] = nil
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/test/run_test.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
3
|
-
lib_dir = File.join(base_dir, "lib")
|
4
|
-
test_dir = File.join(base_dir, "test")
|
5
|
-
|
6
|
-
$LOAD_PATH.unshift(lib_dir)
|
7
|
-
|
8
|
-
require 'test/unit'
|
9
|
-
require 'test/unit/rr'
|
10
|
-
require 'simplecov'
|
11
|
-
require 'simplecov-rcov'
|
12
|
-
|
13
|
-
if ENV['CIRCLE_ARTIFACTS']
|
14
|
-
dir = File.join("..", "..", "..", ENV['CIRCLE_ARTIFACTS'], "coverage")
|
15
|
-
SimpleCov.coverage_dir(dir)
|
16
|
-
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
|
17
|
-
SimpleCov.start do
|
18
|
-
add_filter "/vendor/"
|
19
|
-
add_filter "/test/"
|
20
|
-
end
|
21
|
-
else
|
22
|
-
require "test/unit/notify"
|
23
|
-
end
|
24
|
-
|
25
|
-
exit Test::Unit::AutoRunner.run(true, test_dir)
|