Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/puppet/util/network_device/f5/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ def initialize(url, options = {})
end
if @autoloader.load(*autoloader_params)
@transport = Puppet::Util::NetworkDevice::Transport::F5.new(url,options[:debug])
@fqdn = url.split("@").last.downcase
end
end

def facts
@facts ||= Puppet::Util::NetworkDevice::F5::Facts.new(@transport)
@facts ||= Puppet::Util::NetworkDevice::F5::Facts.new(@transport, @fqdn)

return @facts.retrieve
end
Expand Down
9 changes: 7 additions & 2 deletions lib/puppet/util/network_device/f5/facts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ class Puppet::Util::NetworkDevice::F5::Facts

attr_reader :transport

def initialize(transport)
def initialize(transport, hostfqdn)
@transport = transport
@hostfqdn = hostfqdn
end

def retrieve
Expand All @@ -17,7 +18,11 @@ def parse_device_facts
}

if response = @transport.call('/mgmt/tm/cm/device') and items = response['items']
result = items.first
if (items.first['name'].downcase) == @hostfqdn
result = items.first
else
result = items.last
end
else
Puppet.warning("Did not receive device details. iControl REST requires Administrator level access.")
return facts
Expand Down