knife-zero 2.1.0 → 2.2.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: 7f1cd2562eb42faa227a762c0fae1ab59bb7f5c0c357e6c53b75d4c35546fc3b
4
- data.tar.gz: be6e7409ad03494cb2fd204f788221331bb7cef7e3054fe7e910c4da1b45773e
3
+ metadata.gz: 0d05862dc7246e728f58b0bda336b60417415d10668a16fad81c7efc0ee5cd61
4
+ data.tar.gz: 87ba092f340f8ffcdd95202cfa217138cb9acd06ed31b7601ffc4151a835997c
5
5
  SHA512:
6
- metadata.gz: 34644654c493967891415dceb6f88ec0bb437b4abebbb540121969aa2e992d81877270d3a372cff002d8e8556666c24cbf4c5405e8822167d47d7142d0779cc2
7
- data.tar.gz: 7453c885179051ad941aad30c214f1d5b0bf2b50b42276b92a251560ca63f831fe7b16c568e2787f475908a689144e092a73dbec01cc1538ab6ae4376817df61
6
+ metadata.gz: b5e198e21398ade07a5bef9d11381a4900d886078748d155fc90d262bc540b24453dcc4985afc4d0d51de6e9185bce5a7471dd0666b67d01768a8662ce38015f
7
+ data.tar.gz: 9b38e4d64ef1a2e85bba7535ac23be86e1e9d805d637cbbc4026d579dd5e3b103ac00a1320d7d2da99022081a637ceada9b476ff7260da47a4064fb7bce90308
@@ -4,6 +4,15 @@
4
4
 
5
5
  none.
6
6
 
