Class: Facter::Util::Linux::Dhcp

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/util/linux/dhcp.rb

Constant Summary collapse

DIRS =
%w[/var/lib/dhclient/
/var/lib/dhcp/
/var/lib/dhcp3/
/var/lib/NetworkManager/
/var/db/].freeze

Class Method Summary collapse

Class Method Details

.dhcp(interface_name, interface_index, logger) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/facter/util/linux/dhcp.rb', line 14

def dhcp(interface_name, interface_index, logger)
  @log = logger
  @log.debug("Get DHCP for interface #{interface_name}")

  dhcp = search_systemd_netif_leases(interface_index, interface_name)
  dhcp ||= search_dhclient_leases(interface_name)
  dhcp ||= search_internal_leases(interface_name)
  dhcp ||= search_with_dhcpcd_command(interface_name)
  dhcp
end