knife-zero 1.7.0 → 1.7.1
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/CHANGELOG.md +4 -0
- data/README.md +55 -1
- data/lib/chef/knife/zero_bootstrap.rb +6 -3
- data/lib/knife-zero/core/bootstrap_context.rb +2 -2
- data/lib/knife-zero/version.rb +1 -1
- data/test/knife-zero/test_versioin.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a664f1782d8cc36553ad2e5269d10080805568a2
|
4
|
+
data.tar.gz: 44fd1e97f0d4a800980e58bfc465ec45592f4309
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6ef45236ae82c085aa05011cca60505710663c7cb6df5eb7b274dd29e01c5c9d542da3e3fa4ea0c2c1db941a23b33ac38a19faa371571a9a5800df2ae1b065e
|
7
|
+
data.tar.gz: c8d52756ad5cfc23585bf306d13589387910063f32e5d96da1bc21103e3ec28e5164470407ec8e7c44fcf885a8457070f2697fc189836c679f2d2c960ed7dc5a
|
data/CHANGELOG.md
CHANGED
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 :
|
23
|
-
:long => "--
|
22
|
+
option :bootstrap_converge,
|
23
|
+
:long => "--[no-]converge",
|
24
24
|
:description => "Bootstrap without Chef-Client Run.(for only update client.rb)",
|
25
|
-
:boolean =>
|
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
|
-
|
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
|
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
|
data/lib/knife-zero/version.rb
CHANGED