Module: ForemanAnsible::HostManagedExtensions::ClassMethods

Defined in:
app/models/concerns/foreman_ansible/host_managed_extensions.rb

Overview

Class methods we may need to override or add

Instance Method Summary collapse

Instance Method Details

#import_host(*args) ⇒ Object



58
59
60
61
62
63
64
65
66
# File 'app/models/concerns/foreman_ansible/host_managed_extensions.rb', line 58

def import_host(*args)
  host = super(*args)
  hostname = args[0]
  if IPAddress.valid?(hostname) &&
     (host_nic = Nic::Interface.find_by(:ip => hostname))
    host = host_nic.host
  end
  host
end