Sha256: 34329ec88adb48ce0e528533919fc21524e29d69ecbcff425362d446bb8d9fab

Contents?: true

Size: 640 Bytes

Versions: 18

Compression:

Stored size: 640 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 }
    # Send Analytics Report
    executor&.report_function_call(self.class.name)

    inventory.facts(target)
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
bolt-2.32.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.31.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.30.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.29.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.28.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.27.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.26.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.25.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.24.1 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.24.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.23.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.22.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.21.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.20.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.19.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.18.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.17.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb
bolt-2.16.0 bolt-modules/boltlib/lib/puppet/functions/facts.rb