bolt 2.7.0 → 2.11.1

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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/Puppetfile +4 -3
  3. data/bolt-modules/boltlib/lib/puppet/datatypes/applyresult.rb +2 -0
  4. data/bolt-modules/boltlib/lib/puppet/datatypes/resourceinstance.rb +27 -0
  5. data/bolt-modules/boltlib/lib/puppet/datatypes/result.rb +2 -0
  6. data/bolt-modules/boltlib/lib/puppet/datatypes/resultset.rb +2 -0
  7. data/bolt-modules/boltlib/lib/puppet/datatypes/target.rb +4 -3
  8. data/bolt-modules/boltlib/lib/puppet/functions/run_task_with.rb +192 -0
  9. data/bolt-modules/boltlib/lib/puppet/functions/set_resources.rb +122 -0
  10. data/bolt-modules/boltlib/types/planresult.pp +12 -1
  11. data/bolt-modules/file/lib/puppet/functions/file/exists.rb +3 -1
  12. data/bolt-modules/file/lib/puppet/functions/file/join.rb +1 -1
  13. data/bolt-modules/file/lib/puppet/functions/file/read.rb +2 -1
  14. data/bolt-modules/file/lib/puppet/functions/file/readable.rb +3 -1
  15. data/bolt-modules/file/lib/puppet/functions/file/write.rb +3 -1
  16. data/lib/bolt/applicator.rb +3 -2
  17. data/lib/bolt/apply_inventory.rb +1 -1
  18. data/lib/bolt/apply_result.rb +1 -1
  19. data/lib/bolt/apply_target.rb +11 -2
  20. data/lib/bolt/bolt_option_parser.rb +22 -6
  21. data/lib/bolt/cli.rb +52 -22
  22. data/lib/bolt/config.rb +57 -27
  23. data/lib/bolt/config/transport/base.rb +3 -3
  24. data/lib/bolt/config/transport/docker.rb +2 -0
  25. data/lib/bolt/config/transport/local.rb +2 -0
  26. data/lib/bolt/config/transport/orch.rb +4 -2
  27. data/lib/bolt/config/transport/remote.rb +2 -0
  28. data/lib/bolt/config/transport/ssh.rb +51 -2
  29. data/lib/bolt/config/transport/winrm.rb +3 -1
  30. data/lib/bolt/executor.rb +16 -0
  31. data/lib/bolt/inventory.rb +2 -1
  32. data/lib/bolt/inventory/group.rb +1 -0
  33. data/lib/bolt/inventory/inventory.rb +5 -0
  34. data/lib/bolt/inventory/target.rb +17 -1
  35. data/lib/bolt/node/output.rb +1 -1
  36. data/lib/bolt/outputter/human.rb +5 -4
  37. data/lib/bolt/outputter/json.rb +1 -1
  38. data/lib/bolt/pal.rb +32 -14
  39. data/lib/bolt/pal/yaml_plan.rb +1 -0
  40. data/lib/bolt/plugin.rb +14 -8
  41. data/lib/bolt/plugin/module.rb +40 -7
  42. data/lib/bolt/plugin/puppetdb.rb +5 -2
  43. data/lib/bolt/project.rb +135 -0
  44. data/lib/bolt/puppetdb/config.rb +16 -28
  45. data/lib/bolt/rerun.rb +1 -1
  46. data/lib/bolt/resource_instance.rb +126 -0
  47. data/lib/bolt/result.rb +46 -23
  48. data/lib/bolt/result_set.rb +2 -5
  49. data/lib/bolt/secret.rb +20 -4
  50. data/lib/bolt/shell/bash.rb +12 -5
  51. data/lib/bolt/shell/powershell.rb +12 -4
  52. data/lib/bolt/target.rb +16 -1
  53. data/lib/bolt/transport/base.rb +24 -8
  54. data/lib/bolt/transport/orch.rb +4 -0
  55. data/lib/bolt/transport/ssh.rb +6 -2
  56. data/lib/bolt/transport/ssh/connection.rb +4 -0
  57. data/lib/bolt/transport/ssh/exec_connection.rb +110 -0
  58. data/lib/bolt/transport/winrm/connection.rb +6 -2
  59. data/lib/bolt/version.rb +1 -1
  60. data/lib/bolt_server/pe/pal.rb +1 -38
  61. data/lib/bolt_server/transport_app.rb +7 -7
  62. data/lib/bolt_spec/bolt_context.rb +3 -6
  63. data/lib/bolt_spec/plans.rb +1 -1
  64. data/lib/bolt_spec/plans/mock_executor.rb +1 -0
  65. data/lib/bolt_spec/run.rb +10 -13
  66. metadata +10 -7
  67. data/lib/bolt/boltdir.rb +0 -54
  68. data/lib/bolt/plugin/pkcs7.rb +0 -104
  69. data/lib/bolt/secret/base.rb +0 -41
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bolt
4
- class Secret
5
- class Base
6
- def hooks
7
- %i[resolve_reference secret_encrypt secret_decrypt secret_createkeys validate_resolve_reference]
8
- end
9
-
10
- def encode(raw)
11
- coded = Base64.encode64(raw).strip
12
- "ENC[#{name.upcase},#{coded}]"
13
- end
14
-
15
- def decode(code)
16
- format = %r{\AENC\[(?<plugin>\w+),(?<encoded>[\w\s+-=/]+)\]\s*\z}
17
- match = format.match(code)
18
-
19
- raise Bolt::ValidationError, "Could not parse as an encrypted value: #{code}" unless match
20
-
21
- raw = Base64.decode64(match[:encoded])
22
- [raw, match[:plugin]]
23
- end
24
-
25
- def secret_encrypt(opts)
26
- encrypted = encrypt_value(opts['plaintext_value'])
27
- encode(encrypted)
28
- end
29
-
30
- def secret_decrypt(opts)
31
- raw, _plugin = decode(opts['encrypted_value'])
32
- decrypt_value(raw)
33
- end
34
- alias resolve_reference secret_decrypt
35
-
36
- def validate_resolve_reference(opts)
37
- decode(opts['encrypted_value'])
38
- end
39
- end
40
- end
41
- end