knife-zero 1.16.0 → 1.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/chef/knife/zero_bootstrap.rb +37 -9
- 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: a40dd1fc641fbf981484851683d3825740e2bcf5
|
4
|
+
data.tar.gz: 24f980020ff1fd340b3d8a0727d2d0b6ea2825f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3136f76b2f8c591eda4675fb6bf83c17ccf895b949ea99b41225f00cfb5de3cbb46bce42e799d45254f30e94d0eb582dd4a927b70f289e97524fb5d3262d2db7
|
7
|
+
data.tar.gz: c4dcc970035cde7144b592c49896758e8c28c1dd44cc018cc0b2dd79399377800966353d14925cff4cc2c1ab413f4db5556a70df78927c3508223dfa8cae07dd
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,15 @@
|
|
4
4
|
|
5
5
|
Empty.
|
6
6
|
|
7
|
+
## v1.17.1
|
8
|
+
|
9
|
+
- [Bugfix]: change of 1.17.0 crashes nodenameless bootstrapping.
|
10
|
+
|
11
|
+
## v1.17.0(Yanked)
|
12
|
+
|
13
|
+
- Change: Ask overwrite node object at bootstrap #101
|
14
|
+
- New option `--[no-]overwrite`
|
15
|
+
|
7
16
|
## v1.16.0
|
8
17
|
|
9
18
|
- [Feature] converge with `--json-attributes` #98
|
@@ -33,17 +33,24 @@ class Chef
|
|
33
33
|
self.options = Bootstrap.options.merge(self.options)
|
34
34
|
|
35
35
|
option :bootstrap_converge,
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
:long => "--[no-]converge",
|
37
|
+
:description => "Bootstrap without Chef-Client Run.(for only update client.rb)",
|
38
|
+
:boolean => true,
|
39
|
+
:default => true,
|
40
|
+
:proc => lambda { |v| Chef::Config[:knife][:bootstrap_converge] = v }
|
41
|
+
|
42
|
+
option :overwrite_node_object,
|
43
|
+
:long => "--[no-]overwrite",
|
44
|
+
:description => "Overwrite local node object if node already exist. false by default",
|
45
|
+
:boolean => true,
|
46
|
+
:default => false,
|
47
|
+
:proc => lambda { |v| Chef::Config[:knife][:overwrite_node_object] = v }
|
41
48
|
|
42
49
|
option :appendix_config,
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
50
|
+
:long => "--appendix-config PATH",
|
51
|
+
:description => "Append lines to end of client.rb on remote node from file.",
|
52
|
+
:proc => lambda { |o| File.read(o) },
|
53
|
+
:default => nil
|
47
54
|
|
48
55
|
def run
|
49
56
|
## Command hook before_bootstrap (After launched Chef-Zero)
|
@@ -51,6 +58,23 @@ class Chef
|
|
51
58
|
::Knife::Zero::Helper.hook_shell_out!("before_bootstrap", ui, Chef::Config[:knife][:before_bootstrap])
|
52
59
|
end
|
53
60
|
|
61
|
+
if @config[:bootstrap_converge]
|
62
|
+
unless @config[:overwrite_node_object]
|
63
|
+
q = Chef::Search::Query.new
|
64
|
+
node_name = resolve_node_name
|
65
|
+
result = q.search(:node, "name:#{node_name} OR knife_zero_host:#{node_name}")
|
66
|
+
if result.last > 0
|
67
|
+
ui.warn(%Q{Node "#{node_name}" already exist. [Found #{result.last} Node(s) in local search.] (You can skip asking with --overwrite option.)})
|
68
|
+
if result.last == 1
|
69
|
+
ui.confirm(%Q{Overwrite it }, true, false)
|
70
|
+
else
|
71
|
+
ui.confirm(%Q{Overwrite one of them }, true, false)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
|
54
78
|
if @config[:first_boot_attributes_from_file]
|
55
79
|
@config[:first_boot_attributes_from_file] = @config[:first_boot_attributes_from_file].merge(build_knifezero_attributes_for_node)
|
56
80
|
else
|
@@ -113,6 +137,10 @@ class Chef
|
|
113
137
|
attr
|
114
138
|
end
|
115
139
|
|
140
|
+
def resolve_node_name
|
141
|
+
return @config[:chef_node_name] if @config[:chef_node_name]
|
142
|
+
@cli_arguments.first.split('@').last
|
143
|
+
end
|
116
144
|
end
|
117
145
|
end
|
118
146
|
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.
|
4
|
+
version: 1.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawanoboly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|