Module: ForemanAnsible::HostManagedExtensions::ClassMethods

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

Overview

rubocop:enable Metrics/BlockLength Class methods we may need to override or add

Instance Method Summary collapse

Instance Method Details

#import_host(*args) ⇒ Object



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

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