Sha256: 25b5528e26c2aa5a1c98a5ca3e47b4b665a7f49853e87db4d7c6d94da9d14432
Contents?: true
Size: 881 Bytes
Versions: 16
Compression:
Stored size: 881 Bytes
Contents
module ForemanDiscovery class FactParser < ::PuppetFactParser def suggested_primary_interface(host) raise("Discovery fact parser does not work with non-discovery host #{host}") if host.type != "Host::Discovered" bootif_mac = FacterUtils::bootif_mac(facts).try(:downcase) detected = interfaces.detect { |_, values| values[:macaddress].try(:downcase) == bootif_mac } Rails.logger.debug "Discovery fact parser detected primary interface: #{detected}" # return the detected interface as array [name, facts] detected || raise(::Foreman::Exception.new(N_("Unable to detect primary interface using MAC '%{mac}' specified by discovery_fact '%{fact}'") % {:mac => bootif_mac, :fact => FacterUtils::bootif_name})) end def parse_interfaces? true # to make 'ignore_puppet_facts_for_provisioning' setting non-effective end end end
Version data entries
16 entries across 16 versions & 1 rubygems