foreman_bootdisk 5.0.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -0
- data/README.md +1 -0
- data/app/helpers/concerns/foreman_bootdisk/hosts_helper_ext.rb +1 -1
- data/app/models/concerns/foreman_bootdisk/host_ext.rb +1 -1
- data/app/services/foreman_bootdisk/renderer.rb +1 -5
- data/db/migrate/20140522185700_change_templatekind_to_bootdisk.rb +11 -3
- data/db/seeds.d/50-bootdisk_templates.rb +3 -3
- data/lib/foreman_bootdisk/engine.rb +1 -1
- data/lib/foreman_bootdisk/version.rb +1 -1
- data/test/test_plugin_helper.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffdf260d555ad64c9c24397f293902ab11750afe
|
4
|
+
data.tar.gz: 737a352d301347d4cf8a7549822e7e1b0cb5ae95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51d13826e62222446b190c2d031f24a9cbd360f8e3e8f7aab0024b2b392edafd1b56a01c6f000594581cef58c8e8fed27e529fdb434ca737f5d91c5afc7e01e0
|
7
|
+
data.tar.gz: d3c6946fe6fbdede2d47edeb0844dbbc3625bf46ad1e7dfdf07e4aa695967de44d70aef37dc8ad7f1dfbe635fdfb4ffc5a7eb1ed00b3f6481940316349db222d
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v6.0.0
|
4
|
+
* compatibility with Foreman 1.9 template changes (#10773)
|
5
|
+
* generate correct links under sub-URI (#10494)
|
6
|
+
* fix tests on Foreman 1.9
|
7
|
+
* remove old compatibility warning
|
8
|
+
* requires Foreman 1.9+
|
9
|
+
|
3
10
|
## v5.0.0
|
4
11
|
* configure host provisioning interface in host ISO, not primary
|
5
12
|
* syslinux v6 compatibility, include ldlinux.c32
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ module ForemanBootdisk::HostsHelperExt
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def bootdisk_url(options)
|
32
|
-
ForemanBootdisk::Engine.routes.url_for(options.merge(:only_path => true))
|
32
|
+
ForemanBootdisk::Engine.routes.url_for(options.merge(:only_path => true, :script_name => foreman_bootdisk_path))
|
33
33
|
end
|
34
34
|
|
35
35
|
def bootdisk_authorized_for(options)
|
@@ -4,7 +4,7 @@ module ForemanBootdisk::HostExt
|
|
4
4
|
extend ActiveSupport::Concerns
|
5
5
|
|
6
6
|
def bootdisk_template
|
7
|
-
|
7
|
+
ProvisioningTemplate.find_by_name(Setting[:bootdisk_host_template]) || raise(::Foreman::Exception.new(N_('Unable to find template specified by %s setting'), 'bootdisk_host_template'))
|
8
8
|
end
|
9
9
|
|
10
10
|
def bootdisk_template_render
|
@@ -6,11 +6,7 @@ module ForemanBootdisk
|
|
6
6
|
include Rails.application.routes.url_helpers
|
7
7
|
|
8
8
|
def generic_template_render
|
9
|
-
|
10
|
-
raise(::Foreman::Exception.new(N_('Bootdisk is not supported with safemode rendering, please disable safemode_render under Adminster>Settings')))
|
11
|
-
end
|
12
|
-
|
13
|
-
tmpl = ConfigTemplate.find_by_name(Setting[:bootdisk_generic_host_template]) || raise(::Foreman::Exception.new(N_('Unable to find template specified by %s setting'), 'bootdisk_generic_host_template'))
|
9
|
+
tmpl = ProvisioningTemplate.find_by_name(Setting[:bootdisk_generic_host_template]) || raise(::Foreman::Exception.new(N_('Unable to find template specified by %s setting'), 'bootdisk_generic_host_template'))
|
14
10
|
@host = Struct.new(:token, :subnet).new(nil, nil)
|
15
11
|
unattended_render(tmpl.template)
|
16
12
|
end
|
@@ -1,12 +1,20 @@
|
|
1
1
|
class ChangeTemplatekindToBootdisk < ActiveRecord::Migration
|
2
|
+
class FakeConfigTemplate < ActiveRecord::Base
|
3
|
+
if ActiveRecord::Migrator.get_all_versions.include?(20150514072626)
|
4
|
+
self.table_name = 'templates'
|
5
|
+
else
|
6
|
+
self.table_name = 'config_templates'
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
2
10
|
def self.up
|
3
11
|
kind = TemplateKind.find_or_create_by_name('Bootdisk')
|
4
12
|
|
5
13
|
tmpl_h = Setting.find_by_name('bootdisk_host_template').try(:value)
|
6
14
|
tmpl_g = Setting.find_by_name('bootdisk_generic_host_template').try(:value)
|
7
15
|
|
8
|
-
(
|
9
|
-
|
16
|
+
(FakeConfigTemplate.unscoped.where('name LIKE ?', '%Boot disk%') |
|
17
|
+
FakeConfigTemplate.unscoped.where(:name => [tmpl_h, tmpl_g].compact)).each do |tmpl|
|
10
18
|
tmpl.update_attribute(:template_kind_id, kind.id)
|
11
19
|
end
|
12
20
|
end
|
@@ -15,7 +23,7 @@ class ChangeTemplatekindToBootdisk < ActiveRecord::Migration
|
|
15
23
|
old_kind = TemplateKind.find_by_name('Bootdisk')
|
16
24
|
new_kind = TemplateKind.find_by_name('iPXE')
|
17
25
|
if old_kind.present? && new_kind.present?
|
18
|
-
|
26
|
+
FakeConfigTemplate.unscoped.where(:template_kind_id => old_kind.id).update_all(:template_kind_id => new_kind.id)
|
19
27
|
end
|
20
28
|
end
|
21
29
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
kind = TemplateKind.find_or_create_by_name('Bootdisk')
|
2
2
|
|
3
|
-
|
3
|
+
ProvisioningTemplate.without_auditing do
|
4
4
|
content = File.read(File.join(ForemanBootdisk::Engine.root, 'app', 'views', 'foreman_bootdisk', 'host.erb'))
|
5
|
-
tmpl =
|
5
|
+
tmpl = ProvisioningTemplate.find_or_create_by_name(
|
6
6
|
:name => 'Boot disk iPXE - host',
|
7
7
|
:template_kind_id => kind.id,
|
8
8
|
:snippet => false,
|
@@ -17,7 +17,7 @@ ConfigTemplate.without_auditing do
|
|
17
17
|
tmpl.save!(:validate => false) if tmpl.changes.present?
|
18
18
|
|
19
19
|
content = File.read(File.join(ForemanBootdisk::Engine.root, 'app', 'views', 'foreman_bootdisk', 'generic_host.erb'))
|
20
|
-
tmpl =
|
20
|
+
tmpl = ProvisioningTemplate.find_or_create_by_name(
|
21
21
|
:name => 'Boot disk iPXE - generic host',
|
22
22
|
:template_kind_id => kind.id,
|
23
23
|
:snippet => false,
|
@@ -28,7 +28,7 @@ module ForemanBootdisk
|
|
28
28
|
|
29
29
|
initializer 'foreman_bootdisk.register_plugin', :after=> :finisher_hook do |app|
|
30
30
|
Foreman::Plugin.register :foreman_bootdisk do
|
31
|
-
requires_foreman '>= 1.
|
31
|
+
requires_foreman '>= 1.9'
|
32
32
|
|
33
33
|
security_block :bootdisk do |map|
|
34
34
|
permission :download_bootdisk, {:'foreman_bootdisk/disks' => [:generic, :host, :full_host, :help],
|
data/test/test_plugin_helper.rb
CHANGED
@@ -21,7 +21,8 @@ class ActionController::TestCase
|
|
21
21
|
|
22
22
|
def setup_host
|
23
23
|
disable_orchestration
|
24
|
-
|
25
|
-
|
24
|
+
org, loc = FactoryGirl.create(:organization), FactoryGirl.create(:location)
|
25
|
+
subnet = FactoryGirl.create(:subnet, :gateway => '10.0.1.254', :dns_primary => '8.8.8.8', :organizations => [org], :locations => [loc])
|
26
|
+
@host = FactoryGirl.create(:host, :managed, :subnet => subnet, :ip => subnet.network.sub(/0$/, '4'), :organization => org, :location => loc)
|
26
27
|
end
|
27
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_bootdisk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominic Cleal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Plugin for Foreman that creates iPXE-based boot disks to provision hosts
|
14
14
|
without the need for PXE infrastructure.
|