Sha256: 2a59f5c88b869228bca246b8502dc0c2311c29fe7ed7f77fd53e6e62454e6137
Contents?: true
Size: 920 Bytes
Versions: 19
Compression:
Stored size: 920 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
19 entries across 19 versions & 1 rubygems