summaryrefslogtreecommitdiffstats
path: root/lib/facter/netmask.rb
blob: fbb84f59eee3f3f095686a1e5741ad2dd7baec6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Fact: netmask
#
# Purpose: Returns the netmask for the main interfaces.
#
# Resolution: Uses the facter/util/netmask library routines.
#
# Caveats:
#

# netmask.rb
# Find the netmask of the primary ipaddress
# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
# Copyright (C) 2007 Mark 'phips' Phillips
#
# idea and originial source by Mark 'phips' Phillips
#

require 'facter/util/netmask'

Facter.add("netmask") do
    confine :kernel => [ :sunos, :linux, :freebsd, :openbsd, :netbsd, :darwin, :"gnu/kfreebsd" ]
    setcode do
        Facter::NetMask.get_netmask
    end
end