chef-apply 0.5.3 → 0.5.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/bin/chef-run +1 -1
- data/chef-apply.gemspec +2 -2
- data/i18n/en.yml +2 -1
- data/i18n/errors/en.yml +5 -5
- data/lib/chef_apply/action/generate_local_policy.rb +1 -0
- data/lib/chef_apply/cli.rb +4 -4
- data/lib/chef_apply/cli/validation.rb +2 -0
- data/lib/chef_apply/startup.rb +7 -5
- data/lib/chef_apply/target_host.rb +2 -0
- data/lib/chef_apply/ui/error_printer.rb +1 -1
- data/lib/chef_apply/ui/plain_text_header.rb +0 -1
- data/lib/chef_apply/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40e1ef3f302762a273ab6fcdf15f0102bf0de5199d20cd22df2125a237551ab5
|
4
|
+
data.tar.gz: f65616505eed1c2afd0393b45709ad683c8372903790408a6c1020003122487a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72f59e61c72e8f8f470b392344e382193a2e51d977d9f9a8687ff9fa86563e2fdfe512bbd2d12d8fb418f5734b229a92b6947fc9a587e10df7630456d0229a47
|
7
|
+
data.tar.gz: ed03fd5cb7b9cbf2af42cf987a55e2821d8098989ee067f105a6af28413ab50d782c1824e8a5f2e79f43f54063b46a80b20a8b9597a081acded5a13044010317
|
data/Gemfile
CHANGED
data/bin/chef-run
CHANGED
data/chef-apply.gemspec
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
lib = File.expand_path("
|
18
|
+
lib = File.expand_path("lib", __dir__)
|
19
19
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
20
20
|
require "chef_apply/version"
|
21
21
|
|
@@ -54,5 +54,5 @@ Gem::Specification.new do |spec|
|
|
54
54
|
spec.add_dependency "chef-telemetry", ">= 1.0.2"
|
55
55
|
spec.add_dependency "license-acceptance", ">= 1.0.11", "< 3"
|
56
56
|
|
57
|
-
spec.post_install_message = File.read(File.expand_path("
|
57
|
+
spec.post_install_message = File.read(File.expand_path("warning.txt", __dir__))
|
58
58
|
end
|
data/i18n/en.yml
CHANGED
@@ -28,7 +28,7 @@ cli:
|
|
28
28
|
enabled=false
|
29
29
|
|
30
30
|
For more information about what we data gather and additional opt-out
|
31
|
-
options, visit https://chef.
|
31
|
+
options, visit https://docs.chef.io/workstation/privacy/
|
32
32
|
|
33
33
|
description: |
|
34
34
|
Chef Run is a tool to execute ad-hoc tasks using Chef.
|
@@ -113,6 +113,7 @@ cli:
|
|
113
113
|
cookbook is found we run the default recipe.
|
114
114
|
3. This behaves similarly to 'cookbook name' above, but it also allows
|
115
115
|
you to specify which recipe to use from the cookbook.
|
116
|
+
Usage: cookbookname::recipename
|
116
117
|
error:
|
117
118
|
bad_config_file: |
|
118
119
|
|
data/i18n/errors/en.yml
CHANGED
@@ -146,7 +146,7 @@ errors:
|
|
146
146
|
For more information, please consult the documentation
|
147
147
|
for this resource:
|
148
148
|
|
149
|
-
https://docs.chef.io/
|
149
|
+
https://docs.chef.io/resources/
|
150
150
|
|
151
151
|
CHEFCCR004:
|
152
152
|
text: |
|
@@ -157,7 +157,7 @@ errors:
|
|
157
157
|
Please consult the documentation for properties
|
158
158
|
supported by your resource and their valid values:
|
159
159
|
|
160
|
-
https://docs.chef.io/
|
160
|
+
https://docs.chef.io/resources/
|
161
161
|
|
162
162
|
CHEFCCR005:
|
163
163
|
text: |
|
@@ -165,7 +165,7 @@ errors:
|
|
165
165
|
|
166
166
|
Please consult the documentation for a list of valid resources:
|
167
167
|
|
168
|
-
https://docs.chef.io/
|
168
|
+
https://docs.chef.io/resources/
|
169
169
|
|
170
170
|
CHEFCCR006:
|
171
171
|
text: |
|
@@ -174,7 +174,7 @@ errors:
|
|
174
174
|
Please consult the documentation for %2 for a list of
|
175
175
|
valid properties:
|
176
176
|
|
177
|
-
https://docs.chef.io/
|
177
|
+
https://docs.chef.io/resources/
|
178
178
|
|
179
179
|
CHEFCCR099:
|
180
180
|
text: |
|
@@ -246,7 +246,7 @@ errors:
|
|
246
246
|
|
247
247
|
Additional instructions can be found in the troubleshooting documentation:
|
248
248
|
|
249
|
-
https://
|
249
|
+
https://docs.chef.io/workstation/troubleshooting/#cheftrn007
|
250
250
|
|
251
251
|
CHEFTRN999:
|
252
252
|
text: |
|
data/lib/chef_apply/cli.rb
CHANGED
@@ -63,14 +63,14 @@ module ChefApply
|
|
63
63
|
super()
|
64
64
|
end
|
65
65
|
|
66
|
-
def run
|
66
|
+
def run(enforce_license: false)
|
67
67
|
# Perform a timing and capture of the run. Individual methods and actions may perform
|
68
68
|
# nested Chef::Telemeter.timed_*_capture or Chef::Telemeter.capture calls in their operation, and
|
69
69
|
# they will be captured in the same telemetry session.
|
70
70
|
|
71
71
|
Chef::Telemeter.timed_run_capture([:redacted]) do
|
72
72
|
begin
|
73
|
-
perform_run
|
73
|
+
perform_run(enforce_license: enforce_license)
|
74
74
|
rescue Exception => e
|
75
75
|
@rc = handle_run_error(e)
|
76
76
|
end
|
@@ -100,14 +100,14 @@ module ChefApply
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
def perform_run
|
103
|
+
def perform_run(enforce_license: false)
|
104
104
|
parse_options(@argv)
|
105
105
|
if @argv.empty? || parsed_options[:help]
|
106
106
|
show_help
|
107
107
|
elsif parsed_options[:version]
|
108
108
|
show_version
|
109
109
|
else
|
110
|
-
check_license_acceptance
|
110
|
+
check_license_acceptance if enforce_license
|
111
111
|
validate_params(cli_arguments)
|
112
112
|
target_hosts = resolve_targets(cli_arguments.shift, parsed_options)
|
113
113
|
render_cookbook_setup(cli_arguments)
|
data/lib/chef_apply/startup.rb
CHANGED
@@ -33,7 +33,7 @@ module ChefApply
|
|
33
33
|
init_terminal
|
34
34
|
end
|
35
35
|
|
36
|
-
def run
|
36
|
+
def run(enforce_license: false)
|
37
37
|
# This component is not supported in ChefDK; an exception will be raised
|
38
38
|
# if running in that context.
|
39
39
|
verify_not_in_chefdk
|
@@ -62,7 +62,7 @@ module ChefApply
|
|
62
62
|
start_telemeter_upload
|
63
63
|
|
64
64
|
# Launch the actual Chef Apply behavior
|
65
|
-
start_chef_apply
|
65
|
+
start_chef_apply(enforce_license: enforce_license)
|
66
66
|
|
67
67
|
# NOTE: Because these exceptions occur outside of the
|
68
68
|
# CLI handling, they won't be tracked in telemtry.
|
@@ -194,24 +194,26 @@ module ChefApply
|
|
194
194
|
Chef::Log.level = ChefApply::Log.level
|
195
195
|
end
|
196
196
|
|
197
|
-
def start_chef_apply
|
197
|
+
def start_chef_apply(enforce_license: false)
|
198
198
|
require_relative "cli"
|
199
|
-
ChefApply::CLI.new(@argv).run
|
199
|
+
ChefApply::CLI.new(@argv).run(enforce_license: enforce_license)
|
200
200
|
end
|
201
201
|
|
202
202
|
private
|
203
203
|
|
204
204
|
def script_path
|
205
|
-
|
205
|
+
__dir__
|
206
206
|
end
|
207
207
|
|
208
208
|
class ConfigPathNotProvided < StandardError; end
|
209
|
+
|
209
210
|
class ConfigPathInvalid < StandardError
|
210
211
|
attr_reader :path
|
211
212
|
def initialize(path)
|
212
213
|
@path = path
|
213
214
|
end
|
214
215
|
end
|
216
|
+
|
215
217
|
class UnsupportedInstallation < StandardError; end
|
216
218
|
end
|
217
219
|
end
|
@@ -323,7 +323,9 @@ module ChefApply
|
|
323
323
|
super(*(Array(init_params).flatten))
|
324
324
|
end
|
325
325
|
end
|
326
|
+
|
326
327
|
class ChefNotInstalled < StandardError; end
|
328
|
+
|
327
329
|
class UnsupportedTargetOS < ChefApply::ErrorNoLogs
|
328
330
|
def initialize(os_name); super("CHEFTARG001", os_name); end
|
329
331
|
end
|
data/lib/chef_apply/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-apply
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|
@@ -287,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
287
|
- !ruby/object:Gem::Version
|
288
288
|
version: '0'
|
289
289
|
requirements: []
|
290
|
-
rubygems_version: 3.
|
290
|
+
rubygems_version: 3.1.4
|
291
291
|
signing_key:
|
292
292
|
specification_version: 4
|
293
293
|
summary: The ad-hoc execution tool for the Chef ecosystem.
|