bolt 2.15.0 → 2.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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/bolt-modules/boltlib/lib/puppet/functions/add_facts.rb +1 -0
  3. data/bolt-modules/boltlib/lib/puppet/functions/add_to_group.rb +1 -0
  4. data/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb +1 -0
  5. data/bolt-modules/boltlib/lib/puppet/functions/facts.rb +1 -0
  6. data/bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb +1 -0
  7. data/bolt-modules/boltlib/lib/puppet/functions/get_resources.rb +1 -0
  8. data/bolt-modules/boltlib/lib/puppet/functions/get_target.rb +1 -0
  9. data/bolt-modules/boltlib/lib/puppet/functions/get_targets.rb +1 -0
  10. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb +1 -0
  11. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +1 -0
  12. data/bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb +1 -0
  13. data/bolt-modules/boltlib/lib/puppet/functions/resolve_references.rb +1 -0
  14. data/bolt-modules/boltlib/lib/puppet/functions/resource.rb +1 -0
  15. data/bolt-modules/boltlib/lib/puppet/functions/run_command.rb +1 -0
  16. data/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb +2 -1
  17. data/bolt-modules/boltlib/lib/puppet/functions/run_script.rb +1 -0
  18. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +2 -1
  19. data/bolt-modules/boltlib/lib/puppet/functions/set_config.rb +1 -0
  20. data/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb +1 -0
  21. data/bolt-modules/boltlib/lib/puppet/functions/set_resources.rb +1 -0
  22. data/bolt-modules/boltlib/lib/puppet/functions/set_var.rb +1 -0
  23. data/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb +1 -0
  24. data/bolt-modules/boltlib/lib/puppet/functions/vars.rb +1 -0
  25. data/bolt-modules/boltlib/lib/puppet/functions/wait_until_available.rb +1 -0
  26. data/bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb +1 -0
  27. data/bolt-modules/boltlib/lib/puppet/functions/write_file.rb +1 -0
  28. data/bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb +2 -0
  29. data/bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb +2 -0
  30. data/bolt-modules/file/lib/puppet/functions/file/exists.rb +1 -0
  31. data/bolt-modules/file/lib/puppet/functions/file/join.rb +2 -0
  32. data/bolt-modules/file/lib/puppet/functions/file/read.rb +2 -0
  33. data/bolt-modules/file/lib/puppet/functions/file/readable.rb +2 -0
  34. data/bolt-modules/file/lib/puppet/functions/file/write.rb +2 -0
  35. data/bolt-modules/out/lib/puppet/functions/out/message.rb +2 -0
  36. data/bolt-modules/prompt/lib/puppet/functions/prompt.rb +1 -0
  37. data/bolt-modules/system/lib/puppet/functions/system/env.rb +2 -0
  38. data/lib/bolt/applicator.rb +2 -1
  39. data/lib/bolt/bolt_option_parser.rb +7 -7
  40. data/lib/bolt/cli.rb +3 -4
  41. data/lib/bolt/config.rb +14 -117
  42. data/lib/bolt/config/options.rb +321 -0
  43. data/lib/bolt/config/transport/base.rb +16 -16
  44. data/lib/bolt/config/transport/docker.rb +9 -23
  45. data/lib/bolt/config/transport/local.rb +6 -44
  46. data/lib/bolt/config/transport/options.rb +305 -0
  47. data/lib/bolt/config/transport/orch.rb +9 -18
  48. data/lib/bolt/config/transport/remote.rb +3 -6
  49. data/lib/bolt/config/transport/ssh.rb +55 -149
  50. data/lib/bolt/config/transport/winrm.rb +18 -47
  51. data/lib/bolt/inventory/group.rb +1 -1
  52. data/lib/bolt/inventory/inventory.rb +0 -14
  53. data/lib/bolt/inventory/target.rb +18 -5
  54. data/lib/bolt/pal.rb +3 -1
  55. data/lib/bolt/project.rb +21 -38
  56. data/lib/bolt/shell/bash.rb +9 -9
  57. data/lib/bolt/shell/powershell.rb +2 -1
  58. data/lib/bolt/transport/docker.rb +1 -1
  59. data/lib/bolt/version.rb +1 -1
  60. metadata +4 -2
@@ -35,7 +35,7 @@ module Bolt
35
35
  def upload(source, destination, options = {})
36
36
  running_as(options[:run_as]) do
37
37
  with_tmpdir do |dir|
38
- basename = File.basename(destination)
38
+ basename = File.basename(source)
39
39
  tmpfile = File.join(dir.to_s, basename)
40
40
  conn.copy_file(source, tmpfile)
41
41
  # pass over file ownership if we're using run-as to be a different user
@@ -332,14 +332,14 @@ module Bolt
332
332
  end
333
333
 
334
334
  if escalate
335
- if use_sudo
336
- sudo_exec = target.options['sudo-executable'] || "sudo"
337
- sudo_flags = [sudo_exec, "-S", "-H", "-u", run_as, "-p", sudo_prompt]
338
- sudo_flags += ["-E"] if options[:environment]
339
- sudo_str = Shellwords.shelljoin(sudo_flags)
340
- else
341
- sudo_str = Shellwords.shelljoin(@target.options['run-as-command'] + [run_as])
342
- end
335
+ sudo_str = if use_sudo
336
+ sudo_exec = target.options['sudo-executable'] || "sudo"
337
+ sudo_flags = [sudo_exec, "-S", "-H", "-u", run_as, "-p", sudo_prompt]
338
+ sudo_flags += ["-E"] if options[:environment]
339
+ Shellwords.shelljoin(sudo_flags)
340
+ else
341
+ Shellwords.shelljoin(@target.options['run-as-command'] + [run_as])
342
+ end
343
343
  command_str = build_sudoable_command_str(command_str, sudo_str, @sudo_id, options)
344
344
  end
345
345
 
@@ -111,7 +111,8 @@ module Bolt
111
111
  end
112
112
 
113
113
  def mkdirs(dirs)
114
- mkdir_command = "mkdir -Force #{dirs.uniq.sort.join(',')}"
114
+ paths = dirs.uniq.sort.join('","')
115
+ mkdir_command = "mkdir -Force -Path (\"#{paths}\")"
115
116
  result = execute(mkdir_command)
116
117
  if result.exit_code != 0
117
118
  message = "Could not create directories: #{result.stderr.string}"
@@ -20,7 +20,7 @@ module Bolt
20
20
  def upload(target, source, destination, _options = {})
21
21
  with_connection(target) do |conn|
22
22
  conn.with_remote_tmpdir do |dir|
23
- basename = File.basename(destination)
23
+ basename = File.basename(source)
24
24
  tmpfile = "#{dir}/#{basename}"
25
25
  if File.directory?(source)
26
26
  conn.write_remote_directory(source, tmpfile)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bolt
4
- VERSION = '2.15.0'
4
+ VERSION = '2.16.0'
5
5
  end
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.15.0
4
+ version: 2.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: 2020-06-22 00:00:00.000000000 Z
11
+ date: 2020-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -460,9 +460,11 @@ files:
460
460
  - lib/bolt/catalog/logging.rb
461
461
  - lib/bolt/cli.rb
462
462
  - lib/bolt/config.rb
463
+ - lib/bolt/config/options.rb
463
464
  - lib/bolt/config/transport/base.rb
464
465
  - lib/bolt/config/transport/docker.rb
465
466
  - lib/bolt/config/transport/local.rb
467
+ - lib/bolt/config/transport/options.rb
466
468
  - lib/bolt/config/transport/orch.rb
467
469
  - lib/bolt/config/transport/remote.rb
468
470
  - lib/bolt/config/transport/ssh.rb