Sha256: 2a348d3cf7266233ed74f6abc86f19bc27a2fa480a9848660cc1c02897e8f6c6
Contents?: true
Size: 918 Bytes
Versions: 26
Compression:
Stored size: 918 Bytes
Contents
# frozen_string_literal: true # Output a message for the user. # # This will print a message to stdout when using the human output format, # and print to stderr when using the json output format # # **NOTE:** Not available in apply block Puppet::Functions.create_function(:'out::message') do # Output a message. # @param message The message to output. # @example Print a message # out::message('Something went wrong') dispatch :output_message do param 'String', :message return_type 'Undef' end def output_message(message) unless Puppet[:tasks] raise Puppet::ParseErrorWithIssue .from_issue_and_stack(Bolt::PAL::Issues::PLAN_OPERATION_NOT_SUPPORTED_WHEN_COMPILING, action: 'out::message') end executor = Puppet.lookup(:bolt_executor) executor.report_function_call(self.class.name) executor.publish_event(type: :message, message: message) nil end end
Version data entries
26 entries across 26 versions & 1 rubygems