knife-zero 1.9.0 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/chef/knife/zero_bootstrap.rb +29 -16
- data/lib/knife-zero/net-ssh-multi-patch.rb +26 -0
- data/lib/knife-zero/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22e6e86fa94daaa9c448d457064d019fce563dd6
|
4
|
+
data.tar.gz: 3c5b8f78180ce1cf06fd1376f45c5a4bc0e06a7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e0dc596b82124a4a478ec81f45a4a24e79cffe04422ce0b1f2e1c2a23c4c3b6c91cd28c9296b53c0f52795655333fc2d338b43fabb5534b660c190e5b663977
|
7
|
+
data.tar.gz: 51ddf8d0e3e4b33104f7593f9b1dcefba73481f84e691238c4c2fbf16e5feae1151c72af48b800399d7694f55aa367afdc6e5355c34b471a413fa692db8afd49
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## v1.9.2
|
6
|
+
|
7
|
+
- Monkey: include Fixed host parsing to work with ipv6 addresses net-ssh/net-ssh-multi#9
|
8
|
+
- https://github.com/net-ssh/net-ssh-multi/pull/9
|
9
|
+
|
10
|
+
## v1.9.1
|
11
|
+
|
12
|
+
- Compatibility: Keep same behavior of --json-attribute-file option.
|
13
|
+
- use patche only before 12.5.2
|
14
|
+
|
5
15
|
## v1.9.0
|
6
16
|
|
7
17
|
- Change: use nil to ssh_user on bootstraping by default.
|
@@ -31,32 +31,45 @@ class Chef
|
|
31
31
|
:default => true,
|
32
32
|
:proc => lambda { |v| Chef::Config[:knife][:bootstrap_converge] = v }
|
33
33
|
|
34
|
-
## monkey for #3900 >>
|
35
|
-
|
36
|
-
|
37
|
-
:
|
38
|
-
|
39
|
-
|
40
|
-
|
34
|
+
## monkey for #3900(included 12.5.2) >>
|
35
|
+
if Gem::Version.new(Chef::VERSION) < Gem::Version.new('12.5.2')
|
36
|
+
unless options.has_key?(:first_boot_attributes_from_file)
|
37
|
+
option :first_boot_attributes_from_file,
|
38
|
+
:long => "--json-attribute-file FILE",
|
39
|
+
:description => "A JSON file to be used to the first run of chef-client",
|
40
|
+
:proc => lambda { |o| Chef::JSONCompat.parse(File.read(o)) },
|
41
|
+
:default => nil
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
def first_boot_attributes
|
44
|
+
@config[:first_boot_attributes] || @config[:first_boot_attributes_from_file] || {}
|
45
|
+
end
|
46
|
+
|
47
|
+
def render_template
|
48
|
+
@config[:first_boot_attributes] = first_boot_attributes
|
49
|
+
template_file = find_template
|
50
|
+
template = IO.read(template_file).chomp
|
51
|
+
Erubis::Eruby.new(template).evaluate(bootstrap_context)
|
52
|
+
end
|
53
|
+
|
54
|
+
## monkey for #3900(included 12.5.2) <<
|
45
55
|
end
|
46
|
-
## monkey for #3900 <<
|
47
56
|
end
|
48
57
|
|
49
58
|
def run
|
50
|
-
## monkey for #3900 >>
|
51
|
-
if
|
52
|
-
|
59
|
+
## monkey for #3900(included 12.5.2) >>
|
60
|
+
if Gem::Version.new(Chef::VERSION) < Gem::Version.new('12.5.2')
|
61
|
+
if @config[:first_boot_attributes] # Check for edge master
|
62
|
+
if @config[:first_boot_attributes].any? && @config[:first_boot_attributes_from_file]
|
63
|
+
raise "You cannot pass both --json-attributes and --json-attribute-file."
|
64
|
+
end
|
65
|
+
end
|
53
66
|
end
|
54
|
-
## monkey for #3900 <<
|
67
|
+
## monkey for #3900(included 12.5.2) <<
|
55
68
|
|
56
69
|
if @config[:first_boot_attributes_from_file]
|
57
70
|
@config[:first_boot_attributes_from_file] = @config[:first_boot_attributes_from_file].merge(build_knifezero_attributes_for_node)
|
58
71
|
else
|
59
|
-
@config[:first_boot_attributes] =
|
72
|
+
@config[:first_boot_attributes] = build_knifezero_attributes_for_node
|
60
73
|
end
|
61
74
|
super
|
62
75
|
end
|
@@ -28,4 +28,30 @@ if Net::SSH::Multi::Version::STRING == "1.1.0" || Net::SSH::Multi::Version::STRI
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
32
|
+
# https://github.com/net-ssh/net-ssh-multi/pull/9
|
33
|
+
require 'net/ssh/multi/server'
|
34
|
+
module Net::SSH::Multi
|
35
|
+
class Server
|
36
|
+
class_eval do
|
37
|
+
def initialize(master, host, options={})
|
38
|
+
@master = master
|
39
|
+
@options = options.dup
|
40
|
+
|
41
|
+
## Patched line here
|
42
|
+
@user, @host, port = host.match(/^(?:([^;,:=]+)@|)\[?(.*?)\]?(?::(\d+)|)$/)[1,3]
|
43
|
+
|
44
|
+
user_opt, port_opt = @options.delete(:user), @options.delete(:port)
|
45
|
+
|
46
|
+
@user = @user || user_opt || master.default_user
|
47
|
+
port ||= port_opt
|
48
|
+
|
49
|
+
@options[:port] = port.to_i if port
|
50
|
+
|
51
|
+
@gateway = @options.delete(:via)
|
52
|
+
@failed = false
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
31
57
|
end
|
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.9.
|
4
|
+
version: 1.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawanoboly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|