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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd0bce1ad2fa35f301d40febfbeccede3ed3d5134ece9a75a27f6b468bb8e2ae
4
- data.tar.gz: f2d4236c22ae308055658f79811b2dd7b88b15b9669b353db942a6610131e7ae
3
+ metadata.gz: '056686d37786da37f4c4dad82382e4934bdf800a3219d5865480468d7da931e4'
4
+ data.tar.gz: 54d533f18caded8b753e2603219ac1d7d5b9039c08211c9f325190f68e218e95
5
5
  SHA512:
6
- metadata.gz: fe7c1775d102b27647d909ee0a0e1df46fcf3ea5dd4090fde64d793f03c44965f24a071e781973422579b576e15e838d881d2d57f4d2ef801616594a57d94deb
7
- data.tar.gz: 269e2a963a5d9030794832dff7f18541cbafe183c47495c2e6a9aef51ad31379ca8a5f2df0b4c1c48eab74465eca5a76429cdfac8ea04cbc4877d013ba6a638f
6
+ metadata.gz: 8b0e8bc5397186656746ff56e6b9d171610fda4b03542e10158dfec371d673662e9edc5bfc5bbb38829b68340d2edf7bdbb6a795a6f8732a57140173e33e5548
7
+ data.tar.gz: 4fe0ecdcdfa1f0666df12eee77d2d7ea204fc7c3c6468a6f469127d78345a94845744a843e71dc6b28dfabe5ceb3c5a8f0430acda332bbd62ba60b76ec06ad7d
data/README.md CHANGED
@@ -13,6 +13,7 @@ This plugin allows a user to boot a Foreman host into a rescue system via PXE.
13
13
  | >= 1.20 | ~> 2.0 |
14
14
  | >= 1.21 | ~> 3.0 |
15
15
  | >= 3.9 | ~> 4.0 |
16
+ | >= 3.13 | ~> 5.0 |
16
17
 
17
18
  ## Installation
18
19
 
@@ -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 |_app| # rubocop:disable Metrics/BlockLength
18
- Foreman::Plugin.register :foreman_rescue do # rubocop:disable Metrics/BlockLength
19
- requires_foreman '>= 3.9'
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
- setting('rescue_pxegrub_tftp_template',
31
- type: :string,
32
- default: '',
33
- full_name: N_('PXEGrub rescue template'),
34
- description: N_('PXEGrub template used when booting rescue system'),
35
- collection: proc { ProvisioningTemplate.templates_by_kind('PXEGrub') })
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
- setting('rescue_pxegrub2_tftp_template',
38
- type: :string,
39
- default: '',
40
- full_name: N_('PXEGrub2 rescue template'),
41
- description: N_('PXEGrub2 template used when booting rescue system'),
42
- collection: proc { ProvisioningTemplate.templates_by_kind('PXEGrub2') })
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
- # Add permissions
47
- security_block :foreman_rescue do
48
- permission :rescue_hosts, :'foreman_rescue/hosts' => [:rescue, :set_rescue, :cancel_rescue]
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanRescue
4
- VERSION = '4.0.1'
4
+ VERSION = '5.1.0'
5
5
  end
@@ -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
- ProxyAPI::TFTP.any_instance.expects(:set).with('PXELinux', host.mac, :pxeconfig => template.template).once
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.0.1
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: 2024-05-17 00:00:00.000000000 Z
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: 3.4.1
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: