foreman_wreckingball 5.0.0 → 7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fc1a2760d1b2467a0fcae578b7307eae8d2b0fcce5ce7de9ecacc2c81601043
4
- data.tar.gz: 1680594f03c2237ba9c068f6caa0600f365bb590a14a1ee5b9cd3dab7e541a5f
3
+ metadata.gz: 1aada99cdb614e097210084df6e09b49769f50719c4c1ad4a0e611268a2c85ae
4
+ data.tar.gz: 9c90cac3690799743b273f2ebd8a9f2542ef4c5d25371c31ae26d9fab9720f5c
5
5
  SHA512:
6
- metadata.gz: 5f796c690147b26378f6518bddcd2d57535229b117e8292fe1b7ab02558a3ed9423c756ad32d9813dc65624886ebce83d227d2b9e435ed6dea5d03621b2fef7f
7
- data.tar.gz: e6fa1d5e46961f3f44ae105c1767b027c8255e3068aaf828c0a60a0992b4b6f1c1104e72f64a761cc8bc3ebb02fd2b36a4dddf59fa51d0ea2c70730abc9a1634
6
+ metadata.gz: 72ade49374a29870edf3863ecf8afdbcc993a3cc43f81bc316bbdc40c2ab1e346ae271a9d1507b7693ff471d886f36c4f605d6a9d7fd0b3f03a063cd111c99cb
7
+ data.tar.gz: 8281e7860179a8ca5fdf050c3103edfc022c185555cd39ba3d6cda61d12f01a8007b05161c85bd8e703ee9a8dade19585c97052833d7bd2b3b863f5cba7bdf4b
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ForemanWreckingball
2
2
 
