knife-zero 1.7.1 → 1.8.0

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: a664f1782d8cc36553ad2e5269d10080805568a2
4
- data.tar.gz: 44fd1e97f0d4a800980e58bfc465ec45592f4309
3
+ metadata.gz: bdf0989e9de6228b25f20b31a9ec5d39255360d6
4
+ data.tar.gz: e6c149cefe11911ff06ab5e2b5f03e114ab69d06
5
5
  SHA512:
6
- metadata.gz: d6ef45236ae82c085aa05011cca60505710663c7cb6df5eb7b274dd29e01c5c9d542da3e3fa4ea0c2c1db941a23b33ac38a19faa371571a9a5800df2ae1b065e
7
- data.tar.gz: c8d52756ad5cfc23585bf306d13589387910063f32e5d96da1bc21103e3ec28e5164470407ec8e7c44fcf885a8457070f2697fc189836c679f2d2c960ed7dc5a
6
+ metadata.gz: e902a417918ddd8eb00c2461c75f7b68e69034ff4375224a1fb10fd3f03fb4f7db211d64d3d49bd99be6b40855744e8ed4d3c40344523932cbe4e078ad502e10
7
+ data.tar.gz: 19f63fd413efba43e48ddd10189046ffda6ea4b506063df448a0d8514274c00f9fcf29d3f90f7ae557e7b5b2656b23ac552b7ba5054fc9ba7857fe92b2bc4816
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v1.8.0
6
+
7
+ - Feature: set bootstraped host to knife_zero.host attribute(normal) #57
8
+
5
9
  ## v1.7.1
6
10
 
7
11
  - Misc: change option name from --without-chef-run to --[no-]converge #25
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 if false."
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
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Zero
3
- VERSION = "1.7.1"
3
+ VERSION = "1.8.0"
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.1", Knife::Zero::VERSION)
5
+ assert_equal("1.8.0", Knife::Zero::VERSION)
6
6
  end
7
7
  end
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.7.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-06-14 00:00:00.000000000 Z
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.6
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