Sha256: d74149194a48bf6f67f232b6687db6247f04aec6600ec49162a21654c43a6957
Contents?: true
Size: 735 Bytes
Versions: 30
Compression:
Stored size: 735 Bytes
Contents
# frozen_string_literal: true require 'bolt/error' # Returns the facts hash for a target. Puppet::Functions.create_function(:facts) do # @param target A target. # @return The target's facts. # @example Getting facts # facts($target) dispatch :facts do param 'Target', :target return_type 'Hash[String, Data]' end def facts(target) inventory = Puppet.lookup(:bolt_inventory) { nil } unless inventory raise Puppet::ParseErrorWithIssue.from_issue_and_stack( Puppet::Pops::Issues::TASK_MISSING_BOLT, action: _('get facts for a target') ) end executor = Puppet.lookup(:bolt_executor) { nil } executor&.report_function_call('facts') inventory.facts(target) end end
Version data entries
30 entries across 30 versions & 1 rubygems