knife-zero 1.7.1 → 1.8.0
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 +28 -0
- data/lib/chef/knife/zero_bootstrap.rb +12 -0
- data/lib/knife-zero/core/bootstrap_context.rb +1 -1
- data/lib/knife-zero/version.rb +1 -1
- data/test/knife-zero/test_versioin.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdf0989e9de6228b25f20b31a9ec5d39255360d6
|
4
|
+
data.tar.gz: e6c149cefe11911ff06ab5e2b5f03e114ab69d06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e902a417918ddd8eb00c2461c75f7b68e69034ff4375224a1fb10fd3f03fb4f7db211d64d3d49bd99be6b40855744e8ed4d3c40344523932cbe4e078ad502e10
|
7
|
+
data.tar.gz: 19f63fd413efba43e48ddd10189046ffda6ea4b506063df448a0d8514274c00f9fcf29d3f90f7ae557e7b5b2656b23ac552b7ba5054fc9ba7857fe92b2bc4816
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -16,6 +16,8 @@ Run chef-client at remote node with chef-zero(local-mode) via HTTP over SSH port
|
|
16
16
|
- It supports all functions of chef(C/S).
|
17
17
|
- You have only to manage one chef-repo.
|
18
18
|
|
19
|
+
[Knife-Zero Document](http://higanworks.com/knife-zero/)(WIP)
|
20
|
+
|
19
21
|
## Requirements
|
20
22
|
|
21
23
|
- Must support AllowTcpForward
|
@@ -52,6 +54,18 @@ knife zero converge QUERY (options)
|
|
52
54
|
knife zero diagnose # show configuration from file
|
53
55
|
```
|
54
56
|
|
57
|
+
### Configuration file
|
58
|
+
|
59
|
+
You need to make sure the knife.rb file in your chef-repo (in the chef-repo root or .chef directory) is adapted to use chef-zero.
|
60
|
+
|
61
|
+
For example, at `.chef/knife.rb`. At least the following contents are needed:
|
62
|
+
```
|
63
|
+
chef_repo_path File.expand_path('../../' , __FILE__)
|
64
|
+
cookbook_path [File.expand_path('../../cookbooks' , __FILE__), File.expand_path('../../site-cookbooks' , __FILE__)]
|
65
|
+
```
|
66
|
+
|
67
|
+
If you used knife serve or knife zero, this makes sure chef-zero is started with the contents of the chef-repo directory instead of as an empty server.
|
68
|
+
|
55
69
|
### knife zero bootstrap
|
56
70
|
|
57
71
|
Install Chef to remote node and run chef-client under chef-zero via tcp-forward.
|
@@ -456,6 +470,20 @@ Zero ChefClient Config
|
|
456
470
|
```
|
457
471
|
|
458
472
|
|
473
|
+
## To include from other knife plugins
|
474
|
+
|
475
|
+
If you want to integrate knife-zero on machine creation with cloud plugins, you can add zerobootstrap to deps like below.
|
476
|
+
|
477
|
+
```
|
478
|
+
deps do
|
479
|
+
require 'chef/knife/zerobootstrap'
|
480
|
+
Chef::Knife::ZeroBootstrap.load_deps
|
481
|
+
self.options = Chef::Knife::ZeroBootstrap.options.merge(self.options)
|
482
|
+
end
|
483
|
+
```
|
484
|
+
|
485
|
+
For example, [knife-digital_ocean](https://github.com/higanworks/knife-digital_ocean/blob/79_merge_zero_bootstrap_options/lib/chef/knife/digital_ocean_droplet_create.rb)
|
486
|
+
|
459
487
|
## Contributing
|
460
488
|
|
461
489
|
1. Fork it ( https://github.com/[my-github-username]/knife-zero/fork )
|
@@ -26,6 +26,10 @@ class Chef
|
|
26
26
|
:default => true,
|
27
27
|
:proc => lambda { |v| Chef::Config[:knife][:bootstrap_converge] = v }
|
28
28
|
|
29
|
+
def run
|
30
|
+
@config[:first_boot_attributes] = @config[:first_boot_attributes].merge(build_knifezero_attributes_for_node)
|
31
|
+
super
|
32
|
+
end
|
29
33
|
|
30
34
|
def knife_ssh
|
31
35
|
begin
|
@@ -49,6 +53,14 @@ class Chef
|
|
49
53
|
exit 1
|
50
54
|
end
|
51
55
|
end
|
56
|
+
|
57
|
+
def build_knifezero_attributes_for_node
|
58
|
+
attr = Mash.new
|
59
|
+
attr[:knife_zero] = {
|
60
|
+
host: server_name
|
61
|
+
}
|
62
|
+
attr
|
63
|
+
end
|
52
64
|
end
|
53
65
|
end
|
54
66
|
end
|
@@ -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 bootstrap_converge
|
44
|
+
"echo Execution of Chef-Client has been canceled due to bootstrap_converge is false."
|
45
45
|
end
|
46
46
|
else
|
47
47
|
orig_start_chef
|
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.8.0
|
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-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
210
|
rubyforge_project:
|
211
|
-
rubygems_version: 2.4.
|
211
|
+
rubygems_version: 2.4.8
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: Run chef-client at remote node with chef-zero(local-mode) via HTTP over SSH
|