foreman_bootdisk 23.0.0 → 23.1.1

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: 2953eaa163391d29858def498833920f069bc5565f71ac0e535b173d8965d922
4
- data.tar.gz: 6c80849f4cca281f3d4de80758c302a3355915a7f51d7dc6234ed89b8ad7efce
3
+ metadata.gz: bd3257bab9ef8d2bd81645a9bc07a72818436797704eb457b9c0cd96822c3d2e
4
+ data.tar.gz: 2eab92f59d7a5ac630a1bc6032f46dc3d6d1eace620ddbaa4aebef7170a93175
5
5
  SHA512:
6
- metadata.gz: '09f1c3d97e04c81cfb630310c5374a53c8596ab6418a912c29163a2b2cc970b992479abc2a37925ef95d1c8d2b7c01c136f092f5562523947f10f0d9dfba788a'
7
- data.tar.gz: 6c093377e782eb515e56d61309959f041e7daacb7fa8ed1d472237399c6f96a5ea4fc5d91e782f6e3a1644dc00c67a418e0e38b4a4519fbeeebd88144193496f
6
+ metadata.gz: 87443ca44460fe71f04b47f76832ca5754d6f6ea2a0030714f01e6c873be0dfa3c268c011ed08df41347b346a50645f6a85cfa54dffb9fd90976f263bb93b709
7
+ data.tar.gz: 7bb4e64a58ad842bbee07e89ded9b0a078a2447b062b96565fede150e410e97e06c50fdc77688aad7f16ac3b6a991e903f88d34ab05af6ce374399a557c5b7b7
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ForemanBootdisk
4
+ module ComputeResources
5
+ module Proxmox
6
+ CDROM_VOLUME = 'ide2'
7
+
8
+ def capabilities
9
+ super + [:bootdisk]
10
+ end
11
+
12
+ def iso_upload(iso, vm_uuid)
13
+ server = find_vm_by_uuid(vm_uuid)
14
+ server.ssh_options = { password: fog_credentials[:proxmox_password] }
15
+ server.ssh_ip_address = proxmox_host
16
+ server.username = client.credentials[:current_user].split('@').first
17
+ server.scp_upload(iso, '/var/lib/vz/template/iso/')
18
+ server.reload
19
+ storage = storages(server.node_id, 'iso')[0]
20
+ storage.volumes.any? { |v| v.volid.include? File.basename(iso) }
21
+ end
22
+
23
+ def iso_attach(iso, vm_uuid)
24
+ server = find_vm_by_uuid(vm_uuid)
25
+ storage = storages(server.node_id, 'iso')[0]
26
+ volume = storage.volumes.detect { |v| v.volid.include? File.basename(iso) }
27
+ disks = server.disks.map { |disk| disk.split(":")[0] }.join(";")
28
+ server.update({ ide2: "#{volume.volid},media=cdrom" })
29
+ server.update({ boot: "order=ide2;#{disks}" })
30
+ server.reboot
31
+ end
32
+
33
+ def iso_detach(vm_uuid)
34
+ server = find_vm_by_uuid(vm_uuid)
35
+
36
+ # get volid to delete iso after detaching from vm
37
+ volid = server.volumes.get(CDROM_VOLUME).volid
38
+ server.update({ ide2: "none,media=cdrom" })
39
+
40
+ # cdrom will be ejected on next power off
41
+ server.detach(CDROM_VOLUME)
42
+
43
+ # delete the iso file from proxmox server
44
+ storage = storages(server.node_id, 'iso')[0]
45
+ volume = storage.volumes.detect { |v| v.volid.include? volid }
46
+ volume.destroy
47
+ end
48
+ end
49
+ end
50
+ end
@@ -12,7 +12,7 @@ module ForemanBootdisk
12
12
  if args[:provision_method] == 'bootdisk'
13
13
  args[:cdroms] = [new_cdrom]
14
14
  args[:boot_order] = %w[cdrom disk]
15
- args[:boot_retry] = 10
15
+ args[:boot_retry] = 10 * 1000 # boot_retry is in ms. Shortest is 10s
16
16
  end
