foreman_rescue 4.0.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/db/migrate/20260617091723_remove_rescue_pxegrub_setting.rb +15 -0
- data/lib/foreman_rescue/engine.rb +23 -31
- data/lib/foreman_rescue/version.rb +1 -1
- data/test/models/host_test.rb +11 -2
- metadata +4 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '056686d37786da37f4c4dad82382e4934bdf800a3219d5865480468d7da931e4'
|
|
4
|
+
data.tar.gz: 54d533f18caded8b753e2603219ac1d7d5b9039c08211c9f325190f68e218e95
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b0e8bc5397186656746ff56e6b9d171610fda4b03542e10158dfec371d673662e9edc5bfc5bbb38829b68340d2edf7bdbb6a795a6f8732a57140173e33e5548
|
|
7
|
+
data.tar.gz: 4fe0ecdcdfa1f0666df12eee77d2d7ea204fc7c3c6468a6f469127d78345a94845744a843e71dc6b28dfabe5ceb3c5a8f0430acda332bbd62ba60b76ec06ad7d
|
data/README.md
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RemoveRescuePxegrubSetting < ActiveRecord::Migration[7.0]
|
|
4
|
+
class MigrationSettings < ApplicationRecord
|
|
5
|
+
self.table_name = :settings
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def up
|
|
9
|
+
MigrationSettings.where(name: 'rescue_pxegrub_tftp_template').delete_all
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def down
|
|
13
|
+
# no-op: the setting is re-created by plugin registration on boot if re-added
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -4,9 +4,6 @@ module ForemanRescue
|
|
|
4
4
|
class Engine < ::Rails::Engine
|
|
5
5
|
engine_name 'foreman_rescue'
|
|
6
6
|
|
|
7
|
-
config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
|
|
8
|
-
config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
|
|
9
|
-
|
|
10
7
|
# Add any db migrations
|
|
11
8
|
initializer 'foreman_rescue.load_app_instance_data' do |app|
|
|
12
9
|
ForemanRescue::Engine.paths['db/migrate'].existent.each do |path|
|
|
@@ -14,38 +11,33 @@ module ForemanRescue
|
|
|
14
11
|
end
|
|
15
12
|
end
|
|
16
13
|
|
|
17
|
-
initializer 'foreman_rescue.register_plugin', :before => :finisher_hook do |
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
settings do
|
|
22
|
-
category :rescue, N_('Rescue') do
|
|
23
|
-
setting('rescue_pxelinux_tftp_template',
|
|
24
|
-
type: :string,
|
|
25
|
-
default: 'Kickstart rescue PXELinux',
|
|
26
|
-
full_name: N_('PXELinux rescue template'),
|
|
27
|
-
description: N_('PXELinux template used when booting rescue system'),
|
|
28
|
-
collection: proc { ProvisioningTemplate.templates_by_kind('PXELinux') })
|
|
14
|
+
initializer 'foreman_rescue.register_plugin', :before => :finisher_hook do |app|
|
|
15
|
+
app.reloader.to_prepare do
|
|
16
|
+
Foreman::Plugin.register :foreman_rescue do
|
|
17
|
+
requires_foreman '>= 3.13'
|
|
29
18
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
settings do
|
|
20
|
+
category :rescue, N_('Rescue') do
|
|
21
|
+
setting('rescue_pxelinux_tftp_template',
|
|
22
|
+
type: :string,
|
|
23
|
+
default: 'Kickstart rescue PXELinux',
|
|
24
|
+
full_name: N_('PXELinux rescue template'),
|
|
25
|
+
description: N_('PXELinux template used when booting rescue system'),
|
|
26
|
+
collection: proc { ProvisioningTemplate.templates_by_kind('PXELinux') })
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
setting('rescue_pxegrub2_tftp_template',
|
|
29
|
+
type: :string,
|
|
30
|
+
default: '',
|
|
31
|
+
full_name: N_('PXEGrub2 rescue template'),
|
|
32
|
+
description: N_('PXEGrub2 template used when booting rescue system'),
|
|
33
|
+
collection: proc { ProvisioningTemplate.templates_by_kind('PXEGrub2') })
|
|
34
|
+
end
|
|
43
35
|
end
|
|
44
|
-
end
|
|
45
36
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
# Add permissions
|
|
38
|
+
security_block :foreman_rescue do
|
|
39
|
+
permission :rescue_hosts, :'foreman_rescue/hosts' => [:rescue, :set_rescue, :cancel_rescue]
|
|
40
|
+
end
|
|
49
41
|
end
|
|
50
42
|
end
|
|
51
43
|
end
|
data/test/models/host_test.rb
CHANGED
|
@@ -51,12 +51,21 @@ class HostTest < ActiveSupport::TestCase
|
|
|
51
51
|
tasks = host.queue.all.map(&:name)
|
|
52
52
|
assert_includes tasks, "Deploy TFTP PXEGrub2 config for #{host}"
|
|
53
53
|
assert_includes tasks, "Deploy TFTP PXELinux config for #{host}"
|
|
54
|
-
assert_includes tasks, "Deploy TFTP PXEGrub config for #{host}"
|
|
55
54
|
end
|
|
56
55
|
|
|
57
56
|
test 'should deploy rescue template' do
|
|
58
57
|
Setting['rescue_pxelinux_tftp_template'] = template.name
|
|
59
|
-
|
|
58
|
+
version = Foreman::Version.new
|
|
59
|
+
if version.major.to_i == 3 && version.minor.to_i <= 13
|
|
60
|
+
ProxyAPI::TFTP.any_instance.expects(:set).with('PXELinux', host.mac, :pxeconfig => template.template).once
|
|
61
|
+
else
|
|
62
|
+
ProxyAPI::TFTP.any_instance.expects(:set).with('PXELinux', host.mac, { :pxeconfig => template.template,
|
|
63
|
+
:targetos => os.name.downcase.to_s,
|
|
64
|
+
:release => host.operatingsystem.release,
|
|
65
|
+
:arch => host.arch.name,
|
|
66
|
+
:bootfile_suffix => host.arch.bootfilename_efi }).once
|
|
67
|
+
|
|
68
|
+
end
|
|
60
69
|
host.stubs(:skip_orchestration?).returns(false) # Enable orchestration
|
|
61
70
|
assert host.save
|
|
62
71
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_rescue
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Timo Goebel
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rdoc
|
|
@@ -58,6 +57,7 @@ files:
|
|
|
58
57
|
- config/routes.rb
|
|
59
58
|
- db/migrate/20170901131321_add_rescue_mode_to_host.foreman_rescue.rb
|
|
60
59
|
- db/migrate/20240506132712_migrate_rescue_settings_category_to_dsl.rb
|
|
60
|
+
- db/migrate/20260617091723_remove_rescue_pxegrub_setting.rb
|
|
61
61
|
- db/seeds.d/103-provisioning_templates.rb
|
|
62
62
|
- lib/foreman_rescue.rb
|
|
63
63
|
- lib/foreman_rescue/engine.rb
|
|
@@ -78,7 +78,6 @@ homepage: https://github.com/dm-drogeriemarkt/foreman_rescue
|
|
|
78
78
|
licenses:
|
|
79
79
|
- GPL-3.0
|
|
80
80
|
metadata: {}
|
|
81
|
-
post_install_message:
|
|
82
81
|
rdoc_options: []
|
|
83
82
|
require_paths:
|
|
84
83
|
- lib
|
|
@@ -96,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
96
95
|
- !ruby/object:Gem::Version
|
|
97
96
|
version: '0'
|
|
98
97
|
requirements: []
|
|
99
|
-
rubygems_version:
|
|
100
|
-
signing_key:
|
|
98
|
+
rubygems_version: 4.0.10
|
|
101
99
|
specification_version: 4
|
|
102
100
|
summary: Provides the ability to boot a host into a rescue system.
|
|
103
101
|
test_files:
|