class Confer::Inventory
Public: Encapsulates an inventory, which is simply a list of hosts and the credentials and transport mechanisms required to interact with them.
Attributes
Public Class Methods
from_file(path)
click to toggle source
Public: Loads an inventory from a YAML file.
path - A String containing the path to the YAML file to load.
Returns an Inventory
instance.
# File lib/confer/inventory.rb, line 22 def self.from_file(path) self.from_hash YAML.load File.open(path, 'r').read rescue Errno::ENOENT => e raise InventoryNotFoundError.new(e) rescue Psych::SyntaxError => e raise InventorySyntaxError.new(e) end
from_hash(hash)
click to toggle source