knife-zero 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/knife/zero_chef_client.rb +6 -42
- data/lib/chef/knife/zero_converge.rb +45 -4
- data/lib/knife-zero/version.rb +1 -1
- data/test/knife-zero/test_versioin.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3c54264c03d55412eecd072c0b7383b12f8bead
|
4
|
+
data.tar.gz: f392fdc368ee1035a433e59a2166e586523c6630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f96d14bcb72c719a9cf1f0dea34784b828424779425568902edda23e724dd680abad35226c858443d17e34372bc5c45d5397d4e72882c755934d10d4282ca8ec
|
7
|
+
data.tar.gz: 28cf727c4bf98d683f3661cec5e3e5df92b75c8001b16d746b341d0ea708c1f3af618a5349494bf0d1964222a889be9bfa41fa03e4deae01575e338fbe1402a6
|
@@ -1,55 +1,19 @@
|
|
1
1
|
require 'chef/knife'
|
2
|
-
require 'chef/knife/
|
3
|
-
require 'knife-zero/bootstrap_ssh'
|
2
|
+
require 'chef/knife/zero_converge'
|
4
3
|
|
5
4
|
class Chef
|
6
5
|
class Knife
|
7
|
-
class ZeroChefClient < Chef::Knife::
|
8
|
-
include Chef::Knife::ZeroBase
|
6
|
+
class ZeroChefClient < Chef::Knife::ZeroConverge
|
9
7
|
deps do
|
10
|
-
|
11
|
-
Chef::Knife::BootstrapSsh.load_deps
|
12
|
-
require "knife-zero/helper"
|
8
|
+
Chef::Knife::ZeroConverge.load_deps
|
13
9
|
end
|
14
10
|
|
15
11
|
banner "knife zero chef_client QUERY (options) | It's same as converge"
|
12
|
+
self.options = ZeroConverge.options
|
16
13
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
option :use_sudo,
|
22
|
-
:long => "--[no-]sudo",
|
23
|
-
:description => "Execute the chef-client via sudo (true by default)",
|
24
|
-
:boolean => true,
|
25
|
-
:default => true,
|
26
|
-
:proc => lambda { |v| Chef::Config[:knife][:use_sudo] = v }
|
27
|
-
|
28
|
-
|
29
|
-
option :override_runlist,
|
30
|
-
:short => "-o RunlistItem,RunlistItem...",
|
31
|
-
:long => "--override-runlist RunlistItem,RunlistItem...",
|
32
|
-
:description => "Replace current run list with specified items for a single run. It skips save node.json on local",
|
33
|
-
:default => nil,
|
34
|
-
:proc => lambda { |o| o.to_s }
|
35
|
-
|
36
|
-
|
37
|
-
def initialize(argv=[])
|
14
|
+
def run
|
15
|
+
Chef::Log.warn "`zero chef_client` was renamed. use `zero converge`."
|
38
16
|
super
|
39
|
-
self.configure_chef
|
40
|
-
@name_args = [@name_args[0], start_chef_client]
|
41
|
-
end
|
42
|
-
|
43
|
-
def start_chef_client
|
44
|
-
client_path = @config[:use_sudo] || Chef::Config[:knife][:use_sudo] ? 'sudo ' : ''
|
45
|
-
client_path = @config[:chef_client_path] ? "#{client_path}#{@config[:chef_client_path]}" : "#{client_path}chef-client"
|
46
|
-
s = "#{client_path}"
|
47
|
-
s << ' -l debug' if @config[:verbosity] and @config[:verbosity] >= 2
|
48
|
-
s << " -S http://127.0.0.1:#{::Knife::Zero::Helper.zero_remote_port}"
|
49
|
-
s << " -o #{@config[:override_runlist]}" if @config[:override_runlist]
|
50
|
-
s << " -W" if @config[:why_run]
|
51
|
-
Chef::Log.info "Remote command: " + s
|
52
|
-
s
|
53
17
|
end
|
54
18
|
end
|
55
19
|
end
|
@@ -1,15 +1,56 @@
|
|
1
1
|
require 'chef/knife'
|
2
|
-
require 'chef/knife/
|
2
|
+
require 'chef/knife/zero_base'
|
3
|
+
require 'knife-zero/bootstrap_ssh'
|
3
4
|
|
4
5
|
class Chef
|
5
6
|
class Knife
|
6
|
-
class ZeroConverge < Chef::Knife::
|
7
|
+
class ZeroConverge < Chef::Knife::BootstrapSsh
|
8
|
+
include Chef::Knife::ZeroBase
|
7
9
|
deps do
|
8
|
-
|
10
|
+
require 'chef/run_list/run_list_item'
|
11
|
+
Chef::Knife::BootstrapSsh.load_deps
|
12
|
+
require "knife-zero/helper"
|
9
13
|
end
|
10
14
|
|
11
15
|
banner "knife zero converge QUERY (options)"
|
12
|
-
|
16
|
+
|
17
|
+
self.options = Ssh.options.merge(self.options)
|
18
|
+
self.options[:use_sudo_password] = Bootstrap.options[:use_sudo_password]
|
19
|
+
|
20
|
+
|
21
|
+
option :use_sudo,
|
22
|
+
:long => "--[no-]sudo",
|
23
|
+
:description => "Execute the chef-client via sudo (true by default)",
|
24
|
+
:boolean => true,
|
25
|
+
:default => true,
|
26
|
+
:proc => lambda { |v| Chef::Config[:knife][:use_sudo] = v }
|
27
|
+
|
28
|
+
|
29
|
+
option :override_runlist,
|
30
|
+
:short => "-o RunlistItem,RunlistItem...",
|
31
|
+
:long => "--override-runlist RunlistItem,RunlistItem...",
|
32
|
+
:description => "Replace current run list with specified items for a single run. It skips save node.json on local",
|
33
|
+
:default => nil,
|
34
|
+
:proc => lambda { |o| o.to_s }
|
35
|
+
|
36
|
+
|
37
|
+
def initialize(argv=[])
|
38
|
+
super
|
39
|
+
self.configure_chef
|
40
|
+
@name_args = [@name_args[0], start_chef_client]
|
41
|
+
end
|
42
|
+
|
43
|
+
def start_chef_client
|
44
|
+
client_path = @config[:use_sudo] || Chef::Config[:knife][:use_sudo] ? 'sudo ' : ''
|
45
|
+
client_path = @config[:chef_client_path] ? "#{client_path}#{@config[:chef_client_path]}" : "#{client_path}chef-client"
|
46
|
+
s = "#{client_path}"
|
47
|
+
s << ' -l debug' if @config[:verbosity] and @config[:verbosity] >= 2
|
48
|
+
s << " -S http://127.0.0.1:#{::Knife::Zero::Helper.zero_remote_port}"
|
49
|
+
s << " -o #{@config[:override_runlist]}" if @config[:override_runlist]
|
50
|
+
s << " -W" if @config[:why_run]
|
51
|
+
Chef::Log.info "Remote command: " + s
|
52
|
+
s
|
53
|
+
end
|
13
54
|
end
|
14
55
|
end
|
15
56
|
end
|
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.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawanoboly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|