Module: ForemanBootdisk::HostExt
- Extended by:
- ApipieDSL::Extension
- Defined in:
- app/models/concerns/foreman_bootdisk/host_ext.rb
Instance Method Summary collapse
- #bootdisk? ⇒ Boolean
- #bootdisk_build? ⇒ Boolean
- #bootdisk_downloadable? ⇒ Boolean
- #bootdisk_template ⇒ Object
- #bootdisk_template_render ⇒ Object
- #can_be_built? ⇒ Boolean
- #intel_arch? ⇒ Boolean
Instance Method Details
#bootdisk? ⇒ Boolean
26 27 28 |
# File 'app/models/concerns/foreman_bootdisk/host_ext.rb', line 26 def bootdisk? managed? && bootdisk_build? end |
#bootdisk_build? ⇒ Boolean
22 23 24 |
# File 'app/models/concerns/foreman_bootdisk/host_ext.rb', line 22 def bootdisk_build? provision_method == 'bootdisk' end |
#bootdisk_downloadable? ⇒ Boolean
30 31 32 |
# File 'app/models/concerns/foreman_bootdisk/host_ext.rb', line 30 def bootdisk_downloadable? architecture.blank? || intel_arch? end |
#bootdisk_template ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/models/concerns/foreman_bootdisk/host_ext.rb', line 9 def bootdisk_template template = ProvisioningTemplate.unscoped.find_by(name: Setting[:bootdisk_host_template]) unless template raise ::Foreman::Exception.new(N_('Unable to find template specified by %s setting'), 'bootdisk_host_template') end template end |
#bootdisk_template_render ⇒ Object
18 19 20 |
# File 'app/models/concerns/foreman_bootdisk/host_ext.rb', line 18 def bootdisk_template_render ForemanBootdisk::Renderer.new.render_template(template: bootdisk_template, host: self) end |
#can_be_built? ⇒ Boolean
38 39 40 |
# File 'app/models/concerns/foreman_bootdisk/host_ext.rb', line 38 def can_be_built? super || (managed? && bootdisk_build? && !build?) end |
#intel_arch? ⇒ Boolean
34 35 36 |
# File 'app/models/concerns/foreman_bootdisk/host_ext.rb', line 34 def intel_arch? /i.86|x86[_-]64/ =~ architecture.name end |