Sha256: b77b714e460ce456fea725bd429ef471f9b7e685b1e5995227dd0fec64f9c39a

Contents?: true

Size: 612 Bytes

Versions: 50

Compression:

Stored size: 612 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)
    # Bolt executor not expected when invoked from apply block
    executor = Puppet.lookup(:bolt_executor) { nil }
    executor&.report_function_call(self.class.name)

    inventory.facts(target)
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
bolt-1.48.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.47.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.45.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.44.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.43.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.42.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.41.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.40.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.39.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.38.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.37.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.36.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.35.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.34.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.33.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.32.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.31.1 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.31.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.30.1 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-1.30.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb