summaryrefslogtreecommitdiffstats
path: root/lib/facter/network.rb
blob: d4faaac16b64ebe1c2947309494f4bb07673f7e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Fact: network
#
# Purpose:
# Get IP, network and netmask information for available network
# interfacs.
#
# Resolution:
#  Uses 'facter/util/ip' to enumerate interfaces and return their information.
#
# Caveats:
#

require 'facter/util/ip'

Facter::Util::IP.get_interfaces.each do |interface|
    Facter.add("network_" + Facter::Util::IP.alphafy(interface)) do
        setcode do
            Facter::Util::IP.get_network_value(interface)
        end 
    end 
end