bolt 2.44.0 → 3.0.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.

data/lib/bolt/config.rb CHANGED
@@ -22,8 +22,7 @@ module Bolt
22
22
 
23
23
  attr_reader :config_files, :data, :transports, :project, :modified_concurrency
24
24
 
25
- BOLT_CONFIG_NAME = 'bolt.yaml'
26
- BOLT_DEFAULTS_NAME = 'bolt-defaults.yaml'
25
+ DEFAULTS_NAME = 'bolt-defaults.yaml'
27
26
 
28
27
  # The default concurrency value that is used when the ulimit is not low (i.e. < 700)
29
28
  DEFAULT_DEFAULT_CONCURRENCY = 100
@@ -33,57 +32,9 @@ module Bolt
33
32
  end
34
33
 
35
34
  def self.from_project(project, overrides = {})
36
- conf = if project.project_file == project.config_file
37
- project.data
38
- else
39
- c = Bolt::Util.read_optional_yaml_hash(project.config_file, 'config')
40
-
41
- # Validate the config against the schema. This will raise a single error
42
- # with all validation errors.
43
- Bolt::Validator.new.tap do |validator|
44
- validator.validate(c, bolt_schema, project.config_file.to_s)
45
- validator.warnings.each { |warning| Bolt::Logger.warn(warning[:id], warning[:msg]) }
46
- validator.deprecations.each { |dep| Bolt::Logger.deprecate(dep[:id], dep[:msg]) }
47
- end
48
-
49
- if File.exist?(project.config_file)
50
- Bolt::Logger.debug("Loaded configuration from #{project.config_file}")
51
- end
52
- c
53
- end
54
-
55
- data = load_defaults(project).push(
56
- filepath: project.config_file,
57
- data: conf
58
- )
59
-
60
- new(project, data, overrides)
61
- end
62
-
63
- def self.from_file(configfile, overrides = {})
64
- project = Bolt::Project.create_project(Pathname.new(configfile).expand_path.dirname)
65
-
66
- conf = if project.project_file == project.config_file
67
- project.data
68
- else
69
- c = Bolt::Util.read_yaml_hash(configfile, 'config')
70
-
71
- # Validate the config against the schema. This will raise a single error
72
- # with all validation errors.
73
- Bolt::Validator.new.tap do |validator|
74
- validator.validate(c, bolt_schema, project.config_file.to_s)
75
- validator.warnings.each { |warning| Bolt::Logger.warn(warning[:id], warning[:msg]) }
76
- validator.deprecations.each { |dep| Bolt::Logger.deprecate(dep[:id], dep[:msg]) }
77
- end
78
-
79
- Bolt::Logger.debug("Loaded configuration from #{configfile}")
80
-
81
- c
82
- end
83
-
84
- data = load_defaults(project).push(
85
- filepath: configfile,
86
- data: conf
35
+ data = load_defaults.push(
36
+ filepath: project.project_file,
37
+ data: project.data
87
38
  )
88
39
 
89
40
  new(project, data, overrides)
@@ -102,7 +53,7 @@ module Bolt
102
53
  def self.defaults_schema
103
54
  schema = {
104
55
  type: Hash,
105
- properties: BOLT_DEFAULTS_OPTIONS.map { |opt| [opt, _ref: opt] }.to_h,
56
+ properties: DEFAULTS_OPTIONS.map { |opt| [opt, _ref: opt] }.to_h,
106
57
  definitions: OPTIONS.merge(transport_definitions)
107
58
  }
108
59
 
@@ -111,16 +62,6 @@ module Bolt
111
62
  schema
112
63
  end
113
64
 
114
- # Builds the schema for bolt.yaml used by the validator.
115
- #
116
- def self.bolt_schema
117
- {
118
- type: Hash,
119
- properties: (BOLT_OPTIONS + INVENTORY_OPTIONS.keys).map { |opt| [opt, _ref: opt] }.to_h,
120
- definitions: OPTIONS.merge(transport_definitions)
121
- }
122
- end
123
-
124
65
  def self.system_path
125
66
  if Bolt::Util.windows?
126
67
  Pathname.new(File.join(ENV['ALLUSERSPROFILE'], 'PuppetLabs', 'bolt', 'etc'))
@@ -136,23 +77,14 @@ module Bolt
136
77
  end
137
78
 
138
79
  # Loads a 'bolt-defaults.yaml' file, which contains default configuration that applies to all
139
- # projects. This file does not allow project-specific configuration such as 'hiera-config' and
140
- # 'inventoryfile', and nests all default inventory configuration under an 'inventory-config' key.
80
+ # projects. This file does not allow project-specific configuration such as 'hiera-config'
81
+ # and nests all default inventory configuration under an 'inventory-config' key.
141
82
  def self.load_bolt_defaults_yaml(dir)
142
- filepath = dir + BOLT_DEFAULTS_NAME
83
+ filepath = dir + DEFAULTS_NAME
143
84
  data = Bolt::Util.read_yaml_hash(filepath, 'config')
144
85
 
145
86
  Bolt::Logger.debug("Loaded configuration from #{filepath}")
146
87
 
147
- # Warn if 'bolt.yaml' detected in same directory.
148
- if File.exist?(bolt_yaml = dir + BOLT_CONFIG_NAME)
149
- Bolt::Logger.warn(
150
- "multiple_config_files",
151
- "Detected multiple configuration files: ['#{bolt_yaml}', '#{filepath}']. '#{bolt_yaml}' "\
152
- "will be ignored."
153
- )
154
- end
155
-
156
88
  # Validate the config against the schema. This will raise a single error
157
89
  # with all validation errors.
158
90
  Bolt::Validator.new.tap do |validator|
@@ -162,7 +94,7 @@ module Bolt
162
94
  end
163
95
 
164
96
  # Remove project-specific config such as hiera-config, etc.
165
- project_config = data.slice(*(BOLT_PROJECT_OPTIONS - BOLT_DEFAULTS_OPTIONS))
97
+ project_config = data.slice(*(PROJECT_OPTIONS - DEFAULTS_OPTIONS))
166
98
 
167
99
  if project_config.any?
168
100
  data.reject! { |key, _| project_config.include?(key) }
@@ -210,52 +142,17 @@ module Bolt
210
142
  { filepath: filepath, data: data }
211
143
  end
212
144
 
213
- # Loads a 'bolt.yaml' file, the legacy configuration file. There's no special munging needed
214
- # here since Bolt::Config will just ignore any invalid keys.
215
- def self.load_bolt_yaml(dir)
216
- filepath = dir + BOLT_CONFIG_NAME
217
- data = Bolt::Util.read_yaml_hash(filepath, 'config')
218
-
219
- Bolt::Logger.debug("Loaded configuration from #{filepath}")
220
-
221
- Bolt::Logger.deprecate(
222
- "bolt_yaml",
223
- "Configuration file #{filepath} is deprecated and will be removed in Bolt 3.0. "\
224
- "See https://pup.pt/update-bolt-config for how to update to the latest Bolt practices."
225
- )
226
-
227
- # Validate the config against the schema. This will raise a single error
228
- # with all validation errors.
229
- Bolt::Validator.new.tap do |validator|
230
- validator.validate(data, bolt_schema, filepath)
231
- validator.warnings.each { |warning| Bolt::Logger.warn(warning[:id], warning[:msg]) }
232
- validator.deprecations.each { |dep| Bolt::Logger.deprecate(dep[:id], dep[:msg]) }
233
- end
234
-
235
- { filepath: filepath, data: data }
236
- end
237
-
238
- def self.load_defaults(project)
145
+ def self.load_defaults
239
146
  confs = []
240
147
 
241
- # Load system-level config. Prefer a 'bolt-defaults.yaml' file, but fall back to the
242
- # legacy 'bolt.yaml' file. If the project-level config file is also the system-level
243
- # config file, don't load it a second time.
244
- if File.exist?(system_path + BOLT_DEFAULTS_NAME)
148
+ # Load system-level config.
149
+ if File.exist?(system_path + DEFAULTS_NAME)
245
150
  confs << load_bolt_defaults_yaml(system_path)
246
- elsif File.exist?(system_path + BOLT_CONFIG_NAME) &&
247
- (system_path + BOLT_CONFIG_NAME) != project.config_file
248
- confs << load_bolt_yaml(system_path)
249
151
  end
250
152
 
251
- # Load user-level config if there is a homedir. Prefer a 'bolt-defaults.yaml' file, but
252
- # fall back to the legacy 'bolt.yaml' file.
253
- if user_path
254
- if File.exist?(user_path + BOLT_DEFAULTS_NAME)
255
- confs << load_bolt_defaults_yaml(user_path)
256
- elsif File.exist?(user_path + BOLT_CONFIG_NAME)
257
- confs << load_bolt_yaml(user_path)
258
- end
153
+ # Load user-level config if there is a homedir.
154
+ if user_path && File.exist?(user_path + DEFAULTS_NAME)
155
+ confs << load_bolt_defaults_yaml(user_path)
259
156
  end
260
157
 
261
158
  confs
@@ -263,7 +160,7 @@ module Bolt
263
160
 
264
161
  def initialize(project, config_data, overrides = {})
265
162
  unless config_data.is_a?(Array)
266
- config_data = [{ filepath: project.config_file, data: config_data }]
163
+ config_data = [{ filepath: project.project_file, data: config_data }]
267
164
  end
268
165
 
269
166
  @logger = Bolt::Logger.logger(self)
@@ -273,7 +170,6 @@ module Bolt
273
170
 
274
171
  default_data = {
275
172
  'apply-settings' => {},
276
- 'apply_settings' => {},
277
173
  'color' => true,
278
174
  'compile-concurrency' => Etc.nprocessors,
279
175
  'concurrency' => default_concurrency,
@@ -282,10 +178,8 @@ module Bolt
282
178
  'log' => { 'console' => {} },
283
179
  'module-install' => {},
284
180
  'plugin-hooks' => {},
285
- 'plugin_hooks' => {},
286
181
  'plugins' => {},
287
182
  'puppetdb' => {},
288
- 'puppetfile' => {},
289
183
  'save-rerun' => true,
290
184
  'spinner' => true,
291
185
  'transport' => 'ssh'
@@ -328,28 +222,25 @@ module Bolt
328
222
  def normalize_overrides(options)
329
223
  opts = options.transform_keys(&:to_s)
330
224
 
331
- # Pull out config options. We need to add 'transport' as it's not part of the
332
- # OPTIONS hash but is a valid option that can be set with the --transport CLI option
333
- overrides = opts.slice(*OPTIONS.keys, 'transport')
225
+ # Pull out config options. We need to add 'transport' and 'inventoryfile' as they're
226
+ # not part of the OPTIONS hash but are valid options that can be set with CLI options
227
+ overrides = opts.slice(*OPTIONS.keys, 'inventoryfile', 'transport')
334
228
 
335
229
  # Pull out transport config options
336
230
  TRANSPORT_CONFIG.each do |transport, config|
337
231
  overrides[transport] = opts.slice(*config.options)
338
232
  end
339
233
 
340
- # Set console log to debug if in debug mode
341
- if options[:debug]
342
- overrides['log'] = { 'console' => { 'level' => 'debug' } }
343
- end
344
-
345
- if options[:puppetfile_path]
346
- @puppetfile = options[:puppetfile_path]
347
- end
348
-
349
234
  overrides['trace'] = opts['trace'] if opts.key?('trace')
350
235
 
351
- # Validate the overrides
352
- Bolt::Validator.new.validate(overrides, self.class.bolt_schema, 'command line')
236
+ # Validate the overrides that can have arbitrary values
237
+ schema = {
238
+ type: Hash,
239
+ properties: CLI_OPTIONS.map { |opt| [opt, _ref: opt] }.to_h,
240
+ definitions: OPTIONS.merge(INVENTORY_OPTIONS)
241
+ }
242
+
243
+ Bolt::Validator.new.validate(overrides.slice(*CLI_OPTIONS), schema, 'command line')
353
244
 
354
245
  overrides
355
246
  end
@@ -367,7 +258,7 @@ module Bolt
367
258
  when *TRANSPORT_CONFIG.keys
368
259
  Bolt::Util.deep_merge(val1, val2)
369
260
  # Hash values are shallow merged
370
- when 'puppetdb', 'plugin-hooks', 'plugin_hooks', 'apply-settings', 'apply_settings', 'log'
261
+ when 'apply-settings', 'log', 'plugin-hooks', 'puppetdb'
371
262
  val1.merge(val2)
372
263
  # Disabled warnings are concatenated
373
264
  when 'disable-warnings'
@@ -407,7 +298,7 @@ module Bolt
407
298
  end
408
299
 
409
300
  # Filter hashes to only include valid options
410
- %w[apply-settings apply_settings module-install puppetfile].each do |opt|
301
+ %w[apply-settings module-install].each do |opt|
411
302
  @data[opt] = @data[opt].slice(*OPTIONS.dig(opt, :properties).keys)
412
303
  end
413
304
  end
@@ -433,13 +324,6 @@ module Bolt
433
324
 
434
325
  name = normalize_log(key)
435
326
  acc[name] = val.slice('append', 'level').transform_keys(&:to_sym)
436
-
437
- next unless acc[name][:level] == 'notice'
438
-
439
- Bolt::Logger.deprecate(
440
- "notice_log_level",
441
- "Log level 'notice' is deprecated and will be removed in Bolt 3.0. Use 'info' instead."
442
- )
443
327
  end
444
328
  end
445
329
 
@@ -451,7 +335,7 @@ module Bolt
451
335
  )
452
336
  end
453
337
 
454
- if @project.modules && @data['modulepath']&.include?(@project.managed_moduledir.to_s)
338
+ if @data['modulepath']&.include?(@project.managed_moduledir.to_s)
455
339
  raise Bolt::ValidationError,
456
340
  "Found invalid path in modulepath: #{@project.managed_moduledir}. This path "\
457
341
  "is automatically appended to the modulepath and cannot be configured."
@@ -469,37 +353,6 @@ module Bolt
469
353
  if File.exist?(default_inventoryfile)
470
354
  Bolt::Util.validate_file('inventory file', default_inventoryfile)
471
355
  end
472
-
473
- # Warn the user how they should be using the 'puppetfile' or
474
- # 'module-install' config options. We don't error here since these
475
- # settings can be set at the user or system level.
476
- if @project.modules && puppetfile_config.any? && module_install.empty?
477
- command = Bolt::Util.powershell? ? 'Update-BoltProject' : 'bolt project migrate'
478
- Bolt::Logger.warn(
479
- "module_install_config",
480
- "Detected configuration for 'puppetfile'. This setting is not "\
481
- "used when 'modules' is configured. Use 'module-install' instead. "\
482
- "To automatically update your project configuration, run '#{command}'."
483
- )
484
- elsif @project.modules.nil? && puppetfile_config.empty? && module_install.any?
485
- Bolt::Logger.warn(
486
- "module_install_config",
487
- "Detected configuration for 'module-install'. This setting is not "\
488
- "used when 'modules' is not configured. Use 'puppetfile' instead."
489
- )
490
- elsif @project.modules && puppetfile_config.any? && module_install.any?
491
- Bolt::Logger.warn(
492
- "module_install_config",
493
- "Detected configuration for 'puppetfile' and 'module-install'. Using "\
494
- "configuration for 'module-install' because 'modules' is also configured."
495
- )
496
- elsif @project.modules.nil? && puppetfile_config.any? && module_install.any?
497
- Bolt::Logger.warn(
498
- "module_install_config",
499
- "Detected configuration for 'puppetfile' and 'module-install'. Using "\
500
- "configuration for 'puppetfile' because 'modules' is not configured."
501
- )
502
- end
503
356
  end
504
357
 
505
358
  def default_inventoryfile
@@ -515,21 +368,15 @@ module Bolt
515
368
  end
516
369
 
517
370
  def puppetfile
518
- @puppetfile || @project.puppetfile
371
+ @project.puppetfile
519
372
  end
520
373
 
521
374
  def modulepath
522
- path = @data['modulepath'] || @project.modulepath
523
-
524
- if @project.modules
525
- path + [@project.managed_moduledir.to_s]
526
- else
527
- path
528
- end
375
+ (@data['modulepath'] || @project.modulepath) + [@project.managed_moduledir.to_s]
529
376
  end
530
377
 
531
378
  def modulepath=(value)
532
- @data['modulepath'] = value
379
+ @data['modulepath'] = Array(value)
533
380
  end
534
381
 
535
382
  def plugin_cache
@@ -580,27 +427,12 @@ module Bolt
580
427
  @data['compile-concurrency']
581
428
  end
582
429
 
583
- def puppetfile_config
584
- @data['puppetfile']
585
- end
586
-
587
430
  def plugins
588
431
  @data['plugins']
589
432
  end
590
433
 
591
434
  def plugin_hooks
592
- if @data['plugin-hooks'].any? && @data['plugin_hooks'].any?
593
- Bolt::Logger.warn_once(
594
- "plugin_hooks_conflict",
595
- "Detected configuration for 'plugin-hooks' and 'plugin_hooks'. Bolt will ignore 'plugin_hooks'."
596
- )
597
-
598
- @data['plugin-hooks']
599
- elsif @data['plugin-hooks'].any?
600
- @data['plugin-hooks']
601
- else
602
- @data['plugin_hooks']
603
- end
435
+ @data['plugin-hooks']
604
436
  end
605
437
 
606
438
  def trusted_external
@@ -608,18 +440,7 @@ module Bolt
608
440
  end
609
441
 
610
442
  def apply_settings
611
- if @data['apply-settings'].any? && @data['apply_settings'].any?
612
- Bolt::Logger.warn_once(
613
- "apply_settings_conflict",
614
- "Detected configuration for 'apply-settings' and 'apply_settings'. Bolt will ignore 'apply_settings'."
615
- )
616
-
617
- @data['apply-settings']
618
- elsif @data['apply-settings'].any?
619
- @data['apply-settings']
620
- else
621
- @data['apply_settings']
622
- end
443
+ @data['apply-settings']
623
444
  end
624
445
 
625
446
  def transport
@@ -53,42 +53,6 @@ module Bolt
53
53
  # Definitions used to validate config options.
54
54
  # https://github.com/puppetlabs/bolt/blob/main/schemas/README.md
55
55
  OPTIONS = {
56
- "apply_settings" => {
57
- description: "A map of Puppet settings to use when applying Puppet code using the `apply` "\
58
- "plan function or the `bolt apply` command.",
59
- type: Hash,
60
- properties: {
61
- "evaltrace" => {
62
- description: "Whether each resource should log when it is being evaluated.",
63
- type: [TrueClass, FalseClass],
64
- _example: true,
65
- _default: false
66
- },
67
- "log_level" => {
68
- description: "The log level for logs in apply reports from Puppet. These can be seen "\
69
- "in ApplyResults.",
70
- type: String,
71
- enum: %w[debug info notice warning err alert emerg crit],
72
- _example: "debug",
73
- _default: "notice"
74
- },
75
- "show_diff" => {
76
- description: "Whether to log and report a contextual diff.",
77
- type: [TrueClass, FalseClass],
78
- _example: true,
79
- _default: false
80
- },
81
- "trace" => {
82
- description: "Whether to print stack traces on some errors. Will print internal Ruby "\
83
- "stack trace interleaved with Puppet function frames.",
84
- type: [TrueClass, FalseClass],
85
- _example: true,
86
- _default: false
87
- }
88
- },
89
- _plugin: false,
90
- _deprecation: "This option will be removed in Bolt 3.0. Use `apply-settings` instead."
91
- },
92
56
  "apply-settings" => {
93
57
  description: "A map of Puppet settings to use when applying Puppet code using the `apply` "\
94
58
  "plan function or the `bolt apply` command.",
@@ -182,18 +146,6 @@ module Bolt
182
146
  _plugin: false,
183
147
  _example: {}
184
148
  },
185
- "inventoryfile" => {
186
- description: "The path to a structured data inventory file used to refer to groups of targets on the "\
187
- "command line and from plans. Read more about using inventory files in [Inventory "\
188
- "files](inventory_file_v2.md).",
189
- type: String,
190
- _plugin: false,
191
- _deprecation: "This option will be removed in Bolt 3.0. Use the `--inventoryfile` command-line option "\
192
- "to use a non-default inventory file or move the file contents to `inventory.yaml` in the "\
193
- "project directory.",
194
- _example: "~/.puppetlabs/bolt/inventory.yaml",
195
- _default: "project/inventory.yaml"
196
- },
197
149
  "plugin-cache" => {
198
150
  description: "This feature is experimental. Enable plugin caching and set the time-to-live.",
199
151
  type: Hash,
@@ -225,7 +177,7 @@ module Bolt
225
177
  "level" => {
226
178
  description: "The type of information to log.",
227
179
  type: String,
228
- enum: %w[trace debug error info notice warn fatal any],
180
+ enum: %w[trace debug error info warn fatal any],
229
181
  _default: "warn"
230
182
  }
231
183
  }
@@ -244,7 +196,7 @@ module Bolt
244
196
  "level" => {
245
197
  description: "The type of information to log.",
246
198
  type: String,
247
- enum: %w[trace debug error info notice warn fatal any],
199
+ enum: %w[trace debug error info warn fatal any],
248
200
  _default: "warn"
249
201
  }
250
202
  }
@@ -262,7 +214,7 @@ module Bolt
262
214
  },
263
215
  _plugin: false,
264
216
  _example: ["~/.puppetlabs/bolt/modules", "~/.puppetlabs/bolt/site-modules"],
265
- _default: ["project/modules", "project/site-modules", "project/site"]
217
+ _default: ["project/modules"]
266
218
  },
267
219
  "module-install" => {
268
220
  description: "Options that configure where Bolt downloads modules from. This option is only used when "\
@@ -349,6 +301,7 @@ module Bolt
349
301
  ]
350
302
  },
351
303
  _plugin: false,
304
+ _default: [],
352
305
  _example: [
353
306
  "puppetlabs-facts",
354
307
  { "name" => "puppetlabs-mysql" },
@@ -377,16 +330,6 @@ module Bolt
377
330
  _plugin: false,
378
331
  _example: ["myproject", "myproject::foo", "myproject::bar", "myproject::deploy::*"]
379
332
  },
380
- "plugin_hooks" => {
381
- description: "A map of [plugin hooks](writing_plugins.md#hooks) and which plugins a hook should use. "\
382
- "The only configurable plugin hook is `puppet_library`, which can use two possible plugins: "\
383
- "[`puppet_agent`](https://github.com/puppetlabs/puppetlabs-puppet_agent#puppet_agentinstall) "\
384
- "and [`task`](using_plugins.md#task).",
385
- type: Hash,
386
- _plugin: true,
387
- _example: { "puppet_library" => { "plugin" => "puppet_agent", "version" => "6.15.0", "_run_as" => "root" } },
388
- _deprecation: "This option will be removed in Bolt 3.0. Use `plugin-hooks` instead."
389
- },
390
333
  "plugin-hooks" => {
391
334
  description: "A map of [plugin hooks](writing_plugins.md#hooks) and which plugins a hook should use. "\
392
335
  "The only configurable plugin hook is `puppet_library`, which can use two possible plugins: "\
@@ -464,42 +407,6 @@ module Bolt
464
407
  },
