foreman_rescue 4.0.1 → 5.0.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/lib/foreman_rescue/engine.rb +29 -30
- data/lib/foreman_rescue/version.rb +1 -1
- data/test/models/host_test.rb +11 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd45138c63c9ba95c38d04d10adfefdc3559c73dfd73b42f7ebcc3788fb727b7
|
4
|
+
data.tar.gz: 8de3698b0905932213fd9217b82083c52b642886a2a08da47ce7a449caab4d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59b4a5dcec262b3b166ef8f4cace5ba2ce94f4ce8ad41513952128a4eca6a8327a00e2c4a8ea200fbbe6ca4a714242497850af6ebaf06004f1a55c193df358ae
|
7
|
+
data.tar.gz: 6d091efc235c1a01d40e6e068af5f53fe0542e90c46559f6ed97bbf5e33dca670ea4fc9f259596b5f7ff0c2cf3363699f3ed3acca4a2a76d588c6a9b9b917fb5
|
data/README.md
CHANGED
@@ -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,40 @@ module ForemanRescue
|
|
14
11
|
end
|
15
12
|
end
|
16
13
|
|
17
|
-
initializer 'foreman_rescue.register_plugin', :before => :finisher_hook do |
|
18
|
-
|
19
|
-
|
14
|
+
initializer 'foreman_rescue.register_plugin', :before => :finisher_hook do |app| # rubocop:disable Metrics/BlockLength
|
15
|
+
app.reloader.to_prepare do # rubocop:disable Metrics/BlockLength
|
16
|
+
Foreman::Plugin.register :foreman_rescue do # rubocop:disable Metrics/BlockLength
|
17
|
+
requires_foreman '>= 3.13'
|
20
18
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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') })
|
29
27
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
28
|
+
setting('rescue_pxegrub_tftp_template',
|
29
|
+
type: :string,
|
30
|
+
default: '',
|
31
|
+
full_name: N_('PXEGrub rescue template'),
|
32
|
+
description: N_('PXEGrub template used when booting rescue system'),
|
33
|
+
collection: proc { ProvisioningTemplate.templates_by_kind('PXEGrub') })
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
35
|
+
setting('rescue_pxegrub2_tftp_template',
|
36
|
+
type: :string,
|
37
|
+
default: '',
|
38
|
+
full_name: N_('PXEGrub2 rescue template'),
|
39
|
+
description: N_('PXEGrub2 template used when booting rescue system'),
|
40
|
+
collection: proc { ProvisioningTemplate.templates_by_kind('PXEGrub2') })
|
41
|
+
end
|
43
42
|
end
|
44
|
-
end
|
45
43
|
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
# Add permissions
|
45
|
+
security_block :foreman_rescue do
|
46
|
+
permission :rescue_hosts, :'foreman_rescue/hosts' => [:rescue, :set_rescue, :cancel_rescue]
|
47
|
+
end
|
49
48
|
end
|
50
49
|
end
|
51
50
|
end
|
data/test/models/host_test.rb
CHANGED
@@ -56,7 +56,17 @@ class HostTest < ActiveSupport::TestCase
|
|
56
56
|
|
57
57
|
test 'should deploy rescue template' do
|
58
58
|
Setting['rescue_pxelinux_tftp_template'] = template.name
|
59
|
-
|
59
|
+
version = Foreman::Version.new
|
60
|
+
if version.major.to_i == 3 && version.minor.to_i <= 13
|
61
|
+
ProxyAPI::TFTP.any_instance.expects(:set).with('PXELinux', host.mac, :pxeconfig => template.template).once
|
62
|
+
else
|
63
|
+
ProxyAPI::TFTP.any_instance.expects(:set).with('PXELinux', host.mac, { :pxeconfig => template.template,
|
64
|
+
:targetos => os.name.downcase.to_s,
|
65
|
+
:release => host.operatingsystem.release,
|
66
|
+
:arch => host.arch.name,
|
67
|
+
:bootfile_suffix => host.arch.bootfilename_efi }).once
|
68
|
+
|
69
|
+
end
|
60
70
|
host.stubs(:skip_orchestration?).returns(false) # Enable orchestration
|
61
71
|
assert host.save
|
62
72
|
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.0.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
|
@@ -78,7 +77,6 @@ homepage: https://github.com/dm-drogeriemarkt/foreman_rescue
|
|
78
77
|
licenses:
|
79
78
|
- GPL-3.0
|
80
79
|
metadata: {}
|
81
|
-
post_install_message:
|
82
80
|
rdoc_options: []
|
83
81
|
require_paths:
|
84
82
|
- lib
|
@@ -96,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
94
|
- !ruby/object:Gem::Version
|
97
95
|
version: '0'
|
98
96
|
requirements: []
|
99
|
-
rubygems_version: 3.
|
100
|
-
signing_key:
|
97
|
+
rubygems_version: 3.6.7
|
101
98
|
specification_version: 4
|
102
99
|
summary: Provides the ability to boot a host into a rescue system.
|
103
100
|
test_files:
|