Revision 0ef59e67
Added by Trey Dockendorf about 10 years ago
app/models/concerns/orchestration/dns.rb | ||
---|---|---|
end
|
||
|
||
def dns?
|
||
name.present? and ip_available? and !domain.nil? and !domain.proxy.nil? and managed?
|
||
hostname.present? and ip_available? and !domain.nil? and !domain.proxy.nil? and managed?
|
||
end
|
||
|
||
def reverse_dns?
|
||
name.present? and ip_available? and !subnet.nil? and subnet.dns? and managed?
|
||
hostname.present? and ip_available? and !subnet.nil? and subnet.dns? and managed?
|
||
end
|
||
|
||
def dns_a_record
|
||
... | ... | |
private
|
||
|
||
def dns_record_attrs
|
||
{ :hostname => name, :ip => ip, :resolver => domain.resolver, :proxy => domain.proxy }
|
||
{ :hostname => hostname, :ip => ip, :resolver => domain.resolver, :proxy => domain.proxy }
|
||
end
|
||
|
||
def reverse_dns_record_attrs
|
||
{ :hostname => name, :ip => ip, :proxy => subnet.dns_proxy }
|
||
{ :hostname => hostname, :ip => ip, :proxy => subnet.dns_proxy }
|
||
end
|
||
|
||
def queue_dns
|
||
... | ... | |
end
|
||
|
||
def queue_dns_update
|
||
if old.ip != ip or old.name != name
|
||
if old.ip != ip or old.hostname != hostname
|
||
queue.create(:name => _("Remove DNS record for %s") % old, :priority => 9,
|
||
:action => [old, :del_dns_a_record]) if old.dns?
|
||
queue.create(:name => _("Remove Reverse DNS record for %s") % old, :priority => 9,
|
||
... | ... | |
end
|
||
|
||
def dns_conflict_detected?
|
||
return false if ip.blank? or name.blank?
|
||
return false if ip.blank? or hostname.blank?
|
||
# can't validate anything if dont have an ip-address yet
|
||
return false unless require_ip_validation?
|
||
# we should only alert on conflicts if overwrite mode is off
|
Also available in: Unified diff
fixes #4599 - DNS and DHCP records for BMC and managed interfaces not using FQDN
(cherry picked from commit 21e07e92ca2d0341a09de48fadfa95625f6d9f55)