17
17
  args
18
18
  end
@@ -133,6 +133,7 @@ module ForemanBootdisk
133
133
  File.join(wd, 'build', 'grub-hdd.cfg').to_s => 'GRUB.CFG',
134
134
  File.join(Setting[:bootdisk_grub2_dir], 'grubx64.efi').to_s => 'GRUBX64.EFI',
135
135
  File.join(Setting[:bootdisk_grub2_dir], 'shimx64.efi').to_s => 'BOOTX64.EFI',
136
+ File.join(Setting[:bootdisk_grub2_dir], 'mmx64.efi').to_s => 'MMX64.EFI',
136
137
  }.each do |src, dest|
137
138
  raise(Foreman::Exception.new(N_('Ensure %{file} is readable (or update "Grub2 directory" setting)'), file: src)) unless File.exist?(src)
138
139
  raise(Foreman::Exception.new(N_('Unable to mcopy %{file}'), file: src)) unless system("mcopy -m -i #{efibootimg} '#{src}' '#{"::/EFI/BOOT/#{dest}"}'")
@@ -140,6 +140,7 @@ module ForemanBootdisk
140
140
  Host::Managed.prepend ForemanBootdisk::HostExt
141
141
  Host::Managed.include ForemanBootdisk::Orchestration::Compute
142
142
  Foreman::Model::Vmware.prepend ForemanBootdisk::ComputeResources::Vmware if Foreman::Model::Vmware.available?
143
+ ForemanFogProxmox::Proxmox.prepend ForemanBootdisk::ComputeResources::Proxmox if ForemanBootdisk.with_proxmox?
143
144
  rescue StandardError => e
144
145
  Rails.logger.warn "#{ForemanBootdisk::ENGINE_NAME}: skipping engine hook (#{e})"
145
146
  end
@@ -149,4 +150,8 @@ module ForemanBootdisk
149
150
  def self.logger
150
151
  Foreman::Logging.logger('foreman_bootdisk')
151
152
  end
153
+
154
+ def self.with_proxmox?
155
+ Foreman::Plugin.installed?('foreman_fog_proxmox')
156
+ end
152
157
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanBootdisk
4
- VERSION = '23.0.0'
4
+ VERSION = '23.1.1'
5
5
  end
@@ -60,6 +60,7 @@ const HostBootdiskButtons = () => {
60
60
  isDisabled={action.disabled}
61
61
  description={action.description}
62
62
  icon={iconComponent(action.icon)}
63
+ ouiaId={`bootdisk button ${i}`}
63
64
  >
64
65
  {action.title}
65
66
  </DropdownItem>
@@ -68,6 +69,7 @@ const HostBootdiskButtons = () => {
68
69
  content = (
69
70
  <DropdownItem
70
71
  key="bootdisk-unavailable"
72
+ ouiaId="bootdisk button unavailable"
71
73
  component="button"
72
74
  href="#"
73
75
  tooltip={sprintf(
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: 23.0.0
4
+ version: 23.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-02 00:00:00.000000000 Z
11
+ date: 2025-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: theforeman-rubocop
@@ -68,6 +68,7 @@ files:
68
68
  - app/lib/foreman_bootdisk/scope/full_host_bootdisk.rb
69
69
  - app/lib/foreman_bootdisk/scope/full_host_bootdisk_efi.rb
70
70
  - app/lib/foreman_bootdisk/template_helpers.rb
71
+ - app/models/concerns/foreman_bootdisk/compute_resources/proxmox.rb
71
72
  - app/models/concerns/foreman_bootdisk/compute_resources/vmware.rb
72
73
  - app/models/concerns/foreman_bootdisk/host_ext.rb
73
74
  - app/models/concerns/foreman_bootdisk/orchestration/compute.rb
@@ -167,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
168
  - !ruby/object:Gem::Version
168
169
  version: '0'
169
170
  requirements: []
170
- rubygems_version: 3.5.22
171
+ rubygems_version: 3.2.33
171
172
  signing_key:
172
173
  specification_version: 4
173
174
  summary: Create boot disks to provision hosts with Foreman