bolt 2.14.0 → 2.19.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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/Puppetfile +1 -1
  3. data/bolt-modules/boltlib/lib/puppet/functions/add_facts.rb +1 -0
  4. data/bolt-modules/boltlib/lib/puppet/functions/add_to_group.rb +1 -0
  5. data/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb +20 -9
  6. data/bolt-modules/boltlib/lib/puppet/functions/catch_errors.rb +1 -0
  7. data/bolt-modules/boltlib/lib/puppet/functions/facts.rb +1 -0
  8. data/bolt-modules/boltlib/lib/puppet/functions/fail_plan.rb +1 -0
  9. data/bolt-modules/boltlib/lib/puppet/functions/get_resources.rb +1 -0
  10. data/bolt-modules/boltlib/lib/puppet/functions/get_target.rb +1 -0
  11. data/bolt-modules/boltlib/lib/puppet/functions/get_targets.rb +1 -0
  12. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_fact.rb +1 -0
  13. data/bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb +1 -0
  14. data/bolt-modules/boltlib/lib/puppet/functions/remove_from_group.rb +1 -0
  15. data/bolt-modules/boltlib/lib/puppet/functions/resolve_references.rb +1 -0
  16. data/bolt-modules/boltlib/lib/puppet/functions/resource.rb +1 -0
  17. data/bolt-modules/boltlib/lib/puppet/functions/run_command.rb +3 -0
  18. data/bolt-modules/boltlib/lib/puppet/functions/run_plan.rb +2 -1
  19. data/bolt-modules/boltlib/lib/puppet/functions/run_script.rb +7 -4
  20. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +2 -1
  21. data/bolt-modules/boltlib/lib/puppet/functions/set_config.rb +1 -0
  22. data/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb +1 -0
  23. data/bolt-modules/boltlib/lib/puppet/functions/set_resources.rb +1 -0
  24. data/bolt-modules/boltlib/lib/puppet/functions/set_var.rb +1 -0
  25. data/bolt-modules/boltlib/lib/puppet/functions/upload_file.rb +1 -0
  26. data/bolt-modules/boltlib/lib/puppet/functions/vars.rb +1 -0
  27. data/bolt-modules/boltlib/lib/puppet/functions/wait_until_available.rb +1 -0
  28. data/bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb +1 -0
  29. data/bolt-modules/boltlib/lib/puppet/functions/write_file.rb +1 -0
  30. data/bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb +2 -0
  31. data/bolt-modules/ctrl/lib/puppet/functions/ctrl/sleep.rb +2 -0
  32. data/bolt-modules/file/lib/puppet/functions/file/exists.rb +2 -1
  33. data/bolt-modules/file/lib/puppet/functions/file/join.rb +2 -0
  34. data/bolt-modules/file/lib/puppet/functions/file/read.rb +3 -1
  35. data/bolt-modules/file/lib/puppet/functions/file/readable.rb +3 -1
  36. data/bolt-modules/file/lib/puppet/functions/file/write.rb +2 -0
  37. data/bolt-modules/out/lib/puppet/functions/out/message.rb +2 -0
  38. data/bolt-modules/prompt/lib/puppet/functions/prompt.rb +1 -0
  39. data/bolt-modules/system/lib/puppet/functions/system/env.rb +2 -0
  40. data/lib/bolt/applicator.rb +34 -20
  41. data/lib/bolt/apply_result.rb +1 -1
  42. data/lib/bolt/bolt_option_parser.rb +30 -18
  43. data/lib/bolt/cli.rb +78 -56
  44. data/lib/bolt/config.rb +158 -128
  45. data/lib/bolt/config/options.rb +474 -0
  46. data/lib/bolt/config/transport/base.rb +16 -16
  47. data/lib/bolt/config/transport/docker.rb +9 -23
  48. data/lib/bolt/config/transport/local.rb +6 -44
  49. data/lib/bolt/config/transport/options.rb +460 -0
  50. data/lib/bolt/config/transport/orch.rb +9 -18
  51. data/lib/bolt/config/transport/remote.rb +3 -6
  52. data/lib/bolt/config/transport/ssh.rb +74 -154
  53. data/lib/bolt/config/transport/winrm.rb +18 -47
  54. data/lib/bolt/inventory/group.rb +1 -1
  55. data/lib/bolt/inventory/inventory.rb +0 -14
  56. data/lib/bolt/inventory/target.rb +18 -5
  57. data/lib/bolt/logger.rb +24 -1
  58. data/lib/bolt/outputter.rb +3 -0
  59. data/lib/bolt/outputter/rainbow.rb +90 -0
  60. data/lib/bolt/pal.rb +23 -9
  61. data/lib/bolt/pal/yaml_plan/evaluator.rb +1 -1
  62. data/lib/bolt/plugin/module.rb +2 -4
  63. data/lib/bolt/project.rb +41 -52
  64. data/lib/bolt/shell/bash.rb +30 -42
  65. data/lib/bolt/shell/powershell.rb +13 -8
  66. data/lib/bolt/shell/powershell/snippets.rb +15 -6
  67. data/lib/bolt/transport/docker.rb +9 -5
  68. data/lib/bolt/transport/orch.rb +8 -0
  69. data/lib/bolt/transport/ssh.rb +7 -1
  70. data/lib/bolt/transport/ssh/exec_connection.rb +1 -1
  71. data/lib/bolt/version.rb +1 -1
  72. metadata +18 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbe6053f1a3801adb0f1d0684f1e4616311c93bf0513a74cde2c54c82d5de503
4
- data.tar.gz: b51e4068dcceb096d5e6cec4a79d692b84d1472abe57065de1a219d8ed84a4ad
3
+ metadata.gz: 84c1deb7ddf2b30daf415a36f7949544d3113db8ae05cf927516cf0ecfb21ca8
4
+ data.tar.gz: 233d6da93d218e63e50287cbcb5ea863a16f15aa8ae6b02c62f26e87d1d43197
5
5
  SHA512:
6
- metadata.gz: ea53a6643459311d007ad7b8c2a60e5d0d4af6b0005b037295edff063a2e1f0236054d9cb5c14cec039ee8d0eb0ffa94e887b6a1ba64c3bb196f2a10cd90ce6d
7
- data.tar.gz: 7bfde56e613103081c5ce73095c82b897f5db8b973365e6fbd28dfc7f57873fce518d37fe55bb76e36f36ab9dc802a12e545621bbff44f3a389ff071898bbc2c
6
+ metadata.gz: a9432c3f9d79ae864971ed4e37cd258fe884b5f96addb7dac19688b9b0a8e9b8044a686321b8f6dbaecf0fdfd41ba962ae9b67d0dbc88744357acd8fafa07e15
7
+ data.tar.gz: 0a62d1499e578c06900855c5cca20e834a73a7a572f81feb602e60fe72775c02cfba97c39a224477b69098948bf2d40c4dc4229ff4e43d3cb784d4d787dc2d85
data/Puppetfile CHANGED
@@ -33,7 +33,7 @@ mod 'puppetlabs-ruby_plugin_helper', '0.1.0'
33
33
  mod 'puppetlabs-aws_inventory', '0.5.0'
34
34
  mod 'puppetlabs-azure_inventory', '0.3.0'
35
35
  mod 'puppetlabs-gcloud_inventory', '0.1.1'
36
- mod 'puppetlabs-pkcs7', '0.1.0'
36
+ mod 'puppetlabs-pkcs7', '0.1.1'
37
37
  mod 'puppetlabs-terraform', '0.5.0'
38
38
  mod 'puppetlabs-vault', '0.3.0'
39
39
  mod 'puppetlabs-yaml', '0.2.0'
@@ -25,6 +25,7 @@ Puppet::Functions.create_function(:add_facts) do
25
25
 
26
26
  inventory = Puppet.lookup(:bolt_inventory)
27
27
  executor = Puppet.lookup(:bolt_executor)
28
+ # Send Analytics Report
28
29
  executor.report_function_call(self.class.name)
29
30
 
30
31
  inventory.add_facts(target, facts)
@@ -29,6 +29,7 @@ Puppet::Functions.create_function(:add_to_group) do
29
29
 
30
30
  inventory = Puppet.lookup(:bolt_inventory)
31
31
  executor = Puppet.lookup(:bolt_executor)
32
+ # Send Analytics Report
32
33
  executor.report_function_call(self.class.name)
33
34
 
34
35
  inventory.add_to_group(inventory.get_targets(targets), group)
@@ -13,10 +13,13 @@ require 'bolt/task'
13
13
  # > **Note:** Not available in apply block
14
14
  Puppet::Functions.create_function(:apply_prep) do
15
15
  # @param targets A pattern or array of patterns identifying a set of targets.
16
+ # @param options Options hash.
17
+ # @option options [Array] _required_modules An array of modules to sync to the target.
16
18
  # @example Prepare targets by name.
17
19
  # apply_prep('target1,target2')
18
20
  dispatch :apply_prep do
19
21
  param 'Boltlib::TargetSpec', :targets
22
+ optional_param 'Hash[String, Data]', :options
20
23
  end
21
24
 
22
25
  def script_compiler
@@ -60,18 +63,34 @@ Puppet::Functions.create_function(:apply_prep) do
60
63
  @executor ||= Puppet.lookup(:bolt_executor)
61
64
  end
62
65
 
63
- def apply_prep(target_spec)
66
+ def apply_prep(target_spec, options = {})
64
67
  unless Puppet[:tasks]
65
68
  raise Puppet::ParseErrorWithIssue
66
69
  .from_issue_and_stack(Bolt::PAL::Issues::PLAN_OPERATION_NOT_SUPPORTED_WHEN_COMPILING, action: 'apply_prep')
67
70
  end
68
71
 
72
+ options = options.transform_keys { |k| k.sub(/^_/, '').to_sym }
73
+
69
74
  applicator = Puppet.lookup(:apply_executor)
70
75
 
71
76
  executor.report_function_call(self.class.name)
72
77
 
73
78
  targets = inventory.get_targets(target_spec)
74
79
 
80
+ required_modules = options[:required_modules].nil? ? nil : Array(options[:required_modules])
81
+ if required_modules&.any?
82
+ Puppet.debug("Syncing only required modules: #{required_modules.join(',')}.")
83
+ end
84
+
85
+ # Gather facts, including custom facts
86
+ plugins = applicator.build_plugin_tarball do |mod|
87
+ next unless required_modules.nil? || required_modules.include?(mod.name)
88
+ search_dirs = []
89
+ search_dirs << mod.plugins if mod.plugins?
90
+ search_dirs << mod.pluginfacts if mod.pluginfacts?
91
+ search_dirs
92
+ end
93
+
75
94
  executor.log_action('install puppet and gather facts', targets) do
76
95
  executor.without_default_logging do
77
96
  # Skip targets that include the puppet-agent feature, as we know an agent will be available.
@@ -109,14 +128,6 @@ Puppet::Functions.create_function(:apply_prep) do
109
128
  need_install_targets.each { |target| set_agent_feature(target) }
110
129
  end
111
130
 
112
- # Gather facts, including custom facts
113
- plugins = applicator.build_plugin_tarball do |mod|
114
- search_dirs = []
115
- search_dirs << mod.plugins if mod.plugins?
116
- search_dirs << mod.pluginfacts if mod.pluginfacts?
117
- search_dirs
118
- end
119
-
120
131
  task = applicator.custom_facts_task
121
132
  arguments = { 'plugins' => Puppet::Pops::Types::PSensitiveType::Sensitive.new(plugins) }
122
133
  results = executor.run_task(targets, task, arguments)
@@ -37,6 +37,7 @@ Puppet::Functions.create_function(:catch_errors) do
37
37
  end
38
38
 
39
39
  executor = Puppet.lookup(:bolt_executor)
40
+ # Send Analytics Report
40
41
  executor.report_function_call(self.class.name)
41
42
 
42
43
  begin
@@ -17,6 +17,7 @@ Puppet::Functions.create_function(:facts) do
17
17
  inventory = Puppet.lookup(:bolt_inventory)
18
18
  # Bolt executor not expected when invoked from apply block
19
19
  executor = Puppet.lookup(:bolt_executor) { nil }
20
+ # Send Analytics Report
20
21
  executor&.report_function_call(self.class.name)
21
22
 
22
23
  inventory.facts(target)
@@ -40,6 +40,7 @@ Puppet::Functions.create_function(:fail_plan) do
40
40
  end
41
41
 
42
42
  executor = Puppet.lookup(:bolt_executor)
43
+ # Send Analytics Report
43
44
  executor.report_function_call(self.class.name)
44
45
 
45
46
  raise Bolt::PlanFailure.new(msg, kind || 'bolt/plan-failure', details, issue_code)
@@ -58,6 +58,7 @@ Puppet::Functions.create_function(:get_resources) do
58
58
  end
59
59
  end
60
60
 
61
+ # Send Analytics Report
61
62
  executor.report_function_call(self.class.name)
62
63
 
63
64
  targets = inventory.get_targets(target_spec)
@@ -21,6 +21,7 @@ Puppet::Functions.create_function(:get_target) do
21
21
  inventory = Puppet.lookup(:bolt_inventory)
22
22
  # Bolt executor not expected when invoked from apply block
23
23
  executor = Puppet.lookup(:bolt_executor) { nil }
24
+ # Send Analytics Report
24
25
  executor&.report_function_call(self.class.name)
25
26
 
26
27
  unless inventory.version > 1
@@ -27,6 +27,7 @@ Puppet::Functions.create_function(:get_targets) do
27
27
  inventory = Puppet.lookup(:bolt_inventory)
28
28
  # Bolt executor not expected when invoked from apply block
29
29
  executor = Puppet.lookup(:bolt_executor) { nil }
30
+ # Send Analytics Report
30
31
  executor&.report_function_call(self.class.name)
31
32
 
32
33
  inventory.get_targets(names)
@@ -20,6 +20,7 @@ Puppet::Functions.create_function(:puppetdb_fact) do
20
20
  puppetdb_client = Puppet.lookup(:bolt_pdb_client)
21
21
  # Bolt executor not expected when invoked from apply block
22
22
  executor = Puppet.lookup(:bolt_executor) { nil }
23
+ # Send Analytics Report
23
24
  executor&.report_function_call(self.class.name)
24
25
 
25
26
  puppetdb_client.facts_for_node(certnames)
@@ -22,6 +22,7 @@ Puppet::Functions.create_function(:puppetdb_query) do
22
22
  puppetdb_client = Puppet.lookup(:bolt_pdb_client)
23
23
  # Bolt executor not expected when invoked from apply block
24
24
  executor = Puppet.lookup(:bolt_executor) { nil }
25
+ # Send Analytics Report
25
26
  executor&.report_function_call(self.class.name)
26
27
 
27
28
  puppetdb_client.make_query(query)
@@ -31,6 +31,7 @@ Puppet::Functions.create_function(:remove_from_group) do
31
31
 
32
32
  inventory = Puppet.lookup(:bolt_inventory)
33
33
  executor = Puppet.lookup(:bolt_executor)
34
+ # Send Analytics Report
34
35
  executor.report_function_call(self.class.name)
35
36
 
36
37
  inventory.remove_from_group(inventory.get_targets(target), group)
@@ -33,6 +33,7 @@ Puppet::Functions.create_function(:resolve_references) do
33
33
  end
34
34
 
35
35
  executor = Puppet.lookup(:bolt_executor)
36
+ # Send Analytics Report
36
37
  executor.report_function_call(self.class.name)
37
38
 
38
39
  plugins = Puppet.lookup(:bolt_inventory).plugins
@@ -41,6 +41,7 @@ Puppet::Functions.create_function(:resource) do
41
41
  def resource(target, type, title)
42
42
  inventory = Puppet.lookup(:bolt_inventory)
43
43
  executor = Puppet.lookup(:bolt_executor) { nil }
44
+ # Send Analytics Report
44
45
  executor&.report_function_call(self.class.name)
45
46
 
46
47
  inventory.resource(target, type, title)
@@ -13,6 +13,7 @@ Puppet::Functions.create_function(:run_command) do
13
13
  # @param options A hash of additional options.
14
14
  # @option options [Boolean] _catch_errors Whether to catch raised errors.
15
15
  # @option options [String] _run_as User to run as using privilege escalation.
16
+ # @option options [Hash] _env_vars Map of environment variables to set
16
17
  # @return A list of results, one entry per target.
17
18
  # @example Run a command on targets
18
19
  # run_command('hostname', $targets, '_catch_errors' => true)
@@ -30,6 +31,7 @@ Puppet::Functions.create_function(:run_command) do
30
31
  # @param options A hash of additional options.
31
32
  # @option options [Boolean] _catch_errors Whether to catch raised errors.
32
33
  # @option options [String] _run_as User to run as using privilege escalation.
34
+ # @option options [Hash] _env_vars Map of environment variables to set
33
35
  # @return A list of results, one entry per target.
34
36
  # @example Run a command on targets
35
37
  # run_command('hostname', $targets, 'Get hostname')
@@ -57,6 +59,7 @@ Puppet::Functions.create_function(:run_command) do
57
59
  executor = Puppet.lookup(:bolt_executor)
58
60
  inventory = Puppet.lookup(:bolt_inventory)
59
61
 
62
+ # Send Analytics Report
60
63
  executor.report_function_call(self.class.name)
61
64
 
62
65
  # Ensure that given targets are all Target instances
@@ -64,10 +64,11 @@ Puppet::Functions.create_function(:run_plan, Puppet::Functions::InternalFunction
64
64
  # Bolt calls this function internally to trigger plans from the CLI. We
65
65
  # don't want to count those invocations.
66
66
  unless options[:bolt_api_call]
67
+ # Send Analytics Report
67
68
  executor.report_function_call(self.class.name)
68
69
  end
69
70
 
70
- # Report bundled content, this should capture plans run from both CLI and Plans
71
+ # Send Analytics Report for bundled content, this should capture plans run from both CLI and Plans
71
72
  executor.report_bundled_content('Plan', plan_name)
72
73
 
73
74
  loaders = closure_scope.compiler.loaders
@@ -11,8 +11,9 @@ Puppet::Functions.create_function(:run_script, Puppet::Functions::InternalFuncti
11
11
  # @param targets A pattern identifying zero or more targets. See {get_targets} for accepted patterns.
12
12
  # @param options A hash of additional options.
13
13
  # @option options [Array[String]] arguments An array of arguments to be passed to the script.
14
- # @option args [Boolean] _catch_errors Whether to catch raised errors.
15
- # @option args [String] _run_as User to run as using privilege escalation.
14
+ # @option options [Boolean] _catch_errors Whether to catch raised errors.
15
+ # @option options [String] _run_as User to run as using privilege escalation.
16
+ # @option options [Hash] _env_vars Map of environment variables to set
16
17
  # @return A list of results, one entry per target.
17
18
  # @example Run a local script on Linux targets as 'root'
18
19
  # run_script('/var/tmp/myscript', $targets, '_run_as' => 'root')
@@ -33,8 +34,9 @@ Puppet::Functions.create_function(:run_script, Puppet::Functions::InternalFuncti
33
34
  # @param description A description to be output when calling this function.
34
35
  # @param options A hash of additional options.
35
36
  # @option options [Array[String]] arguments An array of arguments to be passed to the script.
36
- # @option args [Boolean] _catch_errors Whether to catch raised errors.
37
- # @option args [String] _run_as User to run as using privilege escalation.
37
+ # @option options [Boolean] _catch_errors Whether to catch raised errors.
38
+ # @option options [String] _run_as User to run as using privilege escalation.
39
+ # @option options [Hash] _env_vars Map of environment variables to set
38
40
  # @return A list of results, one entry per target.
39
41
  # @example Run a script
40
42
  # run_script('/var/tmp/myscript', $targets, 'Downloading my application')
@@ -64,6 +66,7 @@ Puppet::Functions.create_function(:run_script, Puppet::Functions::InternalFuncti
64
66
  executor = Puppet.lookup(:bolt_executor)
65
67
  inventory = Puppet.lookup(:bolt_inventory)
66
68
 
69
+ # Send Analytics Report
67
70
  executor.report_function_call(self.class.name)
68
71
 
69
72
  found = Puppet::Parser::Files.find_file(script, scope.compiler.environment)
@@ -64,10 +64,11 @@ Puppet::Functions.create_function(:run_task) do
64
64
  # Bolt calls this function internally to trigger tasks from the CLI. We
65
65
  # don't want to count those invocations.
66
66
  unless options[:bolt_api_call]
67
+ # Send Analytics Report
67
68
  executor.report_function_call(self.class.name)
68
69
  end
69
70
 
70
- # Report bundled content, this should capture tasks run from both CLI and Plans
71
+ # Report Analytics for bundled content, this should capture tasks run from both CLI and Plans
71
72
  executor.report_bundled_content('Task', task_name)
72
73
 
73
74
  # Ensure that given targets are all Target instances
@@ -33,6 +33,7 @@ Puppet::Functions.create_function(:set_config) do
33
33
 
34
34
  inventory = Puppet.lookup(:bolt_inventory)
35
35
  executor = Puppet.lookup(:bolt_executor)
36
+ # Send Analytics Report
36
37
  executor.report_function_call(self.class.name)
37
38
 
38
39
  unless inventory.version > 1
@@ -33,6 +33,7 @@ Puppet::Functions.create_function(:set_feature) do
33
33
 
34
34
  inventory = Puppet.lookup(:bolt_inventory)
35
35
  executor = Puppet.lookup(:bolt_executor)
36
+ # Send Analytics Report
36
37
  executor.report_function_call(self.class.name)
37
38
 
38
39
  inventory.set_feature(target, feature, value)
@@ -94,6 +94,7 @@ Puppet::Functions.create_function(:set_resources) do
94
94
  )
95
95
  end
96
96
 
97
+ # Send Analytics Report
97
98
  Puppet.lookup(:bolt_executor).report_function_call(self.class.name)
98
99
  inventory = Puppet.lookup(:bolt_inventory)
99
100
 
@@ -27,6 +27,7 @@ Puppet::Functions.create_function(:set_var) do
27
27
 
28
28
  inventory = Puppet.lookup(:bolt_inventory)
29
29
  executor = Puppet.lookup(:bolt_executor)
30
+ # Send Analytics Report
30
31
  executor.report_function_call(self.class.name)
31
32
 
32
33
  var_hash = { key => value }
@@ -67,6 +67,7 @@ Puppet::Functions.create_function(:upload_file, Puppet::Functions::InternalFunct
67
67
  executor = Puppet.lookup(:bolt_executor)
68
68
  inventory = Puppet.lookup(:bolt_inventory)
69
69
 
70
+ # Send Analytics Report
70
71
  executor.report_function_call(self.class.name)
71
72
 
72
73
  found = Puppet::Parser::Files.find_file(source, scope.compiler.environment)
@@ -21,6 +21,7 @@ Puppet::Functions.create_function(:vars) do
21
21
  inventory = Puppet.lookup(:bolt_inventory)
22
22
  # Bolt executor not expected when invoked from apply block
23
23
  executor = Puppet.lookup(:bolt_executor) { nil }
24
+ # Send Analytics Report
24
25
  executor&.report_function_call(self.class.name)
25
26
 
26
27
  inventory.vars(target)
@@ -33,6 +33,7 @@ Puppet::Functions.create_function(:wait_until_available) do
33
33
  executor = Puppet.lookup(:bolt_executor)
34
34
  inventory = Puppet.lookup(:bolt_inventory)
35
35
 
36
+ # Send Analytics Report
36
37
  executor.report_function_call(self.class.name)
37
38
 
38
39
  # Ensure that given targets are all Target instances
@@ -29,6 +29,7 @@ Puppet::Functions.create_function(:without_default_logging) do
29
29
  end
30
30
 
31
31
  executor = Puppet.lookup(:bolt_executor)
32
+ # Send Analytics Report
32
33
  executor.report_function_call(self.class.name)
33
34
 
34
35
  executor.without_default_logging do
@@ -31,6 +31,7 @@ Puppet::Functions.create_function(:write_file) do
31
31
  end
32
32
 
33
33
  executor = Puppet.lookup(:bolt_executor)
34
+ # Send Analytics Report
34
35
  executor.report_function_call(self.class.name)
35
36
 
36
37
  inventory = Puppet.lookup(:bolt_inventory)
@@ -20,7 +20,9 @@ Puppet::Functions.create_function(:'ctrl::do_until') do
20
20
  end
21
21
 
22
22
  def do_until(options = { 'limit' => 0 })
23
+ # Send Analytics Report
23
24
  Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
25
+
24
26
  limit = options['limit']
25
27
  i = 0
26
28
  until (x = yield)
@@ -11,7 +11,9 @@ Puppet::Functions.create_function(:'ctrl::sleep') do
11
11
  end
12
12
 
13
13
  def sleeper(period)
14
+ # Send Analytics Report
14
15
  Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
16
+
15
17
  sleep(period)
16
18
  nil
17
19
  end
@@ -9,7 +9,7 @@ Puppet::Functions.create_function(:'file::exists', Puppet::Functions::InternalFu
9
9
  # @example Check a file on disk
10
10
  # file::exists('/tmp/i_dumped_this_here')
11
11
  # @example check a file from the modulepath
12
- # file::exists('example/files/VERSION')
12
+ # file::exists('example/VERSION')
13
13
  dispatch :exists do
14
14
  scope_param
15
15
  required_param 'String', :filename
@@ -17,6 +17,7 @@ Puppet::Functions.create_function(:'file::exists', Puppet::Functions::InternalFu
17
17
  end
18
18
 
19
19
  def exists(scope, filename)
20
+ # Send Analytics Report
20
21
  Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
21
22
  found = Puppet::Parser::Files.find_file(filename, scope.compiler.environment)
22
23
  found ? Puppet::FileSystem.exist?(found) : false
@@ -12,7 +12,9 @@ Puppet::Functions.create_function(:'file::join') do
12
12
  end
13
13
 
14
14
  def join(*paths)
15
+ # Send Analytics Report
15
16
  Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
17
+
16
18
  File.join(paths)
17
19
  end
18
20
  end
@@ -8,7 +8,7 @@ Puppet::Functions.create_function(:'file::read', Puppet::Functions::InternalFunc
8
8
  # @example Read a file from disk
9
9
  # file::read('/tmp/i_dumped_this_here')
10
10
  # @example Read a file from the modulepath
11
- # file::read('example/files/VERSION')
11
+ # file::read('example/VERSION')
12
12
  dispatch :read do
13
13
  scope_param
14
14
  required_param 'String', :filename
@@ -16,7 +16,9 @@ Puppet::Functions.create_function(:'file::read', Puppet::Functions::InternalFunc
16
16
  end
17
17
 
18
18
  def read(scope, filename)
19
+ # Send Analytics Report
19
20
  Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
21
+
20
22
  found = Puppet::Parser::Files.find_file(filename, scope.compiler.environment)
21
23
  unless found && Puppet::FileSystem.exist?(found)
22
24
  raise Puppet::ParseErrorWithIssue.from_issue_and_stack(
@@ -9,7 +9,7 @@ Puppet::Functions.create_function(:'file::readable', Puppet::Functions::Internal
9
9
  # @example Check a file on disk
10
10
  # file::readable('/tmp/i_dumped_this_here')
11
11
  # @example check a file from the modulepath
12
- # file::readable('example/files/VERSION')
12
+ # file::readable('example/VERSION')
13
13
  dispatch :readable do
14
14
  scope_param
15
15
  required_param 'String', :filename
@@ -17,7 +17,9 @@ Puppet::Functions.create_function(:'file::readable', Puppet::Functions::Internal
17
17
  end
18
18
 
19
19
  def readable(scope, filename)
20
+ # Send Analytics Report
20
21
  Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
22
+
21
23
  found = Puppet::Parser::Files.find_file(filename, scope.compiler.environment)
22
24
  found ? File.readable?(found) : false
23
25
  end