Sha256: a31a104725ecf2a4252209bec1b8d90bbdf1a01f2fcb9d38b7f4cb34534a2c9b
Contents?: true
Size: 1.21 KB
Versions: 2
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true # Define a block where default logging is suppressed. # # Messages for actions within this block will be logged at `info` level instead # of `notice`, so they will not be seen normally but # will still be present # when `verbose` logging is requested. # # **NOTE:** Not available in apply block Puppet::Functions.create_function(:without_default_logging) do # @param block The block where action logging is suppressed. # @return [Undef] # @example Suppress default logging for a series of functions # without_default_logging() || { # notice("Deploying on ${nodes}") # get_targets($nodes).each |$node| { # run_task(deploy, $node) # } # } dispatch :without_default_logging do block_param 'Callable[0, 0]', :block end def without_default_logging unless Puppet[:tasks] raise Puppet::ParseErrorWithIssue .from_issue_and_stack(Bolt::PAL::Issues::PLAN_OPERATION_NOT_SUPPORTED_WHEN_COMPILING, action: 'without_default_logging') end executor = Puppet.lookup(:bolt_executor) executor.report_function_call('without_default_logging') executor.without_default_logging do yield end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bolt-1.21.0 | bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb |
bolt-1.20.0 | bolt-modules/boltlib/lib/puppet/functions/without_default_logging.rb |