Class: VagrantHosts::Cap::Facts::POSIX

Inherits:
Base
  • Object
show all
Defined in:
lib/vagrant-hosts/cap/facts/posix.rb

Overview

Base class for retrieving network facts from POSIX

Since:

  • 2.8.0

Instance Attribute Summary

Attributes inherited from Base

#machine

Instance Method Summary collapse

Methods inherited from Base

#initialize, network_facts

Constructor Details

This class inherits a constructor from VagrantHosts::Cap::Facts::Base

Instance Method Details

#load_factsObject

Since:

  • 2.8.0



8
9
10
11
12
13
14
15
16
17
# File 'lib/vagrant-hosts/cap/facts/posix.rb', line 8

def load_facts
  facts = {}
  facts['networking'] = {}
  facts['networking']['interfaces'] = parse_ifconfig

  iface = get_default_iface
  facts['networking']['ip'] = facts['networking']['interfaces'][iface]['ip']

  facts
end