knife-zero 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: faceb4268fabca7f9ce0d461762633eee1e462c7
4
- data.tar.gz: 9fa1e9d3057549778c1aecbcd9610bb8b4e78194
3
+ metadata.gz: a664f1782d8cc36553ad2e5269d10080805568a2
4
+ data.tar.gz: 44fd1e97f0d4a800980e58bfc465ec45592f4309
5
5
  SHA512:
6
- metadata.gz: 33bab13eec4bb5b1d9630ecdf740bb61acd08b5d7d435b9a743c048faba61b8ddf8f8a3a13e2cd4190c99fe86b45ea629840421fb26c3beb71e368dba900ff5b
7
- data.tar.gz: 18a186631c76e4a9e996f87becc6dde87c834fdc9a6fd306fffe9a20ecb92f4fe9ad32ac732a86bca8656fd3012f8f5b79652ae30a3b1f781d37835f720810a6
6
+ metadata.gz: d6ef45236ae82c085aa05011cca60505710663c7cb6df5eb7b274dd29e01c5c9d542da3e3fa4ea0c2c1db941a23b33ac38a19faa371571a9a5800df2ae1b065e
7
+ data.tar.gz: c8d52756ad5cfc23585bf306d13589387910063f32e5d96da1bc21103e3ec28e5164470407ec8e7c44fcf885a8457070f2697fc189836c679f2d2c960ed7dc5a
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v1.7.1
6
+
7
+ - Misc: change option name from --without-chef-run to --[no-]converge #25
8
+
5
9
  ## v1.7.0
6
10
 
7
11
  - Bug: ignored knife[:use_sudo] by converge, #22 #42
data/README.md CHANGED
@@ -57,7 +57,7 @@ knife zero diagnose # show configuration from file
57
57
  Install Chef to remote node and run chef-client under chef-zero via tcp-forward.
58
58
 
59
59
  Supported options are mostly the same as `knife bootstrap`.
60
- And it supports why-run(`-W, --why-run`).
60
+ And it supports why-run(`-W, --why-run`)and Bootstrap without first Chef-Client Run.(--no-converge).
61
61
 
62
62
  #### Example
63
63
 
@@ -121,6 +121,60 @@ Bootstrap multi-nodes via GNU Parallel
121
121
  $ parallel -j 5 ./bin/knife zero bootstrap ::: nodeA nodeB nodeC...
122
122
  ```
123
123
 
124
+ #### (Hint)Supress Automatic Attributes
125
+
126
+ knife-zero supports appengding [whitelist-attributes](https://docs.chef.io/attributes.html#whitelist-attributes) to client.rb at bootstrap.
127
+
128
+ For example, set array to `knife.rb`.
129
+
130
+ ```
131
+ knife[:automatic_attribute_whitelist] = [
132
+ "fqdn/",
133
+ "ipaddress/",
134
+ "roles/",
135
+ "recipes/",
136
+ "ipaddress/",
137
+ "platform/",
138
+ "platform_version/",
139
+ "cloud/",
140
+ "cloud_v2/"
141
+ ]
142
+ ```
143
+
144
+ It setting will append to client.rb of node via bootstrap.
145
+
146
+ ```
147
+ ...
148
+
149
+ automatic_attribute_whitelist ["fqdn/", "ipaddress/", "roles/", "recipes/", "ipaddress/", "platform/", "platform_version/", "cloud/", "cloud_v2/"]
150
+ ```
151
+
152
+ It means knife-zero will collects and updates only listed attributes to local file.
153
+
154
+ ```
155
+ {
156
+ "name": "knife-zero.example.com",
157
+ "normal": {
158
+ "tags": [
159
+
160
+ ]
161
+ },
162
+ "automatic": {
163
+ "ipaddress": "xxx.xxx.xxx.xxx",
164
+ "roles": [
165
+
166
+ ],
167
+ "recipes": [
168
+
169
+ ],
170
+ "platform": "ubuntu",
171
+ "platform_version": "14.04",
172
+ "cloud_v2": null
173
+ }
174
+ }
175
+ ```
176
+
177
+
124
178
 
125
179
  ### knife zero converge/chef_client (for update)
126
180
 
@@ -19,10 +19,13 @@ class Chef
19
19
  self.options.delete :node_ssl_verify_mode
20
20
  self.options.delete :node_verify_api_cert
21
21
 
22
- option :without_chef_run,
23
- :long => "--without-chef-run",
22
+ option :bootstrap_converge,
23
+ :long => "--[no-]converge",
24
24
  :description => "Bootstrap without Chef-Client Run.(for only update client.rb)",
25
- :boolean => false
25
+ :boolean => true,
26
+ :default => true,
27
+ :proc => lambda { |v| Chef::Config[:knife][:bootstrap_converge] = v }
28
+
26
29
 
27
30
  def knife_ssh
28
31
  begin
@@ -32,7 +32,7 @@ class Chef
32
32
  alias :orig_start_chef start_chef
33
33
  def start_chef
34
34
  if @chef_config[:knife_zero]
35
- unless @config[:without_chef_run]
35
+ if @config[:bootstrap_converge]
36
36
  client_path = @chef_config[:chef_client_path] || 'chef-client'
37
37
  s = "#{client_path} -j /etc/chef/first-boot.json"
38
38
  s << ' -l debug' if @config[:verbosity] and @config[:verbosity] >= 2
@@ -41,7 +41,7 @@ class Chef
41
41
  s << " -W" if @config[:why_run]
42
42
  s
43
43
  else
44
- "echo Execution of Chef-Client has been canceled due to --without-chef-run."
44
+ "echo Execution of Chef-Client has been canceled due to bootstrap_converge if false."
45
45
  end
46
46
  else
47
47
  orig_start_chef
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Zero
3
- VERSION = "1.7.0"
3
+ VERSION = "1.7.1"
4
4
  MAJOR, MINOR, TINY = VERSION.split('.')
5
5
  end
6
6
  end
@@ -2,6 +2,6 @@ require "knife-zero/version"
2
2
 
3
3
  class TC_Version < Test::Unit::TestCase
4
4
  test "returns version correctly" do
5
- assert_equal("1.7.0", Knife::Zero::VERSION)
5
+ assert_equal("1.7.1", Knife::Zero::VERSION)
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawanoboly