Class: Puppet::Util::NetworkDevice::F5::Device

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/util/network_device/f5/device.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options = {}) ⇒ Device

Returns a new instance of Device.



10
11
12
13
14
15
16
17
18
# File 'lib/puppet/util/network_device/f5/device.rb', line 10

def initialize(url, options = {})
  @autoloader = Puppet::Util::Autoload.new(
    self,
    "puppet/util/network_device/transport"
  )
  if @autoloader.load("f5")
    @transport = Puppet::Util::NetworkDevice::Transport::F5.new(url,options[:debug])
  end
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



7
8
9
# File 'lib/puppet/util/network_device/f5/device.rb', line 7

def connection
  @connection
end

#transportObject

Returns the value of attribute transport.



8
9
10
# File 'lib/puppet/util/network_device/f5/device.rb', line 8

def transport
  @transport
end

#urlObject

Returns the value of attribute url.



8
9
10
# File 'lib/puppet/util/network_device/f5/device.rb', line 8

def url
  @url
end

Instance Method Details

#factsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/puppet/util/network_device/f5/device.rb', line 20

def facts
  custom_facts=Facter.to_hash['f5_custom_facts']

  Puppet.debug _("###### '%{facts}'") % { facts: custom_facts.to_json }
  @facts ||= Puppet::Util::NetworkDevice::F5::Facts.new(@transport)

  facts=@facts.retrieve

  unless custom_facts.nil?
    facts=custom_facts.merge(facts)
  end

  facts
end