Project

General

Profile

« Previous | Next » 

Revision d97375e0

Added by Ohad Levy over 13 years ago

  • ID d97375e0e8ee13cbd1ace39dcbda6f6964d28dcb

Fixes #284 - Use MAC address if IP doesn't exist when tftp booting

  • Uses any of the assoicated mac addresses (RH only) prior to IP
  • Adds a new settings to not update mac or ip information to Foreman - used for cases
    where DHCP booting is done via a temporary dhcp range

View differences:

app/models/host.rb
# maybe these should be moved to the common parameters, leaving them in for now
param["puppetmaster"] = puppetmaster
param["domainname"] = domain.fullname unless domain.nil? or domain.fullname.nil?
if SETTINGS[:ignore_puppet_facts_for_provisioning]
param["ip"] = ip
param["mac"] = mac
end
param.update self.params
info_hash = {}
......
end
def populateFieldsFromFacts
self.mac = fv(:macaddress)
self.ip = fv(:ipaddress) if ip.nil?
unless SETTINGS[:ignore_puppet_facts_for_provisioning]
self.mac = fv(:macaddress).downcase
self.ip = fv(:ipaddress) if ip.nil?
end
self.domain = Domain.find_or_create_by_name fv(:domain) unless fv(:domain).empty?
# On solaris architecture fact is harwareisa
if myarch=fv(:architecture) || fv(:hardwareisa)
self.arch=Architecture.find_or_create_by_name myarch unless myarch.empty?
end
# by default, puppet doesnt store an env name in the database
env=fv(:environment) || "production"
env=fv(:environment) || SETTINGS[:default_puppet_environment] || "production"
self.environment ||= Environment.find_or_create_by_name env
os_name = fv(:operatingsystem)

Also available in: Unified diff