bolt 2.37.0 → 2.44.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/Puppetfile +17 -17
- data/bolt-modules/boltlib/lib/puppet/functions/parallelize.rb +6 -8
- data/lib/bolt/analytics.rb +3 -2
- data/lib/bolt/applicator.rb +11 -1
- data/lib/bolt/bolt_option_parser.rb +20 -13
- data/lib/bolt/catalog.rb +10 -29
- data/lib/bolt/cli.rb +58 -40
- data/lib/bolt/config.rb +134 -119
- data/lib/bolt/config/options.rb +142 -77
- data/lib/bolt/config/transport/base.rb +2 -2
- data/lib/bolt/config/transport/local.rb +1 -0
- data/lib/bolt/config/transport/options.rb +18 -68
- data/lib/bolt/config/transport/orch.rb +1 -0
- data/lib/bolt/config/transport/ssh.rb +0 -5
- data/lib/bolt/executor.rb +15 -5
- data/lib/bolt/inventory.rb +26 -0
- data/lib/bolt/inventory/group.rb +35 -12
- data/lib/bolt/inventory/inventory.rb +1 -1
- data/lib/bolt/inventory/options.rb +130 -0
- data/lib/bolt/inventory/target.rb +10 -11
- data/lib/bolt/logger.rb +114 -10
- data/lib/bolt/module.rb +10 -2
- data/lib/bolt/module_installer.rb +25 -15
- data/lib/bolt/module_installer/resolver.rb +65 -12
- data/lib/bolt/module_installer/specs/forge_spec.rb +8 -2
- data/lib/bolt/module_installer/specs/git_spec.rb +17 -2
- data/lib/bolt/outputter.rb +19 -5
- data/lib/bolt/outputter/human.rb +24 -1
- data/lib/bolt/outputter/json.rb +1 -1
- data/lib/bolt/outputter/logger.rb +1 -1
- data/lib/bolt/outputter/rainbow.rb +12 -1
- data/lib/bolt/pal.rb +93 -14
- data/lib/bolt/pal/yaml_plan.rb +8 -2
- data/lib/bolt/pal/yaml_plan/evaluator.rb +2 -2
- data/lib/bolt/pal/yaml_plan/transpiler.rb +6 -1
- data/lib/bolt/plugin.rb +3 -3
- data/lib/bolt/plugin/cache.rb +8 -8
- data/lib/bolt/plugin/module.rb +1 -1
- data/lib/bolt/plugin/puppet_connect_data.rb +35 -0
- data/lib/bolt/plugin/puppetdb.rb +2 -2
- data/lib/bolt/project.rb +76 -50
- data/lib/bolt/project_manager.rb +2 -0
- data/lib/bolt/project_manager/config_migrator.rb +9 -1
- data/lib/bolt/project_manager/module_migrator.rb +2 -0
- data/lib/bolt/puppetdb/client.rb +8 -0
- data/lib/bolt/rerun.rb +1 -1
- data/lib/bolt/shell/bash.rb +1 -1
- data/lib/bolt/shell/bash/tmpdir.rb +4 -1
- data/lib/bolt/shell/powershell.rb +7 -5
- data/lib/bolt/target.rb +4 -0
- data/lib/bolt/task.rb +1 -1
- data/lib/bolt/transport/docker/connection.rb +2 -2
- data/lib/bolt/transport/local.rb +13 -0
- data/lib/bolt/transport/orch/connection.rb +1 -1
- data/lib/bolt/transport/ssh.rb +1 -2
- data/lib/bolt/transport/ssh/connection.rb +1 -1
- data/lib/bolt/validator.rb +227 -0
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_server/config.rb +1 -1
- data/lib/bolt_server/schemas/partials/task.json +1 -1
- data/lib/bolt_server/transport_app.rb +28 -27
- data/libexec/bolt_catalog +1 -1
- metadata +27 -11
- data/lib/bolt/config/validator.rb +0 -231
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa7f2db70ebfda5de9128554d289d3506ad0c922dac4042e80e29ad691b04447
|
4
|
+
data.tar.gz: b0eedc91174b14a594352d3033a27c13f4f29dbd038679345568e39bea486bc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d5620a57dbf4ba82778704296116f53b162a469557162f766c208a5ca5d01e52fbdb219c8e9e965823dca7224dfd1dec507cb432d0d64fa29604fc117a1930f
|
7
|
+
data.tar.gz: 0fdf98e91e30c49960caf5b67bca32d6698c3df18ce1d75db98831cfc0694ac1ba444c08691e809ba3ecca76d702b16e46154ed5fc65a59db432f27355bf57a0
|
data/Puppetfile
CHANGED
@@ -5,14 +5,14 @@ forge "http://forge.puppetlabs.com"
|
|
5
5
|
moduledir File.join(File.dirname(__FILE__), 'modules')
|
6
6
|
|
7
7
|
# Core modules used by 'apply'
|
8
|
-
mod 'puppetlabs-service', '1.
|
9
|
-
mod 'puppetlabs-puppet_agent', '4.
|
10
|
-
mod 'puppetlabs-facts', '1.
|
8
|
+
mod 'puppetlabs-service', '1.4.0'
|
9
|
+
mod 'puppetlabs-puppet_agent', '4.4.0'
|
10
|
+
mod 'puppetlabs-facts', '1.4.0'
|
11
11
|
|
12
12
|
# Core types and providers for Puppet 6
|
13
13
|
mod 'puppetlabs-augeas_core', '1.1.1'
|
14
14
|
mod 'puppetlabs-host_core', '1.0.3'
|
15
|
-
mod 'puppetlabs-scheduled_task', '2.
|
15
|
+
mod 'puppetlabs-scheduled_task', '2.3.1'
|
16
16
|
mod 'puppetlabs-sshkeys_core', '2.2.0'
|
17
17
|
mod 'puppetlabs-zfs_core', '1.2.0'
|
18
18
|
mod 'puppetlabs-cron_core', '1.0.5'
|
@@ -22,23 +22,23 @@ mod 'puppetlabs-yumrepo_core', '1.0.7'
|
|
22
22
|
mod 'puppetlabs-zone_core', '1.0.3'
|
23
23
|
|
24
24
|
# Useful additional modules
|
25
|
-
mod 'puppetlabs-package', '1.
|
26
|
-
mod 'puppetlabs-puppet_conf', '0.
|
27
|
-
mod 'puppetlabs-python_task_helper', '0.
|
28
|
-
mod 'puppetlabs-reboot', '3.
|
29
|
-
mod 'puppetlabs-ruby_task_helper', '0.
|
30
|
-
mod 'puppetlabs-ruby_plugin_helper', '0.
|
25
|
+
mod 'puppetlabs-package', '1.4.0'
|
26
|
+
mod 'puppetlabs-puppet_conf', '0.8.0'
|
27
|
+
mod 'puppetlabs-python_task_helper', '0.5.0'
|
28
|
+
mod 'puppetlabs-reboot', '3.2.0'
|
29
|
+
mod 'puppetlabs-ruby_task_helper', '0.6.0'
|
30
|
+
mod 'puppetlabs-ruby_plugin_helper', '0.2.0'
|
31
31
|
mod 'puppetlabs-stdlib', '6.5.0'
|
32
32
|
|
33
33
|
# Plugin modules
|
34
|
-
mod 'puppetlabs-aws_inventory', '0.
|
35
|
-
mod 'puppetlabs-azure_inventory', '0.
|
36
|
-
mod 'puppetlabs-gcloud_inventory', '0.
|
37
|
-
mod 'puppetlabs-http_request', '0.2.
|
34
|
+
mod 'puppetlabs-aws_inventory', '0.6.0'
|
35
|
+
mod 'puppetlabs-azure_inventory', '0.5.0'
|
36
|
+
mod 'puppetlabs-gcloud_inventory', '0.2.0'
|
37
|
+
mod 'puppetlabs-http_request', '0.2.1'
|
38
38
|
mod 'puppetlabs-pkcs7', '0.1.1'
|
39
|
-
mod 'puppetlabs-secure_env_vars', '0.
|
40
|
-
mod 'puppetlabs-terraform', '0.
|
41
|
-
mod 'puppetlabs-vault', '0.
|
39
|
+
mod 'puppetlabs-secure_env_vars', '0.2.0'
|
40
|
+
mod 'puppetlabs-terraform', '0.6.1'
|
41
|
+
mod 'puppetlabs-vault', '0.4.0'
|
42
42
|
mod 'puppetlabs-yaml', '0.2.0'
|
43
43
|
|
44
44
|
# If we don't list these modules explicitly, r10k will purge them
|
@@ -12,14 +12,12 @@ Puppet::Functions.create_function(:parallelize, Puppet::Functions::InternalFunct
|
|
12
12
|
# @param data The array to apply the block to.
|
13
13
|
# @return [Array] An array of PlanResult objects. Each input from the input
|
14
14
|
# array returns a corresponding PlanResult object.
|
15
|
-
# @example Execute two tasks on
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
# $
|
20
|
-
#
|
21
|
-
# run_task('b', $t)
|
22
|
-
# }
|
15
|
+
# @example Execute two tasks on two targets.
|
16
|
+
# $targets = get_targets(["host1", "host2"])
|
17
|
+
# $result = parallelize ($targets) |$t| {
|
18
|
+
# run_task('a', $t)
|
19
|
+
# run_task('b', $t)
|
20
|
+
# }
|
23
21
|
dispatch :parallelize do
|
24
22
|
scope_param
|
25
23
|
param 'Array[Any]', :data
|
data/lib/bolt/analytics.rb
CHANGED
@@ -78,7 +78,7 @@ module Bolt
|
|
78
78
|
Bolt::Util.read_optional_yaml_hash(filename, 'analytics')
|
79
79
|
else
|
80
80
|
unless ENV['BOLT_DISABLE_ANALYTICS']
|
81
|
-
|
81
|
+
msg = <<~ANALYTICS
|
82
82
|
Bolt collects data about how you use it. You can opt out of providing this data.
|
83
83
|
|
84
84
|
To disable analytics data collection, add this line to ~/.puppetlabs/etc/bolt/analytics.yaml :
|
@@ -86,7 +86,8 @@ module Bolt
|
|
86
86
|
|
87
87
|
Read more about what data Bolt collects and why here:
|
88
88
|
https://puppet.com/docs/bolt/latest/bolt_installing.html#analytics-data-collection
|
89
|
-
|
89
|
+
ANALYTICS
|
90
|
+
Bolt::Logger.warn_once('analytics_opt_out', msg)
|
90
91
|
end
|
91
92
|
|
92
93
|
{}
|
data/lib/bolt/applicator.rb
CHANGED
@@ -125,7 +125,16 @@ module Bolt
|
|
125
125
|
@logger.send(bolt_level, "#{target.name}: #{message}")
|
126
126
|
end
|
127
127
|
end
|
128
|
-
|
128
|
+
|
129
|
+
unless stat.success?
|
130
|
+
message = if @apply_settings['trace'] && result['backtrace']
|
131
|
+
([result['message']] + result['backtrace']).join("\n ")
|
132
|
+
else
|
133
|
+
result['message']
|
134
|
+
end
|
135
|
+
raise ApplyError.new(target.name, message)
|
136
|
+
end
|
137
|
+
|
129
138
|
result
|
130
139
|
end
|
131
140
|
|
@@ -236,6 +245,7 @@ module Bolt
|
|
236
245
|
else
|
237
246
|
Bolt::ApplyError.new(batch_target, future.reason.message)
|
238
247
|
end
|
248
|
+
|
239
249
|
result = Bolt::ApplyResult.new(batch_target, error: error.to_h)
|
240
250
|
@executor.publish_event(type: :node_result, result: result)
|
241
251
|
result
|
@@ -760,13 +760,10 @@ module Bolt
|
|
760
760
|
bolt task show canary
|
761
761
|
HELP
|
762
762
|
|
763
|
-
attr_reader :deprecations
|
764
|
-
|
765
763
|
def initialize(options)
|
766
764
|
super()
|
767
765
|
|
768
766
|
@options = options
|
769
|
-
@deprecations = []
|
770
767
|
|
771
768
|
separator "\nINVENTORY OPTIONS"
|
772
769
|
define('-t', '--targets TARGETS',
|
@@ -796,9 +793,11 @@ module Bolt
|
|
796
793
|
end
|
797
794
|
define('--description DESCRIPTION',
|
798
795
|
'Deprecated. Description to use for the job') do |description|
|
799
|
-
|
796
|
+
Bolt::Logger.deprecate(
|
797
|
+
"description_cli_option",
|
798
|
+
"Command line option '--description' is deprecated, and will be "\
|
800
799
|
"removed in Bolt 3.0."
|
801
|
-
|
800
|
+
)
|
802
801
|
@options[:description] = description
|
803
802
|
end
|
804
803
|
define('--params PARAMETERS',
|
@@ -881,8 +880,10 @@ module Bolt
|
|
881
880
|
define('--boltdir PATH',
|
882
881
|
'Deprecated. Specify what project to load config from (default:',
|
883
882
|
'autodiscovered from current working dir)') do |path|
|
884
|
-
|
885
|
-
|
883
|
+
Bolt::Logger.deprecate(
|
884
|
+
"boltdir_cli_option",
|
885
|
+
"Command line option '--boltdir' is deprecated, use '--project' instead."
|
886
|
+
)
|
886
887
|
@options[:boltdir] = path
|
887
888
|
end
|
888
889
|
define('--project PATH',
|
@@ -893,10 +894,12 @@ module Bolt
|
|
893
894
|
'Deprecated. Specify where to load config from (default:',
|
894
895
|
'~/.puppetlabs/bolt/bolt.yaml). Directory containing bolt.yaml will be',
|
895
896
|
'used as the project directory.') do |path|
|
896
|
-
|
897
|
+
Bolt::Logger.deprecate(
|
898
|
+
"configfile_cli_option",
|
899
|
+
"Command line option '--configfile' is deprecated, and " \
|
897
900
|
"will be removed in Bolt 3.0. Use '--project' and provide the "\
|
898
901
|
"directory path instead."
|
899
|
-
|
902
|
+
)
|
900
903
|
@options[:configfile] = path
|
901
904
|
end
|
902
905
|
define('--hiera-config PATH',
|
@@ -915,10 +918,12 @@ module Bolt
|
|
915
918
|
' (default: ~/.puppetlabs/bolt/Puppetfile)',
|
916
919
|
'Modules are installed in the current project.') do |path|
|
917
920
|
command = Bolt::Util.powershell? ? 'Update-BoltProject' : 'bolt project migrate'
|
918
|
-
|
921
|
+
Bolt::Logger.deprecate(
|
922
|
+
"puppetfile_cli_option",
|
923
|
+
"Command line option '--puppetfile' is deprecated, and will be removed "\
|
919
924
|
"in Bolt 3.0. You can migrate to using the new module management "\
|
920
925
|
"workflow using '#{command}'."
|
921
|
-
|
926
|
+
)
|
922
927
|
@options[:puppetfile_path] = File.expand_path(path)
|
923
928
|
end
|
924
929
|
define('--[no-]save-rerun', 'Whether to update the rerun file after this command.') do |save|
|
@@ -1017,8 +1022,10 @@ module Bolt
|
|
1017
1022
|
@options[:debug] = true
|
1018
1023
|
# We don't actually set '--log-level debug' here, but once the options are evaluated by
|
1019
1024
|
# the config class the end result is the same.
|
1020
|
-
|
1021
|
-
|
1025
|
+
Bolt::Logger.deprecate(
|
1026
|
+
"debug_cli_option",
|
1027
|
+
"Command line option '--debug' is deprecated, set '--log-level debug' instead."
|
1028
|
+
)
|
1022
1029
|
end
|
1023
1030
|
define('--log-level LEVEL',
|
1024
1031
|
"Set the log level for the console. Available options are",
|
data/lib/bolt/catalog.rb
CHANGED
@@ -76,31 +76,27 @@ module Bolt
|
|
76
76
|
# is the only way to log a message that will make it back to Bolt
|
77
77
|
# to be printed.
|
78
78
|
target = request['target']
|
79
|
-
plan_vars = shadow_vars('plan', request['plan_vars'], target['facts'])
|
80
|
-
target_vars = shadow_vars('target', target['variables'], target['facts'])
|
81
79
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
# these variables are moved before the variable they reference, Puppet will
|
87
|
-
# be unable to deserialize the data and raise an error.
|
88
|
-
topscope_vars = target_vars.reject { |k, _v| plan_vars.key?(k) }.merge(plan_vars)
|
80
|
+
variables = {
|
81
|
+
variables: request['plan_vars'],
|
82
|
+
target_variables: target['variables']
|
83
|
+
}
|
89
84
|
|
90
|
-
env_conf = {
|
91
|
-
|
92
|
-
|
85
|
+
env_conf = {
|
86
|
+
modulepath: request['modulepath'],
|
87
|
+
facts: target['facts']
|
88
|
+
}
|
93
89
|
|
94
90
|
puppet_settings = {
|
95
91
|
node_name_value: target['name'],
|
96
|
-
hiera_config:
|
92
|
+
hiera_config: request['hiera_config']
|
97
93
|
}
|
98
94
|
|
99
95
|
with_puppet_settings(puppet_settings) do
|
100
96
|
Puppet::Pal.in_tmp_environment('bolt_catalog', **env_conf) do |pal|
|
101
97
|
Puppet.override(puppet_overrides) do
|
102
98
|
Puppet.lookup(:pal_current_node).trusted_data = target['trusted']
|
103
|
-
pal.with_catalog_compiler do |compiler|
|
99
|
+
pal.with_catalog_compiler(**variables) do |compiler|
|
104
100
|
options = request['puppet_config'] || {}
|
105
101
|
# Configure language strictness in the CatalogCompiler. We want Bolt to be able
|
106
102
|
# to compile most Puppet 4+ manifests, so we default to allowing deprecated functions.
|
@@ -119,21 +115,6 @@ module Bolt
|
|
119
115
|
end
|
120
116
|
end
|
121
117
|
|
122
|
-
# Warn and remove variables that will be shadowed by facts of the same
|
123
|
-
# name, which are set in scope earlier.
|
124
|
-
def shadow_vars(type, vars, facts)
|
125
|
-
collisions, valid = vars.partition do |k, _|
|
126
|
-
facts.include?(k)
|
127
|
-
end
|
128
|
-
if collisions.any?
|
129
|
-
names = collisions.map { |k, _| "$#{k}" }.join(', ')
|
130
|
-
plural = collisions.length == 1 ? '' : 's'
|
131
|
-
Puppet.warning("#{type.capitalize} variable#{plural} #{names} will be overridden by fact#{plural} " \
|
132
|
-
"of the same name in the apply block")
|
133
|
-
end
|
134
|
-
valid.to_h
|
135
|
-
end
|
136
|
-
|
137
118
|
def build_program(code)
|
138
119
|
ast = Puppet::Pops::Serialization::FromDataConverter.convert(code)
|
139
120
|
|
data/lib/bolt/cli.rb
CHANGED
@@ -147,10 +147,6 @@ module Bolt
|
|
147
147
|
end
|
148
148
|
|
149
149
|
validate(options)
|
150
|
-
|
151
|
-
# Deprecation warnings can't be issued until after config is loaded, so
|
152
|
-
# store them for later.
|
153
|
-
@parser_deprecations = parser.deprecations
|
154
150
|
rescue Bolt::Error => e
|
155
151
|
fatal_error(e)
|
156
152
|
raise e
|
@@ -185,20 +181,16 @@ module Bolt
|
|
185
181
|
|
186
182
|
# Completes the setup process by configuring Bolt and log messages
|
187
183
|
def finalize_setup
|
188
|
-
Bolt::Logger.configure(config.log, config.color)
|
184
|
+
Bolt::Logger.configure(config.log, config.color, config.disable_warnings)
|
189
185
|
Bolt::Logger.analytics = analytics
|
186
|
+
Bolt::Logger.flush_queue
|
190
187
|
|
191
188
|
# Logger must be configured before checking path case and project file, otherwise logs will not display
|
192
189
|
config.check_path_case('modulepath', config.modulepath)
|
193
190
|
config.project.check_deprecated_file
|
194
191
|
|
195
|
-
|
196
|
-
|
197
|
-
@parser_deprecations.each { |dep| Bolt::Logger.deprecation_warning(dep[:type], dep[:msg]) }
|
198
|
-
config.deprecations.each { |dep| Bolt::Logger.deprecation_warning(dep[:type], dep[:msg]) }
|
199
|
-
|
200
|
-
if options[:clear_cache] && File.exist?(config.project.cache_file)
|
201
|
-
FileUtils.rm(config.project.cache_file)
|
192
|
+
if options[:clear_cache] && File.exist?(config.project.plugin_cache_file)
|
193
|
+
FileUtils.rm(config.project.plugin_cache_file)
|
202
194
|
end
|
203
195
|
|
204
196
|
warn_inventory_overrides_cli(options)
|
@@ -212,12 +204,15 @@ module Bolt
|
|
212
204
|
|
213
205
|
private def validate_ps_version
|
214
206
|
if Bolt::Util.powershell?
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
207
|
+
command = "powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy "\
|
208
|
+
"Bypass -Command $PSVersionTable.PSVersion.Major"
|
209
|
+
stdout, _stderr, _status = Open3.capture3(command)
|
210
|
+
|
211
|
+
return unless !stdout.empty? && stdout.to_i < 3
|
212
|
+
|
213
|
+
msg = "Detected PowerShell 2 on controller. PowerShell 2 is deprecated and "\
|
214
|
+
"support will be removed in Bolt 3.0."
|
215
|
+
Bolt::Logger.deprecate("powershell_2_controller", msg)
|
221
216
|
end
|
222
217
|
end
|
223
218
|
|
@@ -373,7 +368,10 @@ module Bolt
|
|
373
368
|
conflicting_options = Set.new(opts.keys.map(&:to_s)).intersection(inventory_cli_opts)
|
374
369
|
|
375
370
|
if inventory_source && conflicting_options.any?
|
376
|
-
|
371
|
+
Bolt::Logger.warn(
|
372
|
+
"cli_overrides",
|
373
|
+
"CLI arguments #{conflicting_options.to_a} may be overridden by Inventory: #{inventory_source}"
|
374
|
+
)
|
377
375
|
end
|
378
376
|
end
|
379
377
|
|
@@ -491,9 +489,9 @@ module Bolt
|
|
491
489
|
when 'module'
|
492
490
|
case options[:action]
|
493
491
|
when 'add'
|
494
|
-
code = add_project_module(options[:object], config.project)
|
492
|
+
code = add_project_module(options[:object], config.project, config.module_install)
|
495
493
|
when 'install'
|
496
|
-
code = install_project_modules(config.project, options[:force], options[:resolve])
|
494
|
+
code = install_project_modules(config.project, config.module_install, options[:force], options[:resolve])
|
497
495
|
when 'generate-types'
|
498
496
|
code = generate_types
|
499
497
|
end
|
@@ -604,7 +602,7 @@ module Bolt
|
|
604
602
|
end
|
605
603
|
|
606
604
|
def list_plans
|
607
|
-
plans = filter_content(pal.
|
605
|
+
plans = filter_content(pal.list_plans_with_cache(filter_content: true), options[:filter])
|
608
606
|
outputter.print_plans(plans, pal.user_modulepath)
|
609
607
|
end
|
610
608
|
|
@@ -656,7 +654,7 @@ module Bolt
|
|
656
654
|
if node_param && target_param
|
657
655
|
msg = "Plan parameters include both 'nodes' and 'targets' with type 'TargetSpec', " \
|
658
656
|
"neither will populated with the value for --nodes or --targets."
|
659
|
-
|
657
|
+
Bolt::Logger.warn("nodes_targets_parameters", msg)
|
660
658
|
elsif node_param
|
661
659
|
plan_arguments['nodes'] = nodes.join(',')
|
662
660
|
elsif target_param
|
@@ -701,7 +699,7 @@ module Bolt
|
|
701
699
|
"about defining and declaring classes and types in the Puppet documentation at "\
|
702
700
|
"https://puppet.com/docs/puppet/latest/lang_classes.html and "\
|
703
701
|
"https://puppet.com/docs/puppet/latest/lang_defined_types.html"
|
704
|
-
|
702
|
+
Bolt::Logger.warn("empty_manifest", message)
|
705
703
|
end
|
706
704
|
|
707
705
|
executor = Bolt::Executor.new(config.concurrency, analytics, noop, config.modified_concurrency)
|
@@ -737,13 +735,13 @@ module Bolt
|
|
737
735
|
def generate_types
|
738
736
|
assert_puppetfile_or_module_command(config.project.modules)
|
739
737
|
# generate_types will surface a nice error with helpful message if it fails
|
740
|
-
pal.generate_types
|
738
|
+
pal.generate_types(cache: true)
|
741
739
|
0
|
742
740
|
end
|
743
741
|
|
744
742
|
# Installs modules declared in the project configuration file.
|
745
743
|
#
|
746
|
-
def install_project_modules(project, force, resolve)
|
744
|
+
def install_project_modules(project, config, force, resolve)
|
747
745
|
assert_project_file(project)
|
748
746
|
assert_puppetfile_or_module_command(project.modules)
|
749
747
|
|
@@ -753,30 +751,39 @@ module Bolt
|
|
753
751
|
return 0
|
754
752
|
end
|
755
753
|
|
754
|
+
modules = project.modules || []
|
756
755
|
installer = Bolt::ModuleInstaller.new(outputter, pal)
|
757
756
|
|
758
|
-
ok =
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
757
|
+
ok = outputter.spin do
|
758
|
+
installer.install(modules,
|
759
|
+
project.puppetfile,
|
760
|
+
project.managed_moduledir,
|
761
|
+
config,
|
762
|
+
force: force,
|
763
|
+
resolve: resolve)
|
764
|
+
end
|
765
|
+
|
763
766
|
ok ? 0 : 1
|
764
767
|
end
|
765
768
|
|
766
769
|
# Adds a single module to the project.
|
767
770
|
#
|
768
|
-
def add_project_module(name, project)
|
771
|
+
def add_project_module(name, project, config)
|
769
772
|
assert_project_file(project)
|
770
773
|
assert_puppetfile_or_module_command(project.modules)
|
771
774
|
|
772
775
|
modules = project.modules || []
|
773
776
|
installer = Bolt::ModuleInstaller.new(outputter, pal)
|
774
777
|
|
775
|
-
ok =
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
778
|
+
ok = outputter.spin do
|
779
|
+
installer.add(name,
|
780
|
+
modules,
|
781
|
+
project.puppetfile,
|
782
|
+
project.managed_moduledir,
|
783
|
+
project.project_file,
|
784
|
+
config)
|
785
|
+
end
|
786
|
+
|
780
787
|
ok ? 0 : 1
|
781
788
|
end
|
782
789
|
|
@@ -805,7 +812,10 @@ module Bolt
|
|
805
812
|
|
806
813
|
outputter.print_message("Installing modules from Puppetfile")
|
807
814
|
installer = Bolt::ModuleInstaller.new(outputter, pal)
|
808
|
-
ok =
|
815
|
+
ok = outputter.spin do
|
816
|
+
installer.install_puppetfile(puppetfile, moduledir, puppetfile_config)
|
817
|
+
end
|
818
|
+
|
809
819
|
ok ? 0 : 1
|
810
820
|
end
|
811
821
|
|
@@ -838,6 +848,10 @@ module Bolt
|
|
838
848
|
raise Bolt::CLIError,
|
839
849
|
"Unable to use command '#{old_command}' when 'modules' is configured in "\
|
840
850
|
"bolt-project.yaml. Use '#{new_command}' instead."
|
851
|
+
elsif modules.nil? && options[:subcommand] == 'puppetfile'
|
852
|
+
msg = "Command '#{old_command}' is deprecated and will be removed in Bolt 3.0. Update your project to use "\
|
853
|
+
"the module management feature. For more information, see https://pup.pt/bolt-module-migrate."
|
854
|
+
Bolt::Logger.deprecate("puppetfile_command", msg)
|
841
855
|
elsif modules.nil? && options[:subcommand] == 'module'
|
842
856
|
msg = "Unable to use command '#{new_command}' when 'modules' is not configured in "\
|
843
857
|
"bolt-project.yaml. "
|
@@ -911,7 +925,11 @@ module Bolt
|
|
911
925
|
end
|
912
926
|
|
913
927
|
def outputter
|
914
|
-
@outputter ||= Bolt::Outputter.for_format(config.format,
|
928
|
+
@outputter ||= Bolt::Outputter.for_format(config.format,
|
929
|
+
config.color,
|
930
|
+
options[:verbose],
|
931
|
+
config.trace,
|
932
|
+
config.spinner)
|
915
933
|
end
|
916
934
|
|
917
935
|
def log_outputter
|
@@ -938,7 +956,7 @@ module Bolt
|
|
938
956
|
set the BOLT_GEM environment variable.
|
939
957
|
MSG
|
940
958
|
|
941
|
-
|
959
|
+
Bolt::Logger.warn("gem_install", msg)
|
942
960
|
end
|
943
961
|
|
944
962
|
# We only need to enumerate bundled content when running a task or plan
|