knife-zero 2.0.0.rc1 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e95f3c1de4d14fab19d32c3b3654efeaa17565815efe0a54c21db5db118e1e6
4
- data.tar.gz: a84cc6bbc4ec236c8d043d4ebeb95f4cab208d3b0b42108c51f58683a38eb674
3
+ metadata.gz: 28702dd9c432d13e8dbd122ab8e4fe98451181d28f814f166ca863e8679d9a0e
4
+ data.tar.gz: e8f3fe9460bde789dd575e382d2369d5df15ede8ce848045efa29f4a76216e9b
5
5
  SHA512:
6
- metadata.gz: 895dfe7c70f06142c67300659e7ae563494833c68aad69f2f18dc5021967958fc3bbca1834e95206827a28b250a7aa0bf604e95cf98793d71c24a23ff9e20d5b
7
- data.tar.gz: 5aeaf0628f3878a490dfb624223673f44b16edabcfb0c4b8e9caee5ace7b99090fa920ddb5e4877948c3aa777ad83c0eaa8a3f8f928f7a1f1c30a157acda8cd1
6
+ metadata.gz: b07d56e44c7eee303904307d7631e66dde820a98d04b05a5898a3de051d0e336a0f42aa0ea11c6a1d480e55cb17de5be641cb7dbbc1427c565398d3aba02aff3
7
+ data.tar.gz: c235442c8f1268305091a90dc59eec2c8b80930e6a0bc0da890a03796c7c2378855df272a4a8e462ed32ee09e014fcc279b80467ffda4e3cf1ed8be46a338dcf
@@ -8,6 +8,7 @@
8
8
  - Support bootstrap changes on Chef Infra Client 15.x
9
9
  - without Windows
10
10
  - drop support chef-client < 15
11
+ - add `--connection-user`, `--connection-password`, `--connection-port` options for converge, apply subcommand as wrapper.
11
12
 
12
13
  ## v1.19.3
13
14
 
data/README.md CHANGED
@@ -24,6 +24,14 @@ Run chef-client at remote node with chef-zero(local-mode) via HTTP over SSH port
24
24
  - Ruby 2.5 or later
25
25
  - Must support AllowTcpForward
26
26
 
27
+ ### 2.0.0 or later
28
+
29
+ - Chef Infra Client 15.x for bootstraping.
30
+
31
+ ### 1.x
32
+
33
+ - Chef < 15.0
34
+
27
35
  ## Installation
28
36
 
29
37
  Relocated: [Installation | Knife-Zero Document](http://knife-zero.github.io/10_install/)
@@ -35,6 +35,23 @@ class Chef
35
35
  self.options[:json_attribs] = Chef::Application::Apply.options[:json_attribs]
36
36
  self.options[:json_attribs][:description] = 'Load attributes from a JSON file or URL (retrieves from the remote node)'
37
37
 
38
+ # Common connectivity options for compatibility
39
+ option :connection_user,
40
+ short: '-U USERNAME',
41
+ long: '--connection-user USERNAME',
42
+ description: 'Authenticate to the target host with this user account. (same as --ssh-user)',
43
+ proc: lambda { |v| Chef::Config[:knife][:ssh_user] = v }
44
+
45
+ option :connection_password,
46
+ long: '--connection-password PASSWORD',
47
+ description: 'Authenticate to the target host with this password. (same as --ssh-password)',
48
+ proc: lambda { |v| Chef::Config[:knife][:ssh_password_ng] = v }
49
+
50
+ option :connection_port,
51
+ long: '--connection-port PORT',
52
+ description: 'The port on the target node to connect to. (same as --ssh-port)',
53
+ proc: lambda { |v| Chef::Config[:knife][:ssh_port] = v }
54
+
38
55
  def initialize(argv = [])
39
56
  super
40
57
  self.configure_chef
@@ -1,6 +1,6 @@
1
1
  require 'chef'
2
2
  require 'chef/knife/ssh'
3
- require 'chef/knife/bootstrap'
3
+ require 'chef/knife/bootstrap' unless Chef::Knife.const_defined?(:Bootstrap)
4
4
 
5
5
  class Chef
6
6
  class Knife
@@ -1,5 +1,4 @@
1
1
  require 'chef/knife'
2
- require 'chef/knife/bootstrap'
3
2
  require 'chef/knife/zero_base'
4
3
 
5
4
  class Chef
@@ -60,7 +59,7 @@ class Chef
60
59
  q = Chef::Search::Query.new
61
60
  node_name = resolve_node_name
62
61
  result = q.search(:node, "name:#{node_name} OR knife_zero_host:#{node_name}")
63
- if result.last > 0
62
+ if result.last.positive?
64
63
  ui.warn(%{Node "#{node_name}" already exist. [Found #{result.last} Node(s) in local search.] (You can skip asking with --overwrite option.)})
65
64
  if result.last == 1
66
65
  ui.confirm(%{Overwrite it }, true, false)
@@ -73,6 +73,23 @@ class Chef
73
73
  end
74
74
  }
75
75
 
76
+ # Common connectivity options for compatibility
77
+ option :connection_user,
78
+ short: '-U USERNAME',
79
+ long: '--connection-user USERNAME',
80
+ description: 'Authenticate to the target host with this user account. (same as --ssh-user)',
81
+ proc: lambda { |v| Chef::Config[:knife][:ssh_user] = v }
82
+
83
+ option :connection_password,
84
+ long: '--connection-password PASSWORD',
85
+ description: 'Authenticate to the target host with this password. (same as --ssh-password)',
86
+ proc: lambda { |v| Chef::Config[:knife][:ssh_password_ng] = v }
87
+
88
+ option :connection_port,
89
+ long: '--connection-port PORT',
90
+ description: 'The port on the target node to connect to. (same as --ssh-port)',
91
+ proc: lambda { |v| Chef::Config[:knife][:ssh_port] = v }
92
+
76
93
  def initialize(argv = [])
77
94
  super
78
95
  self.configure_chef
@@ -1,5 +1,4 @@
1
1
  require 'chef/knife'
2
- require 'chef/knife/bootstrap'
3
2
  require 'chef/knife/zero_base'
4
3
 
5
4
  class Chef
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Zero
3
- VERSION = '2.0.0.rc1'.freeze
3
+ VERSION = '2.0.0'.freeze
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: 2.0.0.rc1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawanoboly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-05 00:00:00.000000000 Z
11
+ date: 2019-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -188,9 +188,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
188
  version: 2.5.0
189
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - ">"
191
+ - - ">="
192
192
  - !ruby/object:Gem::Version
193
- version: 1.3.1
193
+ version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
196
  rubygems_version: 2.7.6