bolt 2.27.0 → 2.28.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bolt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/bolt/applicator.rb +14 -14
- data/lib/bolt/bolt_option_parser.rb +32 -2
- data/lib/bolt/cli.rb +21 -17
- data/lib/bolt/inventory.rb +1 -1
- data/lib/bolt/transport/base.rb +4 -4
- data/lib/bolt/util.rb +10 -10
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_server/file_cache.rb +11 -11
- data/lib/bolt_spec/bolt_context.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03de2a7e4d6fa0b9d4120fff783ccb009665077c7b00e910f5e2de14c03a1767
|
4
|
+
data.tar.gz: 511e18c31228338f47519ee02a7b248f4d264b93516a58aa1b063a41bb835e80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1956edc3051eae34d25957c7827ce1e1f12bfc7e322d9305a79d9a2cb32cf144309413626cfb9db6667193a8853810dabf8d6004924ad3899633a220f34cecb7
|
7
|
+
data.tar.gz: af2e40875cb54c1e2b4153605ffc6abb6b11a65e2f0abcc30f7eb87701cb3c5c023905dc1709ff0bf7261e856ceaae29fad9df13e4b9b51b9f74a4ef65fb0b74
|
data/lib/bolt/applicator.rb
CHANGED
@@ -50,15 +50,15 @@ module Bolt
|
|
50
50
|
|
51
51
|
def catalog_apply_task
|
52
52
|
@catalog_apply_task ||= begin
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
53
|
+
path = File.join(libexec, 'apply_catalog.rb')
|
54
|
+
file = { 'name' => 'apply_catalog.rb', 'path' => path }
|
55
|
+
metadata = { 'supports_noop' => true, 'input_method' => 'stdin',
|
56
|
+
'implementations' => [
|
57
|
+
{ 'name' => 'apply_catalog.rb' },
|
58
|
+
{ 'name' => 'apply_catalog.rb', 'remote' => true }
|
59
|
+
] }
|
60
|
+
Bolt::Task.new('apply_helpers::apply_catalog', metadata, [file])
|
61
|
+
end
|
62
62
|
end
|
63
63
|
|
64
64
|
def query_resources_task
|
@@ -99,11 +99,11 @@ module Bolt
|
|
99
99
|
# see what happened
|
100
100
|
print_logs = stat.success?
|
101
101
|
result = begin
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
102
|
+
JSON.parse(out)
|
103
|
+
rescue JSON::ParserError
|
104
|
+
print_logs = true
|
105
|
+
{ 'message' => "Something's gone terribly wrong! STDERR is logged." }
|
106
|
+
end
|
107
107
|
|
108
108
|
# Any messages logged by Puppet will be on stderr as JSON hashes, so we
|
109
109
|
# parse those and store them here. Any message on stderr that is not
|
@@ -69,6 +69,12 @@ module Bolt
|
|
69
69
|
when 'install'
|
70
70
|
{ flags: OPTIONS[:global] + %w[configfile force project],
|
71
71
|
banner: MODULE_INSTALL_HELP }
|
72
|
+
when 'show'
|
73
|
+
{ flags: OPTIONS[:global] + OPTIONS[:global_config_setters],
|
74
|
+
banner: MODULE_SHOW_HELP }
|
75
|
+
when 'generate-types'
|
76
|
+
{ flags: OPTIONS[:global] + OPTIONS[:global_config_setters],
|
77
|
+
banner: MODULE_GENERATETYPES_HELP }
|
72
78
|
else
|
73
79
|
{ flags: OPTIONS[:global],
|
74
80
|
banner: MODULE_HELP }
|
@@ -358,10 +364,12 @@ module Bolt
|
|
358
364
|
bolt module <action> [options]
|
359
365
|
|
360
366
|
DESCRIPTION
|
361
|
-
Install
|
367
|
+
Install and list modules and generate type references
|
362
368
|
|
363
369
|
ACTIONS
|
364
|
-
|
370
|
+
generate-types Generate type references to register in plans
|
371
|
+
install Install the project's modules
|
372
|
+
show List modules available to the Bolt project
|
365
373
|
HELP
|
366
374
|
|
367
375
|
MODULE_INSTALL_HELP = <<~HELP
|
@@ -379,6 +387,28 @@ module Bolt
|
|
379
387
|
generate a Puppetfile, and install the modules.
|
380
388
|
HELP
|
381
389
|
|
390
|
+
MODULE_GENERATETYPES_HELP = <<~HELP
|
391
|
+
NAME
|
392
|
+
generate-types
|
393
|
+
|
394
|
+
USAGE
|
395
|
+
bolt module generate-types [options]
|
396
|
+
|
397
|
+
DESCRIPTION
|
398
|
+
Generate type references to register in plans.
|
399
|
+
HELP
|
400
|
+
|
401
|
+
MODULE_SHOW_HELP = <<~HELP
|
402
|
+
NAME
|
403
|
+
show
|
404
|
+
|
405
|
+
USAGE
|
406
|
+
bolt module show [options]
|
407
|
+
|
408
|
+
DESCRIPTION
|
409
|
+
List modules available to the Bolt project.
|
410
|
+
HELP
|
411
|
+
|
382
412
|
PLAN_HELP = <<~HELP
|
383
413
|
NAME
|
384
414
|
plan
|
data/lib/bolt/cli.rb
CHANGED
@@ -41,7 +41,7 @@ module Bolt
|
|
41
41
|
'project' => %w[init migrate],
|
42
42
|
'apply' => %w[],
|
43
43
|
'guide' => %w[],
|
44
|
-
'module' => %w[install] }.freeze
|
44
|
+
'module' => %w[install show generate-types] }.freeze
|
45
45
|
|
46
46
|
attr_reader :config, :options
|
47
47
|
|
@@ -409,6 +409,8 @@ module Bolt
|
|
409
409
|
end
|
410
410
|
when 'group'
|
411
411
|
list_groups
|
412
|
+
when 'module'
|
413
|
+
list_modules
|
412
414
|
end
|
413
415
|
return 0
|
414
416
|
when 'show-modules'
|
@@ -452,6 +454,8 @@ module Bolt
|
|
452
454
|
case options[:action]
|
453
455
|
when 'install'
|
454
456
|
code = install_project_modules
|
457
|
+
when 'generate-types'
|
458
|
+
code = generate_types
|
455
459
|
end
|
456
460
|
when 'puppetfile'
|
457
461
|
case options[:action]
|
@@ -940,17 +944,17 @@ module Bolt
|
|
940
944
|
# Collects the list of Bolt guides and maps them to their topics.
|
941
945
|
def guides
|
942
946
|
@guides ||= begin
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
947
|
+
root_path = File.expand_path(File.join(__dir__, '..', '..', 'guides'))
|
948
|
+
files = Dir.children(root_path).sort
|
949
|
+
|
950
|
+
files.each_with_object({}) do |file, guides|
|
951
|
+
next if file !~ /\.txt\z/
|
952
|
+
topic = File.basename(file, '.txt')
|
953
|
+
guides[topic] = File.join(root_path, file)
|
954
|
+
end
|
955
|
+
rescue SystemCallError => e
|
956
|
+
raise Bolt::FileError.new("#{e.message}: unable to load guides directory", root_path)
|
957
|
+
end
|
954
958
|
end
|
955
959
|
|
956
960
|
# Display the list of available Bolt guides.
|
@@ -1001,10 +1005,10 @@ module Bolt
|
|
1001
1005
|
|
1002
1006
|
def analytics
|
1003
1007
|
@analytics ||= begin
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
+
client = Bolt::Analytics.build_client
|
1009
|
+
client.bundled_content = bundled_content
|
1010
|
+
client
|
1011
|
+
end
|
1008
1012
|
end
|
1009
1013
|
|
1010
1014
|
def bundled_content
|
@@ -1042,7 +1046,7 @@ module Bolt
|
|
1042
1046
|
# Gem installs include the aggregate, canary, and puppetdb_fact modules, while
|
1043
1047
|
# package installs include modules listed in the Bolt repo Puppetfile
|
1044
1048
|
def incomplete_install?
|
1045
|
-
(Dir.children(Bolt::PAL::MODULES_PATH) - %w[aggregate canary puppetdb_fact]).empty?
|
1049
|
+
(Dir.children(Bolt::PAL::MODULES_PATH) - %w[aggregate canary puppetdb_fact secure_env_vars]).empty?
|
1046
1050
|
end
|
1047
1051
|
|
1048
1052
|
# Mimicks the output from Outputter::Human#fatal_error. This should be used to print
|
data/lib/bolt/inventory.rb
CHANGED
data/lib/bolt/transport/base.rb
CHANGED
@@ -47,10 +47,10 @@ module Bolt
|
|
47
47
|
callback&.call(type: :node_start, target: target)
|
48
48
|
|
49
49
|
result = begin
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
yield
|
51
|
+
rescue StandardError, NotImplementedError => e
|
52
|
+
Bolt::Result.from_exception(target, e, action: action)
|
53
|
+
end
|
54
54
|
|
55
55
|
callback&.call(type: :node_result, result: result)
|
56
56
|
result
|
data/lib/bolt/util.rb
CHANGED
@@ -179,16 +179,16 @@ module Bolt
|
|
179
179
|
# object was frozen
|
180
180
|
frozen = obj.frozen?
|
181
181
|
cl = begin
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
182
|
+
obj.clone(freeze: false)
|
183
|
+
# Some datatypes, such as FalseClass, can't be unfrozen. These
|
184
|
+
# aren't the types we recurse on, so we can leave them frozen
|
185
|
+
rescue ArgumentError => e
|
186
|
+
if e.message =~ /can't unfreeze/
|
187
|
+
obj.clone
|
188
|
+
else
|
189
|
+
raise e
|
190
|
+
end
|
191
|
+
end
|
192
192
|
rescue *error_types
|
193
193
|
cloned[obj.object_id] = obj
|
194
194
|
obj
|
data/lib/bolt/version.rb
CHANGED
@@ -64,17 +64,17 @@ module BoltServer
|
|
64
64
|
|
65
65
|
def client
|
66
66
|
@client ||= begin
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
67
|
+
uri = URI(@config['file-server-uri'])
|
68
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
69
|
+
https.use_ssl = true
|
70
|
+
https.ssl_version = :TLSv1_2
|
71
|
+
https.ca_file = @config['ssl-ca-cert']
|
72
|
+
https.cert = OpenSSL::X509::Certificate.new(ssl_cert)
|
73
|
+
https.key = OpenSSL::PKey::RSA.new(ssl_key)
|
74
|
+
https.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
75
|
+
https.open_timeout = @config['file-server-conn-timeout']
|
76
|
+
https
|
77
|
+
end
|
78
78
|
end
|
79
79
|
|
80
80
|
def request_file(path, params, file)
|
@@ -142,10 +142,10 @@ module BoltSpec
|
|
142
142
|
# Override in your tests
|
143
143
|
def config
|
144
144
|
@config ||= begin
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
145
|
+
conf = Bolt::Config.default
|
146
|
+
conf.modulepath = [modulepath].flatten
|
147
|
+
conf
|
148
|
+
end
|
149
149
|
end
|
150
150
|
|
151
151
|
def plugins
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|