Revision 2fba6ad7
Added by Ondřej Pražák over 8 years ago
app/models/concerns/orchestration/tftp.rb | ||
---|---|---|
|
||
# required for pxe template url helpers
|
||
include Rails.application.routes.url_helpers
|
||
register_rebuild(:rebuild_tftp, N_('TFTP'))
|
||
end
|
||
|
||
def tftp?
|
||
... | ... | |
subnet.tftp_proxy(:variant => host.operatingsystem.pxe_variant) if tftp?
|
||
end
|
||
|
||
def rebuild_tftp
|
||
if tftp?
|
||
begin
|
||
setTFTP
|
||
rescue => e
|
||
Foreman::Logging.exception "Failed to rebuild TFTP record for #{name}, #{ip}", e, :level => :error
|
||
false
|
||
end
|
||
else
|
||
logger.info "TFTP not supported for #{name}, #{ip}, skipping orchestration rebuild"
|
||
true
|
||
end
|
||
end
|
||
|
||
protected
|
||
|
||
# Adds the host to the forward and reverse TFTP zones
|
Also available in: Unified diff
Fixes #2267 - general rebuild of TFTP, DNS, DHCP