3
- [<img src="https://opensourcelogos.aws.dmtech.cloud/dmTECH_opensource_logo%401x.svg" height="21" width="130">](https://www.dmtech.de/)
3
+ [<img src="https://raw.githubusercontent.com/dm-drogeriemarkt/.github/refs/heads/main/assets/dmtech-open-source-badge.svg">](https://www.dmtech.de/)
4
4
 
5
5
  This is a plugin for Foreman that adds several VMware related status checks to your Hosts in Foreman. For performance reasons, these checks are only run periodically.
6
6
 
@@ -14,6 +14,8 @@ This is a plugin for Foreman that adds several VMware related status checks to y
14
14
  | >= 1.21 | ~> 3.0 |
15
15
  | >= 2.3 | ~> 4.0 |
16
16
  | >= 3.9 | ~> 5.0 |
17
+ | >= 3.13 | ~> 6.0 |
18
+ | >= 3.19 | ~> 7.0 |
17
19
 
18
20
  ## Installation
19
21
 
@@ -15,10 +15,6 @@ module ForemanWreckingball
15
15
  'ForemanWreckingball::HardwareVersionStatus',
16
16
  ].freeze
17
17
 
18
- config.autoload_paths += Dir["#{config.root}/app/lib"]
19
- config.autoload_paths += Dir["#{config.root}/app/services"]
20
- config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
21
-
22
18
  initializer 'foreman_wreckingball.register_paths' do |_app|
23
19
  ::ForemanTasks.dynflow.config.eager_load_paths.concat(%W[#{ForemanWreckingball::Engine.root}/app/lib/actions])
24
20
  end
@@ -30,79 +26,91 @@ module ForemanWreckingball
30
26
  end
31
27
  end
32
28
 
33
- initializer 'foreman_wreckingball.register_plugin', before: :finisher_hook do |_app|
34
- Foreman::Plugin.register :foreman_wreckingball do
35
- requires_foreman '>= 3.9'
29
+ initializer 'foreman_wreckingball.register_plugin', before: :finisher_hook do |app|
30
+ app.reloader.to_prepare do
31
+ require 'foreman/cron'
32
+ Foreman::Plugin.register :foreman_wreckingball do
33
+ requires_foreman '>= 3.19'
34
+
35
+ settings do
36
+ category :wreckingball, N_('Wreckingball') do
37
+ setting :min_vsphere_hardware_version,
38
+ full_name: N_('Minimal VSphere Hardware Version'),
39
+ type: :integer,
40
+ default: 13,
41
+ description: _('Minimum required Hardware version for vSphere VMs')
42
+ setting :vsphere_compute_resource_sync,
43
+ full_name: N_('VSphere compute resource sync Cronjob enabled'),
44
+ type: :boolean,
45
+ default: false,
46
+ description: _('Enable or disable the daily sync of your VSphere compute resources')
47
+ end
48
+ end
36
49
 
37
- settings do
38
- category :wreckingball, N_('Wreckingball') do
39
- setting :min_vsphere_hardware_version,
40
- type: :integer,
41
- default: 13,
42
- description: _('Minimum required Hardware version for vSphere VMs')
50
+ automatic_assets(false)
51
+ precompile_assets(
52
+ [
53
+ 'foreman_wreckingball/modal.js',
54
+ 'foreman_wreckingball/status_hosts_table.js',
55
+ 'foreman_wreckingball/status_managed_hosts_dashboard.js',
56
+ 'foreman_wreckingball/status_row.js',
57
+ 'foreman_wreckingball/status_hosts_table.css',
58
+ 'foreman_wreckingball/status_managed_hosts_dashboard.css',
59
+ ]
60
+ )
61
+
62
+ security_block :foreman_wreckingball do
63
+ permission :refresh_vmware_status_hosts, {
64
+ 'foreman_wreckingball/hosts': %i[refresh_status_dashboard],
65
+ }, resource_type: 'Host'
66
+ permission :remediate_vmware_status_hosts, {
67
+ 'foreman_wreckingball/hosts': %i[schedule_remediate submit_remediate],
68
+ }, resource_type: 'Host'
43
69
  end
44
- end
45
70
 
46
- automatic_assets(false)
47
- precompile_assets(
48
- [
49
- 'foreman_wreckingball/modal.js',
50
- 'foreman_wreckingball/status_hosts_table.js',
51
- 'foreman_wreckingball/status_managed_hosts_dashboard.js',
52
- 'foreman_wreckingball/status_row.js',
53
- 'foreman_wreckingball/status_hosts_table.css',
54
- 'foreman_wreckingball/status_managed_hosts_dashboard.css',
71
+ # Extend built in permissions
72
+ Foreman::AccessControl.permission(:view_hosts).actions.concat [
73
+ 'foreman_wreckingball/hosts/status_dashboard',
74
+ 'foreman_wreckingball/hosts/status_managed_hosts_dashboard',
75
+ 'foreman_wreckingball/hosts/status_hosts',
55
76
  ]
56
- )
57
-
58
- security_block :foreman_wreckingball do
59
- permission :refresh_vmware_status_hosts, {
60
- 'foreman_wreckingball/hosts': %i[refresh_status_dashboard],
61
- }, resource_type: 'Host'
62
- permission :remediate_vmware_status_hosts, {
63
- 'foreman_wreckingball/hosts': %i[schedule_remediate submit_remediate],
64
- }, resource_type: 'Host'
65
- end
66
77
 
67
- # Extend built in permissions
68
- Foreman::AccessControl.permission(:view_hosts).actions.concat [
69
- 'foreman_wreckingball/hosts/status_dashboard',
70
- 'foreman_wreckingball/hosts/status_managed_hosts_dashboard',
71
- 'foreman_wreckingball/hosts/status_hosts',
72
- ]
73
-
74
- menu :top_menu,
75
- :wreckingball_status_dashboard,
76
- url_hash: { controller: :'foreman_wreckingball/hosts', action: :status_dashboard },
77
- caption: N_('VMware Status'),
78
- parent: :hosts_menu,
79
- after: :hosts
80
-
81
- WRECKINGBALL_STATUSES.each { |status| register_custom_status(status.constantize) }
82
-
83
- menu :top_menu,
84
- :wreckingball_status_managed_hosts_dashboard,
85
- url_hash: { controller: :'foreman_wreckingball/hosts', action: :status_managed_hosts_dashboard },
86
- caption: N_('VMware Managed Status'),
87
- parent: :monitor_menu,
88
- after: :audits
89
-
90
- register_facet(ForemanWreckingball::VmwareFacet, :vmware_facet)
91
-
92
- register_facet(ForemanWreckingball::VmwareHypervisorFacet, :vmware_hypervisor_facet)
93
-
94
- add_controller_action_scope('HostsController', :index) { |base_scope| base_scope.includes(:vmware_facet) }
95
-
96
- # extend host show page
97
- extend_page('compute_resources/show') do |context|
98
- context.add_pagelet :main_tabs,
99
- name: N_('Hypervisors'),
100
- partial: 'compute_resources/hypervisors_tab',
101
- onlyif: proc { |cr| cr.provider_friendly_name == 'VMware' && cr.vmware_hypervisor_facets.any? }
102
- end
78
+ menu :top_menu,
79
+ :wreckingball_status_dashboard,
80
+ url_hash: { controller: :'foreman_wreckingball/hosts', action: :status_dashboard },
81
+ caption: N_('VMware Status'),
82
+ parent: :hosts_menu,
83
+ after: :hosts
84
+
85
+ WRECKINGBALL_STATUSES.each { |status| register_custom_status(status.constantize) }
86
+
87
+ menu :top_menu,
88
+ :wreckingball_status_managed_hosts_dashboard,
89
+ url_hash: { controller: :'foreman_wreckingball/hosts', action: :status_managed_hosts_dashboard },
90
+ caption: N_('VMware Managed Status'),
91
+ parent: :monitor_menu,
92
+ after: :audits
103
93
 
104
- # add custom logger
105
- logger :import, enabled: true
94
+ register_facet(ForemanWreckingball::VmwareFacet, :vmware_facet)
95
+
96
+ register_facet(ForemanWreckingball::VmwareHypervisorFacet, :vmware_hypervisor_facet)
97
+
98
+ add_controller_action_scope('HostsController', :index) { |base_scope| base_scope.includes(:vmware_facet) }
99
+
100
+ # extend host show page
101
+ extend_page('compute_resources/show') do |context|
102
+ context.add_pagelet :main_tabs,
103
+ name: N_('Hypervisors'),
104
+ partial: 'compute_resources/hypervisors_tab',
105
+ onlyif: proc { |cr| cr.provider_friendly_name == 'VMware' && cr.vmware_hypervisor_facets.any? }
106
+ end
107
+
108
+ # add custom logger
109
+ logger :import, enabled: true
110
+
111
+ # Register recurring task with Foreman::Cron framework
112
+ Foreman::Cron.register(:daily, 'foreman_wreckingball:vmware:sync')
113
+ end
106
114
  end
107
115
  end
108
116
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanWreckingball
4
- VERSION = '5.0.0'
4
+ VERSION = '7.0.0'
5
5
  end
@@ -8,6 +8,7 @@ namespace :foreman_wreckingball do
8
8
  desc 'Synchonize VMware compute resource data'
9
9
  task sync: ['environment', 'dynflow:client'] do
10
10
  User.as_anonymous_admin do
11
+ next unless Setting['vsphere_compute_resource_sync']
11
12
  ::ForemanTasks.sync_task(::Actions::ForemanWreckingball::Vmware::ScheduleVmwareSync)
12
13
  end
13
14
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_wreckingball
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 7.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: 2024-05-14 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: foreman_puppet
@@ -189,7 +188,6 @@ homepage: https://github.com/dm-drogeriemarkt/foreman_wreckingball
189
188
  licenses:
190
189
  - GPL-3.0
191
190
  metadata: {}
192
- post_install_message:
193
191
  rdoc_options: []
194
192
  require_paths:
195
193
  - lib
@@ -207,8 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
205
  - !ruby/object:Gem::Version
208
206
  version: '0'
209
207
  requirements: []
210
- rubygems_version: 3.4.1
211
- signing_key:
208
+ rubygems_version: 4.0.20
212
209
  specification_version: 4
213
210
  summary: Adds status checks of the VMWare VMs to Foreman.
214
211
  test_files: