~ubuntu-branches/ubuntu/trusty/facter/trusty

« back to all changes in this revision

Viewing changes to lib/facter/ipmess.rb

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Pollock, Nigel Kersten, Andrew Pollock
  • Date: 2009-04-13 15:20:21 UTC
  • mfrom: (1.1.5 upstream) (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090413152021-t3uagjamr3ee4njl
Tags: 1.5.4-1
[ Nigel Kersten ]
* New upstream release
* Switch maintainer to pkg-puppet-devel list
* Modify uploaders
* Update watch file regexp to exclude release canditate tarballs
* Use upstream install.rb script to build rather than copying manually

[ Andrew Pollock ]
* debian/control: add libopenssl-ruby to build dependencies
* debian/control: bump Standards-Version (no changes)
* debian/compat: increase to 5
* debian/control: add pciutils and ${misc:Depends} to dependencies

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# ipmess.rb
2
 
# Try to get additional Facts about the machine's network interfaces
3
 
#
4
 
# Original concept Copyright (C) 2007 psychedelys <psychedelys@gmail.com>
5
 
# Update and *BSD support (C) 2007 James Turnbull <james@lovedthanlost.net>
6
 
7
 
 
8
 
require 'facter/util/ip'
9
 
 
10
 
Facter.add(:interfaces) do
11
 
    confine :kernel => [ :sunos, :freebsd, :openbsd, :netbsd, :linux ]
12
 
    setcode do
13
 
        Facter::IPAddress.get_interfaces.join(",")
14
 
    end
15
 
end
16
 
 
17
 
case Facter.value(:kernel) 
18
 
 when 'SunOS', 'Linux', 'OpenBSD', 'NetBSD', 'FreeBSD'
19
 
  Facter::IPAddress.get_interfaces.each do |interface|
20
 
    mi = interface.gsub(':', '_')
21
 
 
22
 
    Facter.add("ipaddress_" + mi) do
23
 
        confine :kernel => [ :sunos, :freebsd, :openbsd, :netbsd, :linux ]
24
 
        setcode do
25
 
            label = 'ipaddress'
26
 
            Facter::IPAddress.get_interface_value(interface, label)
27
 
        end
28
 
    end
29
 
 
30
 
    Facter.add("macaddress_" + mi) do
31
 
        confine :kernel => [ :sunos, :freebsd, :openbsd, :netbsd, :linux ]
32
 
        setcode do
33
 
            label = 'macaddress'
34
 
            Facter::IPAddress.get_interface_value(interface, label) 
35
 
        end
36
 
    end
37
 
 
38
 
    Facter.add("netmask_" + mi) do
39
 
        confine :kernel => [ :sunos, :freebsd, :openbsd, :netbsd, :linux ]
40
 
        setcode do
41
 
            label = 'netmask'
42
 
            Facter::IPAddress.get_interface_value(interface, label)
43
 
        end
44
 
    end
45
 
 end
46
 
end