foreman_bootdisk 19.0.4.1 → 19.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c50d87e902b43ec4b94df5845e8f5f660663e9d9220285401e223e2e2cdf3624
|
4
|
+
data.tar.gz: 3b1092081bda0337d725ecb66ce3e2acd2ffbf2e32fd179e34f11ee3bc137b28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaa41fe654e374bc71a02a8fd30b5b74cb50e15cded72af4375e4df943dd890f086abe973a376dc84bb5f307bd8e1c62bb5f27505176ff5299229110434b1760
|
7
|
+
data.tar.gz: 978d4631aa89857baf2a8b1e26fd19917e5118fb482f03ddfe7a3ac5b52ed78f71f85142a2d3a8a0b17eb4aebbda2e6f9b081e6fe8075c6490c32f85a4d3cd68
|
@@ -14,8 +14,8 @@ module ForemanBootdisk
|
|
14
14
|
optional :mac, String, 'MAC address of the host', default: 'MAC address of the current host'
|
15
15
|
optional :action, String, 'Bootloader to use', default: 'iPXE'
|
16
16
|
returns String, desc: 'URL for boot chain'
|
17
|
-
example 'bootdisk_chain_url #=> "http://foreman.
|
18
|
-
example 'bootdisk_chain_url("00:11:22:33:44:55") #=> "http://foreman.
|
17
|
+
example 'bootdisk_chain_url #=> "http://foreman.example.com/unattended/iPXE?mac=00%3A11%3A22%3A33%3A44%3A55"'
|
18
|
+
example 'bootdisk_chain_url("00:11:22:33:44:55") #=> "http://foreman.example.com/unattended/iPXE?mac=00%3A11%3A22%3A33%3A44%3A55"'
|
19
19
|
end
|
20
20
|
def bootdisk_chain_url(mac = host.try(:mac), action = 'iPXE')
|
21
21
|
url = foreman_url(action)
|
@@ -24,7 +24,7 @@ module ForemanBootdisk
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def bootdisk?
|
27
|
-
managed? && bootdisk_build?
|
27
|
+
managed? && bootdisk_build?
|
28
28
|
end
|
29
29
|
|
30
30
|
def bootdisk_downloadable?
|
@@ -36,7 +36,7 @@ module ForemanBootdisk
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def can_be_built?
|
39
|
-
super || (managed? &&
|
39
|
+
super || (managed? && bootdisk_build? && !build?)
|
40
40
|
end
|
41
41
|
|
42
42
|
apipie_update :class do
|
@@ -1,31 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Setting
|
4
|
-
class Bootdisk
|
5
|
-
def self.default_settings
|
6
|
-
ipxe = ['/usr/lib/ipxe'].find { |p| File.exist?(p) } || '/usr/share/ipxe'
|
7
|
-
isolinux = ['/usr/lib/ISOLINUX'].find { |p| File.exist?(p) } || '/usr/share/syslinux'
|
8
|
-
syslinux = ['/usr/lib/syslinux/modules/bios', '/usr/lib/syslinux'].find { |p| File.exist?(p) } || '/usr/share/syslinux'
|
9
|
-
grub2 = ['/var/lib/tftpboot/grub2'].find { |p| File.exist?(p) } || '/var/lib/foreman/bootdisk'
|
10
|
-
templates = -> { Hash[ProvisioningTemplate.where(template_kind: TemplateKind.where(name: 'Bootdisk')).map { |temp| [temp[:name], temp[:name]] }] }
|
11
|
-
|
12
|
-
[
|
13
|
-
set('bootdisk_ipxe_dir', N_('Path to directory containing iPXE images'), ipxe, N_('iPXE directory')),
|
14
|
-
set('bootdisk_isolinux_dir', N_('Path to directory containing isolinux images'), isolinux, N_('ISOLINUX directory')),
|
15
|
-
set('bootdisk_syslinux_dir', N_('Path to directory containing syslinux images'), syslinux, N_('SYSLINUX directory')),
|
16
|
-
set('bootdisk_grub2_dir', N_('Path to directory containing grubx64.efi and shimx64.efi'), grub2, N_('Grub2 directory')),
|
17
|
-
set('bootdisk_host_template', N_('iPXE template to use for host-specific boot disks'),
|
18
|
-
'Boot disk iPXE - host', N_('Host image template'), nil, collection: templates),
|
19
|
-
set('bootdisk_generic_host_template', N_('iPXE template to use for generic host boot disks'),
|
20
|
-
'Boot disk iPXE - generic host', N_('Generic image template'), nil, collection: templates),
|
21
|
-
set('bootdisk_generic_efi_host_template', N_('Grub2 template to use for generic EFI host boot disks'),
|
22
|
-
'Boot disk Grub2 EFI - generic host', N_('Generic Grub2 EFI image template'), nil, collection: templates),
|
23
|
-
set('bootdisk_mkiso_command', N_('Command to generate ISO image, use genisoimage or mkisofs'), 'genisoimage', N_('ISO generation command')),
|
24
|
-
set('bootdisk_cache_media', N_('Installation media files will be cached for full host images'), true, N_('Installation media caching')),
|
25
|
-
set('bootdisk_allowed_types', N_('List of allowed bootdisk types, remove type to disable it'), Setting::Bootdisk.bootdisk_types, N_('Allowed bootdisk types'))
|
26
|
-
]
|
27
|
-
end
|
28
|
-
|
4
|
+
class Bootdisk
|
29
5
|
def self.humanized_category
|
30
6
|
N_('Boot disk')
|
31
7
|
end
|
@@ -17,15 +17,6 @@ module ForemanBootdisk
|
|
17
17
|
app.routes_reloader.paths << "#{ForemanBootdisk::Engine.root}/config/routes/mount_engine.rb"
|
18
18
|
end
|
19
19
|
|
20
|
-
initializer 'foreman_bootdisk.load_default_settings', before: :load_config_initializers do |_app|
|
21
|
-
table_exists = begin
|
22
|
-
Setting.table_exists?
|
23
|
-
rescue StandardError
|
24
|
-
false
|
25
|
-
end
|
26
|
-
require_dependency File.expand_path('../../app/models/setting/bootdisk.rb', __dir__) if table_exists
|
27
|
-
end
|
28
|
-
|
29
20
|
initializer 'foreman_bootdisk.load_app_instance_data' do |app|
|
30
21
|
ForemanBootdisk::Engine.paths['db/migrate'].existent.each do |path|
|
31
22
|
app.config.paths['db/migrate'] << path
|
@@ -38,7 +29,7 @@ module ForemanBootdisk
|
|
38
29
|
|
39
30
|
initializer 'foreman_bootdisk.register_plugin', before: :finisher_hook do |_app|
|
40
31
|
Foreman::Plugin.register :foreman_bootdisk do
|
41
|
-
requires_foreman '>= 3.
|
32
|
+
requires_foreman '>= 3.3'
|
42
33
|
# Add Global files for extending foreman-core components and routes
|
43
34
|
register_global_js_file 'global'
|
44
35
|
|
@@ -50,7 +41,6 @@ module ForemanBootdisk
|
|
50
41
|
end
|
51
42
|
|
52
43
|
role 'Boot disk access', [:download_bootdisk], 'Role granting permissions to download bootdisks'
|
53
|
-
|
54
44
|
add_all_permissions_to_default_roles
|
55
45
|
|
56
46
|
apipie_documented_controllers ["#{ForemanBootdisk::Engine.root}/app/controllers/foreman_bootdisk/api/v2/*.rb"]
|
@@ -65,6 +55,81 @@ module ForemanBootdisk
|
|
65
55
|
cx.add_pagelet :subnet_index_action_buttons, name: 'Bootdisk', partial: 'subnets/bootdisk_action_buttons'
|
66
56
|
cx.add_pagelet :subnet_index_title_buttons, name: 'Bootdisk', partial: 'subnets/bootdisk_title_buttons'
|
67
57
|
end
|
58
|
+
|
59
|
+
settings do
|
60
|
+
category :bootdisk, N_("Boot disk") do
|
61
|
+
ipxe = ['/usr/lib/ipxe'].find { |p| File.exist?(p) } || '/usr/share/ipxe'
|
62
|
+
isolinux = ['/usr/lib/ISOLINUX'].find { |p| File.exist?(p) } || '/usr/share/syslinux'
|
63
|
+
syslinux = ['/usr/lib/syslinux/modules/bios', '/usr/lib/syslinux'].find { |p| File.exist?(p) } || '/usr/share/syslinux'
|
64
|
+
grub2 = ['/var/lib/tftpboot/grub2'].find { |p| File.exist?(p) } || '/var/lib/foreman/bootdisk'
|
65
|
+
templates = -> {
|
66
|
+
Hash[ProvisioningTemplate.where(template_kind: TemplateKind.where(name: 'Bootdisk')).map { |temp| [temp[:name], temp[:name]] }]
|
67
|
+
}
|
68
|
+
|
69
|
+
setting "bootdisk_ipxe_dir",
|
70
|
+
type: :string,
|
71
|
+
default: ipxe,
|
72
|
+
full_name: N_("iPXE directory"),
|
73
|
+
description: N_("Path to directory containing iPXE images")
|
74
|
+
|
75
|
+
setting "bootdisk_isolinux_dir",
|
76
|
+
type: :string,
|
77
|
+
default: isolinux,
|
78
|
+
full_name: N_("ISOLINUX directory"),
|
79
|
+
description: N_("Path to directory containing isolinux images")
|
80
|
+
|
81
|
+
setting "bootdisk_syslinux_dir",
|
82
|
+
type: :string,
|
83
|
+
default: syslinux,
|
84
|
+
full_name: N_("SYSLINUX directory"),
|
85
|
+
description: N_("Path to directory containing syslinux images")
|
86
|
+
|
87
|
+
setting "bootdisk_grub2_dir",
|
88
|
+
type: :string,
|
89
|
+
default: grub2,
|
90
|
+
full_name: N_("Grub2 directory"),
|
91
|
+
description: N_("Path to directory containing grubx64.efi and shimx64.efi")
|
92
|
+
|
93
|
+
setting "bootdisk_host_template",
|
94
|
+
type: :string,
|
95
|
+
collection: templates,
|
96
|
+
default: "Boot disk iPXE - host",
|
97
|
+
full_name: N_("Host image template"),
|
98
|
+
description: N_("iPXE template to use for host-specific boot disks")
|
99
|
+
|
100
|
+
setting "bootdisk_generic_host_template",
|
101
|
+
type: :string,
|
102
|
+
collection: templates,
|
103
|
+
default: "Boot disk iPXE - generic host",
|
104
|
+
full_name: N_("Generic image template"),
|
105
|
+
description: N_("iPXE template to use for generic host boot disks")
|
106
|
+
|
107
|
+
setting "bootdisk_generic_efi_host_template",
|
108
|
+
type: :string,
|
109
|
+
collection: templates,
|
110
|
+
default: "Boot disk Grub2 EFI - generic host",
|
111
|
+
full_name: N_("Generic Grub2 EFI image template"),
|
112
|
+
description: N_("iPXE template to use for generic EFI host boot disks")
|
113
|
+
|
114
|
+
setting "bootdisk_mkiso_command",
|
115
|
+
type: :string,
|
116
|
+
default: "genisoimage",
|
117
|
+
full_name: N_("ISO generation command"),
|
118
|
+
description: N_("Command to generate ISO image, use genisoimage or mkisofs")
|
119
|
+
|
120
|
+
setting "bootdisk_cache_media",
|
121
|
+
type: :boolean,
|
122
|
+
default: true,
|
123
|
+
full_name: N_("Installation media caching"),
|
124
|
+
description: N_("Installation media files will be cached for full host images")
|
125
|
+
|
126
|
+
setting "bootdisk_allowed_types",
|
127
|
+
type: :string,
|
128
|
+
default: Setting::Bootdisk.bootdisk_types,
|
129
|
+
full_name: N_("Allowed bootdisk types"),
|
130
|
+
description: N_("List of allowed bootdisk types, remove type to disable it")
|
131
|
+
end
|
132
|
+
end
|
68
133
|
end
|
69
134
|
end
|
70
135
|
|
@@ -77,7 +142,7 @@ module ForemanBootdisk
|
|
77
142
|
config.to_prepare do
|
78
143
|
begin
|
79
144
|
Host::Managed.prepend ForemanBootdisk::HostExt
|
80
|
-
Host::Managed.include ForemanBootdisk::Orchestration::Compute
|
145
|
+
Host::Managed.include ForemanBootdisk::Orchestration::Compute
|
81
146
|
HostsHelper.prepend ForemanBootdisk::HostsHelperExt
|
82
147
|
SubnetsHelper.prepend ForemanBootdisk::SubnetsHelperExt
|
83
148
|
Foreman::Model::Vmware.prepend ForemanBootdisk::ComputeResources::Vmware if Foreman::Model::Vmware.available?
|
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: 19.0.
|
4
|
+
version: 19.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominic Cleal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: theforeman-rubocop
|
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.1.4
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: Create boot disks to provision hosts with Foreman
|