bolt 1.15.0 → 1.16.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.

Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/bolt-modules/boltlib/lib/puppet/datatypes/target.rb +1 -1
  3. data/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb +4 -4
  4. data/lib/bolt.rb +3 -0
  5. data/lib/bolt/analytics.rb +7 -2
  6. data/lib/bolt/applicator.rb +6 -2
  7. data/lib/bolt/bolt_option_parser.rb +4 -4
  8. data/lib/bolt/cli.rb +8 -4
  9. data/lib/bolt/config.rb +6 -6
  10. data/lib/bolt/executor.rb +2 -7
  11. data/lib/bolt/inventory.rb +37 -6
  12. data/lib/bolt/inventory/group2.rb +314 -0
  13. data/lib/bolt/inventory/inventory2.rb +261 -0
  14. data/lib/bolt/outputter/human.rb +3 -1
  15. data/lib/bolt/pal.rb +8 -7
  16. data/lib/bolt/puppetdb/client.rb +6 -5
  17. data/lib/bolt/target.rb +34 -14
  18. data/lib/bolt/task.rb +2 -2
  19. data/lib/bolt/transport/base.rb +2 -2
  20. data/lib/bolt/transport/docker.rb +1 -1
  21. data/lib/bolt/transport/docker/connection.rb +2 -0
  22. data/lib/bolt/transport/local.rb +9 -181
  23. data/lib/bolt/transport/local/shell.rb +202 -12
  24. data/lib/bolt/transport/local_windows.rb +203 -0
  25. data/lib/bolt/transport/orch.rb +6 -4
  26. data/lib/bolt/transport/orch/connection.rb +6 -2
  27. data/lib/bolt/transport/ssh.rb +10 -150
  28. data/lib/bolt/transport/ssh/connection.rb +15 -116
  29. data/lib/bolt/transport/sudoable.rb +163 -0
  30. data/lib/bolt/transport/sudoable/connection.rb +76 -0
  31. data/lib/bolt/transport/sudoable/tmpdir.rb +59 -0
  32. data/lib/bolt/transport/winrm.rb +4 -4
  33. data/lib/bolt/transport/winrm/connection.rb +1 -0
  34. data/lib/bolt/util.rb +2 -0
  35. data/lib/bolt/version.rb +1 -1
  36. data/lib/bolt_ext/puppetdb_inventory.rb +0 -1
  37. data/lib/bolt_server/transport_app.rb +3 -1
  38. data/lib/logging_extensions/logging.rb +13 -0
  39. data/lib/plan_executor/orch_client.rb +4 -0
  40. metadata +23 -2
@@ -9,8 +9,8 @@ module Bolt
9
9
  class WinRM < Base
10
10
  def self.options
11
11
  %w[
12
- port user password connect-timeout ssl ssl-verify tmpdir cacert
13
- extensions interpreters file-protocol smb-port
12
+ host port user password connect-timeout ssl ssl-verify tmpdir
13
+ cacert extensions interpreters file-protocol smb-port
14
14
  ]
15
15
  end
16
16
 
@@ -70,8 +70,8 @@ module Bolt
70
70
  ensure
71
71
  begin
72
72
  conn&.disconnect
73
- rescue StandardError => ex
74
- logger.info("Failed to close connection to #{target.uri} : #{ex.message}")
73
+ rescue StandardError => e
74
+ logger.info("Failed to close connection to #{target.uri} : #{e.message}")
75
75
  end
76
76
  end
77
77
 
@@ -12,6 +12,7 @@ module Bolt
12
12
  DEFAULT_EXTENSIONS = ['.ps1', '.rb', '.pp'].freeze
13
13
 
14
14
  def initialize(target, transport_logger)
15
+ raise Bolt::ValidationError, "Target #{target.name} does not have a host" unless target.host
15
16
  @target = target
16
17
 
17
18
  default_port = target.options['ssl'] ? HTTPS_PORT : HTTP_PORT
data/lib/bolt/util.rb CHANGED
@@ -4,6 +4,8 @@ module Bolt
4
4
  module Util
5
5
  class << self
6
6
  def read_config_file(path, default_paths = nil, file_name = 'file')
7
+ require 'yaml'
8
+
7
9
  logger = Logging.logger[self]
8
10
  path_passed = path
9
11
  if path.nil? && default_paths
data/lib/bolt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bolt
4
- VERSION = '1.15.0'
4
+ VERSION = '1.16.0'
5
5
  end
@@ -3,7 +3,6 @@
3
3
 
4
4
  require 'bolt/puppetdb'
5
5
  require 'json'
6
- require 'httpclient'
7
6
  require 'optparse'
8
7
  require 'yaml'
9
8
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'sinatra'
4
+ require 'addressable/uri'
4
5
  require 'bolt'
5
6
  require 'bolt/error'
6
7
  require 'bolt/target'
@@ -24,7 +25,7 @@ module BoltServer
24
25
  Addressable::URI.parse("file:task"))
25
26
  JSON::Validator.add_schema(shared_schema)
26
27
 
27
- @executor = Bolt::Executor.new(0, load_config: false)
28
+ @executor = Bolt::Executor.new(0)
28
29
 
29
30
  @file_cache = BoltServer::FileCache.new(@config).setup
30
31
 
@@ -78,6 +79,7 @@ module BoltServer
78
79
  opts['private-key'] = { 'key-data' => opts['private-key-content'] }
79
80
  opts.delete('private-key-content')
80
81
  end
82
+ opts['load-config'] = false
81
83
 
82
84
  target = [Bolt::Target.new(body['target']['hostname'], opts)]
83
85
 
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'logging'
4
+
5
+ module LoggingExtensions
6
+ # the logging gem always sets itself up to initialize little-plugger
7
+ # https://github.com/TwP/logging/commit/5aeeffaaa9fe483c2258a23d3b9e92adfafb3b2e
8
+ # little-plugger calls Gem.find_files, incurring an expensive gem scan
9
+ def initialize_plugins; end
10
+ end
11
+
12
+ # monkey patch Logging to override the extended method with a no-op
13
+ Logging.extend(LoggingExtensions)
@@ -136,6 +136,10 @@ module PlanExecutor
136
136
  end
137
137
 
138
138
  def pack(directory)
139
+ # lazy-load expensive gem code
140
+ require 'minitar'
141
+ require 'zlib'
142
+
139
143
  start_time = Time.now
140
144
  io = StringIO.new
141
145
  output = Minitar::Output.new(Zlib::GzipWriter.new(io))
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: 1.15.0
4
+ version: 1.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-29 00:00:00.000000000 Z
11
+ date: 2019-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.34'
69
+ - !ruby/object:Gem::Dependency
70
+ name: hiera-eyaml
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: logging
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -351,6 +365,8 @@ files:
351
365
  - lib/bolt/executor.rb
352
366
  - lib/bolt/inventory.rb
353
367
  - lib/bolt/inventory/group.rb
368
+ - lib/bolt/inventory/group2.rb
369
+ - lib/bolt/inventory/inventory2.rb
354
370
  - lib/bolt/logger.rb
355
371
  - lib/bolt/node/errors.rb
356
372
  - lib/bolt/node/output.rb
@@ -379,12 +395,16 @@ files:
379
395
  - lib/bolt/transport/docker/connection.rb
380
396
  - lib/bolt/transport/local.rb
381
397
  - lib/bolt/transport/local/shell.rb
398
+ - lib/bolt/transport/local_windows.rb
382
399
  - lib/bolt/transport/orch.rb
383
400
  - lib/bolt/transport/orch/connection.rb
384
401
  - lib/bolt/transport/powershell.rb
385
402
  - lib/bolt/transport/remote.rb
386
403
  - lib/bolt/transport/ssh.rb
387
404
  - lib/bolt/transport/ssh/connection.rb
405
+ - lib/bolt/transport/sudoable.rb
406
+ - lib/bolt/transport/sudoable/connection.rb
407
+ - lib/bolt/transport/sudoable/tmpdir.rb
388
408
  - lib/bolt/transport/winrm.rb
389
409
  - lib/bolt/transport/winrm/connection.rb
390
410
  - lib/bolt/util.rb
@@ -407,6 +427,7 @@ files:
407
427
  - lib/bolt_spec/plans/action_stubs/upload_stub.rb
408
428
  - lib/bolt_spec/plans/mock_executor.rb
409
429
  - lib/bolt_spec/run.rb
430
+ - lib/logging_extensions/logging.rb
410
431
  - lib/plan_executor/app.rb
411
432
  - lib/plan_executor/applicator.rb
412
433
  - lib/plan_executor/config.rb