465
408
  _plugin: true
466
409
  },
467
- "puppetfile" => {
468
- description: "A map containing options for the `bolt puppetfile install` command and "\
469
- "`Install-BoltPuppetfile` cmdlet.",
470
- type: Hash,
471
- properties: {
472
- "forge" => {
473
- description: "A subsection that can have its own `proxy` setting to set an HTTP proxy for Forge "\
474
- "operations only, and a `baseurl` setting to specify a different Forge host.",
475
- type: Hash,
476
- properties: {
477
- "baseurl" => {
478
- description: "The URL to the Forge host.",
479
- type: String,
480
- format: "uri",
481
- _example: "https://forge.example.com"
482
- },
483
- "proxy" => {
484
- description: "The HTTP proxy to use for Forge operations.",
485
- type: String,
486
- format: "uri",
487
- _example: "https://my-forge-proxy.com:8080"
488
- }
489
- },
490
- _example: { "baseurl" => "https://forge.example.com", "proxy" => "https://my-forge-proxy.com:8080" }
491
- },
492
- "proxy" => {
493
- description: "The HTTP proxy to use for Git and Forge operations.",
494
- type: String,
495
- format: "uri",
496
- _example: "https://my-proxy.com:8080"
497
- }
498
- },
499
- _deprecation: "This option will be removed in Bolt 3.0. Update your project to use the module "\
500
- "management feature. For more information, see https://pup.pt/bolt-module-migrate.",
501
- _plugin: false
502
- },
503
410
  "save-rerun" => {
504
411
  description: "Whether to update `.rerun.json` in the Bolt project directory. If "\
505
412
  "your target names include passwords, set this value to `false` to avoid "\
@@ -543,8 +450,8 @@ module Bolt
543
450
 
544
451
  # Options that configure the inventory, specifically the default transport
545
452
  # used by targets and the transports themselves. These options are used in
546
- # bolt.yaml, under a 'config' key in inventory.yaml, and under the
547
- # 'inventory-config' key in bolt-defaults.yaml.
453
+ # bolt-defaults.yaml under 'inventory-config' and in inventory.yaml under
454
+ # 'config'.
548
455
  INVENTORY_OPTIONS = {
549
456
  "transport" => {
550
457
  description: "The default transport to use when the transport for a target is not "\
@@ -595,30 +502,20 @@ module Bolt
595
502
  }
596
503
  }.freeze
597
504
 
598
- # Options that are available in a bolt.yaml file
599
- BOLT_OPTIONS = %w[
600
- apply-settings
601
- apply_settings
602
- color
505
+ # Options that are available on the command line
506
+ # This only includes options where users can provide arbitrary
507
+ # values from the command-line, allowing the validator to check them
508
+ CLI_OPTIONS = %w[
603
509
  compile-concurrency
604
510
  concurrency
605
511
  format
606
- hiera-config
607
- inventoryfile
608
512
  log
609
513
  modulepath
610
- plugin-hooks
611
- plugin_hooks
612
- plugins
613
- puppetdb
614
- puppetfile
615
- save-rerun
616
- spinner
617
- trusted-external-command
514
+ transport
618
515
  ].freeze
619
516
 
620
517
  # Options that are available in a bolt-defaults.yaml file
621
- BOLT_DEFAULTS_OPTIONS = %w[
518
+ DEFAULTS_OPTIONS = %w[
622
519
  color
623
520
  compile-concurrency
624
521
  concurrency
@@ -629,25 +526,21 @@ module Bolt
629
526
  module-install
630
527
  plugin-cache
631
528
  plugin-hooks
632
- plugin_hooks
633
529
  plugins
634
530
  puppetdb
635
- puppetfile
636
531
  save-rerun
637
532
  spinner
638
533
  ].freeze
639
534
 
640
535
  # Options that are available in a bolt-project.yaml file
641
- BOLT_PROJECT_OPTIONS = %w[
536
+ PROJECT_OPTIONS = %w[
642
537
  apply-settings
643
- apply_settings
644
538
  color
645
539
  compile-concurrency
646
540
  concurrency
647
541
  disable-warnings
648
542
  format
649
543
  hiera-config
650
- inventoryfile
651
544
  log
652
545
  modulepath
653
546
  module-install
@@ -656,10 +549,8 @@ module Bolt
656
549
  plans
657
550
  plugin-cache
658
551
  plugin-hooks
659
- plugin_hooks
660
552
  plugins
661
553
  puppetdb
662
- puppetfile
663
554
  save-rerun
664
555
  spinner
665
556
  tasks