Sha256: 5d355bd8d3355ba147ba971495d03a74b55d4a89b2c677c12261619b8dfcc021
Contents?: true
Size: 757 Bytes
Versions: 71
Compression:
Stored size: 757 Bytes
Contents
# frozen_string_literal: true # Write a string to a file on localhost using ruby's `File.write`. This will # only write files to the machine you run Bolt on. Use `write_file()` to write # to remote targets. Puppet::Functions.create_function(:'file::write') do # @param filename Absolute path. # @param content File content to write. # @example Write a file to disk # file::write('C:/Users/me/report', $apply_result.first.report) dispatch :write do required_param 'String', :filename required_param 'String', :content return_type 'Undef' end def write(filename, content) # Send Analytics Report Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name) File.write(filename, content) nil end end
Version data entries
71 entries across 71 versions & 1 rubygems