Sha256: d1b4d896e5d06abd0e5c916d865db564cdf0e5f9727ea9b8d23d79a3ad04d38d
Contents?: true
Size: 1003 Bytes
Versions: 36
Compression:
Stored size: 1003 Bytes
Contents
organizations = Organization.unscoped.all locations = Location.unscoped.all kind = TemplateKind.unscoped.find_or_create_by(name: 'kexec') kind.description = N_("Command line options for kexec during PXE-less provisioning.") kind.save! ProvisioningTemplate.without_auditing do [['redhat_kexec.erb', 'Red Hat'], ['debian_kexec.erb', 'Debian']].each do |tmpl_names| content = File.read(File.join(ForemanDiscovery::Engine.root, 'app', 'views', 'foreman_discovery', tmpl_names[0])) tmpl = ProvisioningTemplate.unscoped.where(:name => "Discovery #{tmpl_names[1]} kexec").first_or_create( :template_kind_id => kind.id, :snippet => false, :template => content ) tmpl.attributes = { :template => content, :default => true, :vendor => "Foreman Discovery", :locked => true } tmpl.template = content tmpl.organizations = organizations tmpl.locations = locations tmpl.save!(:validate => false) if tmpl.changes.present? end end
Version data entries
36 entries across 36 versions & 1 rubygems