knife-zero 1.11.0 → 1.11.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: afd0f61fa28cf5503c87d00457cdbd3f0ca61fc2
4
- data.tar.gz: e5c765743125b15b55e529df1cfda77dc4a4f855
3
+ metadata.gz: acd069912d8b815db4d447a3d19dc88af0d6bdcc
4
+ data.tar.gz: 455e737d9d4554952467e27d9bbc746fbdece401
5
5
  SHA512:
6
- metadata.gz: 62e4ffbb9964256340c3bb1c8e9eddfdbc093cd020fa3725d5ad9192dc7e44997195c4598fb0a03c258c1fdc2b28f171f3c55e66983253129c63ddadcf17cbb0
7
- data.tar.gz: e2fff31c58c0e232396e76ad6a7f7937d777707f540b3b9ba634ca5f6f75975175ad9f9ee063f382ff36dbf33df8aff43334604f0920150554ef196c5eddae73
6
+ metadata.gz: 11a07ff246595ed09b7888e9dd00005c33c491f83bd79429803554afeaff1e295d8aff5ac5434dcb3ef353f55187495642e1fb4ada68b802856324e98119780c
7
+ data.tar.gz: e3279e6fb9437b96eb9238f749e2ce6edab7a0c49917794ecb6c2ad63ffd9da61a87b90983560cadc466a4b46fae45527bdd27abba45065b5825e4662826b975
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v1.11.1
6
+
7
+ - Feature: add before_hook
8
+ - before_bootstrap
9
+ - before_converge
10
+
5
11
  ## v1.11.0
6
12
 
7
13
  - Add dependency chef "~> 12.6.0"
data/README.md CHANGED
@@ -32,7 +32,7 @@ Relocated: [Installation | Knife-Zero Document](http://knife-zero.github.io/10_i
32
32
 
33
33
  ```
34
34
  ** ZERO COMMANDS **
35
- knife zero bootstrap FQDN (options)
35
+ knife zero bootstrap [SSH_USER@]FQDN (options)
36
36
  knife zero chef_client QUERY (options) | It's same as converge
37
37
  knife zero converge QUERY (options)
38
38
  knife zero diagnose # show configuration from file
@@ -32,6 +32,11 @@ class Chef
32
32
  :proc => lambda { |v| Chef::Config[:knife][:bootstrap_converge] = v }
33
33
 
34
34
  def run
35
+ ## Command hook before_bootstrap (After launched Chef-Zero)
36
+ if Chef::Config[:knife][:before_bootstrap]
37
+ ::Knife::Zero::Helper.hook_shell_out!("before_bootstrap", ui, Chef::Config[:knife][:before_bootstrap])
38
+ end
39
+
35
40
  if @config[:first_boot_attributes_from_file]
36
41
  @config[:first_boot_attributes_from_file] = @config[:first_boot_attributes_from_file].merge(build_knifezero_attributes_for_node)
37
42
  else
@@ -50,6 +50,12 @@ class Chef
50
50
  def initialize(argv=[])
51
51
  super
52
52
  self.configure_chef
53
+
54
+ ## Command hook before_converge (Before launched Chef-Zero)
55
+ if Chef::Config[:knife][:before_converge]
56
+ ::Knife::Zero::Helper.hook_shell_out!("before_converge", ui, Chef::Config[:knife][:before_converge])
57
+ end
58
+
53
59
  @name_args = [@name_args[0], start_chef_client]
54
60
  end
55
61
 
@@ -3,6 +3,9 @@ require 'open-uri'
3
3
  module Knife
4
4
  module Zero
5
5
  module Helper
6
+
7
+ extend Chef::Mixin::ShellOut
8
+
6
9
  def self.zero_remote_port
7
10
  return ::Chef::Config[:remote_chef_zero_port] if ::Chef::Config[:remote_chef_zero_port]
8
11
  chef_zero_port = ::Chef::Config[:chef_zero_port] ||
@@ -23,6 +26,16 @@ module Knife
23
26
  exit
24
27
  end
25
28
  end
29
+
30
+ def self.hook_shell_out!(event, ui, *command_args)
31
+ ui.info ui.color("Execute command hook in #{event}.", :green)
32
+ begin
33
+ ui.info shell_out!(*command_args).stdout
34
+ rescue => e
35
+ ui.error e.inspect
36
+ raise e
37
+ end
38
+ end
26
39
  end
27
40
  end
28
41
  end
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Zero
3
- VERSION = "1.11.0"
3
+ VERSION = "1.11.1"
4
4
  MAJOR, MINOR, TINY = VERSION.split('.')
5
5
  end
6
6
  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.11.0
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawanoboly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-31 00:00:00.000000000 Z
11
+ date: 2016-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -197,3 +197,4 @@ specification_version: 4
197
197
  summary: Run chef-client at remote node with chef-zero(local-mode) via HTTP over SSH
198
198
  port fowarding.
199
199
  test_files: []
200
+ has_rdoc: