Sha256: 5aa3b7c0d03d8a3dc192e31bd3c1bc402ea843415f511d2588dea4c0d29ccb29
Contents?: true
Size: 745 Bytes
Versions: 3
Compression:
Stored size: 745 Bytes
Contents
require 'bolt/error' # Sets a variable { key => value } for a target. # # This function takes 3 parameters: # * A Target object to set the variable for # * The key for the variable (String) # * The value of the variable (Data) # # Returns undef. Puppet::Functions.create_function(:set_var) do dispatch :set_var do param 'Target', :target param 'String', :key param 'Data', :value end def set_var(target, key, value) unless Puppet[:tasks] raise Puppet::ParseErrorWithIssue.from_issue_and_stack( Puppet::Pops::Issues::TASK_OPERATION_NOT_SUPPORTED_WHEN_COMPILING, operation: 'set_var' ) end inventory = Puppet.lookup(:bolt_inventory) { nil } inventory.set_var(target, key, value) end end
Version data entries
3 entries across 3 versions & 1 rubygems