7
+ ## v2.2.0
8
+
9
+ - add `--alter-project` to support cinc [#133]
10
+ - allowed values: 'chef' or 'cinc'
11
+ - in config => `knife[:alter_project]`
12
+ - relocate `--node-config` option from `zero converge` to both `zero converge` and `zero bootstrap`.
13
+ - remove `-N` for `--node-config` short option.
14
+ - (Duplicate with NAME option)
15
+
7
16
  ## v2.1.0
8
17
 
9
18
  - Allow pass run-list and environments from json-attributes.
data/README.md CHANGED
@@ -50,7 +50,7 @@ knife zero diagnose # show configuration from file
50
50
 
51
51
  ### Configuration file
52
52
 
53
- Relocated: [Configration | Knife-Zero Document](http://knife-zero.github.io/40_configuration/)
53
+ Relocated: [Configuration | Knife-Zero Document](http://knife-zero.github.io/40_configuration/)
54
54
 
55
55
  ### knife zero bootstrap | converge | diagnose
56
56
 
@@ -60,9 +60,9 @@ Relocated
60
60
  - [Subcommands | Knife-Zero Document](http://knife-zero.github.io/30_subcommands/)
61
61
 
62
62
 
63
- #### (Hint)Supress Automatic Attributes
63
+ #### (Hint)Suppress Automatic Attributes
64
64
 
65
- Relocated: [Configration | Knife-Zero Document](http://knife-zero.github.io/40_configration/)
65
+ Relocated: [Configuration | Knife-Zero Document](http://knife-zero.github.io/40_configuration/)
66
66
 
67
67
 
68
68
  ## To include from other knife plugins
@@ -28,6 +28,19 @@ class Chef
28
28
  description: 'Listen port on remote',
29
29
  default: nil,
30
30
  proc: proc { |key| Chef::Config[:remote_chef_zero_port] = key.to_i }
31
+
32
+ option :alter_project,
33
+ long: '--alter-project PROJECT',
34
+ proc: proc { |u| Chef::Config[:alter_project] = u },
35
+ description: 'Products used on remote nodes',
36
+ default: 'chef',
37
+ in: %w{chef cinc}
38
+
39
+ option :node_config_file,
40
+ long: '--node-config PATH_TO_CONFIG',
41
+ proc: proc { |u| Chef::Config[:node_config_file] = u },
42
+ description: 'The configuration file to use on remote node',
43
+ default: '/etc/chef/client.rb'
31
44
  end
32
45
  end
33
46
 
@@ -54,6 +54,11 @@ class Chef
54
54
  )
55
55
  end
56
56
 
57
+ case @config[:alter_project]
58
+ when 'cinc'
59
+ Chef::Config[:knife][:bootstrap_url] = 'https://omnitruck.cinc.sh/install.sh'
60
+ end
61
+
57
62
  if @config[:bootstrap_converge]
58
63
  unless @config[:overwrite_node_object]
59
64
  q = Chef::Search::Query.new
@@ -36,11 +36,6 @@ class Chef
36
36
  self.options[:skip_cookbook_sync] = Chef::Application::Client.options[:skip_cookbook_sync]
37
37
  end
38
38
 
39
- option :node_config_file,
40
- short: '-N PATH_TO_CONFIG',
41
- long: '--node-config PATH_TO_CONFIG',
42
- description: 'The configuration file to use on remote node'
43
-
44
39
  option :splay,
45
40
  long: '--splay SECONDS',
46
41
  description: 'The splay time for running at intervals, in seconds',
@@ -124,7 +119,7 @@ class Chef
124
119
  s << ' -j /etc/chef/chef_client_json.json' if @config[:json_attribs]
125
120
  s << " --splay #{@config[:splay]}" if @config[:splay]
126
121
  s << " -n #{@config[:named_run_list]}" if @config[:named_run_list]
127
- s << " --config #{@config[:node_config_file]}" if @config[:node_config_file]
122
+ s << " --config #{@config[:node_config_file]}"
128
123
  s << ' --skip-cookbook-sync' if @config[:skip_cookbook_sync]
129
124
  s << ' --no-color' unless @config[:color]
130
125
  s << " -E #{@config[:environment]}" if @config[:environment]
@@ -11,7 +11,12 @@ class Chef
11
11
 
12
12
  def ssh_command(command, subsession = nil) # rubocop:disable Metrics/PerceivedComplexity, Metrics/AbcSize, Metrics/CyclomaticComplexity
13
13
  if config[:client_version]
14
- super(%{/opt/chef/embedded/bin/ruby -ropen-uri -e 'puts open("https://omnitruck.chef.io/install.sh").read' | sudo sh -s -- -v #{config[:client_version]}})
14
+ case @config[:alter_project]
15
+ when 'cinc'
16
+ super(%{/opt/cinc/embedded/bin/ruby -ropen-uri -e 'puts open("https://omnitruck.cinc.sh/install.sh").read' | sudo sh -s -- -v #{config[:client_version]}})
17
+ else
18
+ super(%{/opt/chef/embedded/bin/ruby -ropen-uri -e 'puts open("https://omnitruck.chef.io/chef/install.sh").read' | sudo sh -s -- -v #{config[:client_version]}})
19
+ end
15
20
  end
16
21
 
17
22
  if config[:json_attribs]
@@ -52,6 +52,7 @@ class Chef
52
52
  client_path = @chef_config[:chef_client_path] || 'chef-client'
53
53
  s = String.new("#{client_path} -j /etc/chef/first-boot.json")
54
54
  s << ' -l debug' if @config[:verbosity] && @config[:verbosity] >= 2
55
+ s << " --config #{@config[:node_config_file]}"
55
56
  s << " -E #{bootstrap_environment}" unless bootstrap_environment.nil?
56
57
  s << " -S http://127.0.0.1:#{::Knife::Zero::Helper.zero_remote_port}"
57
58
  s << ' -W' if @config[:why_run]
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Zero
3
- VERSION = '2.1.0'.freeze
3
+ VERSION = '2.2.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.1.0
4
+ version: 2.2.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-09-27 00:00:00.000000000 Z
11
+ date: 2019-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
- rubygems_version: 2.7.6
196
+ rubygems_version: 2.7.6.2
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Run chef-client at remote node with chef-zero(local-mode) via HTTP over SSH