Sha256: 133c6dfedcfff13a1acd7df166755f0ade4cff33f716cd233de1280512893807

Contents?: true

Size: 473 Bytes

Versions: 5

Compression:

Stored size: 473 Bytes

Contents

# frozen_string_literal: true

module Facts
  module Openbsd
    class IpaddressInterfaces
      FACT_NAME = 'ipaddress_.*'
      TYPE = :legacy

      def call_the_resolver
        arr = []
        interfaces = Facter::Resolvers::Networking.resolve(:interfaces)
        interfaces&.each do |interface_name, info|
          arr << Facter::ResolvedFact.new("ipaddress_#{interface_name}", info[:ip], :legacy) if info[:ip]
        end

        arr
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
facter-4.10.0 lib/facter/facts/openbsd/ipaddress_interfaces.rb
facter-4.9.0 lib/facter/facts/openbsd/ipaddress_interfaces.rb
facter-4.8.0 lib/facter/facts/openbsd/ipaddress_interfaces.rb
facter-4.7.1 lib/facter/facts/openbsd/ipaddress_interfaces.rb
facter-4.7.0 lib/facter/facts/openbsd/ipaddress_interfaces.rb