foreman_dlm 3.0.0 → 4.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b80fdd6f962a1cb1ab338f061bea43d0ea641f7b34f647c225bf6abc2a366f4
|
4
|
+
data.tar.gz: b7860026fa2dd1c7885011297483b79de657678123e1b25960c974ee4505e9cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d647bbeaeaefac4d7eb91396e68815348da49713d149b000b30619ef8b808ca86b9f0a90bb2b5409454023286399136d847d15aab1c54785c0430a455b1d480c
|
7
|
+
data.tar.gz: dc5b9bd8d089fbbecaae290e501aa7536f689cd0c8af96f154cff9fef449c8d68dea560e7051e967180c9457aa29dffd7e9bba388406e82d7a605011ef9f06e9
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Foreman Distributed Lock Manager
|
2
2
|
|
3
|
-
[<img src="https://
|
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 allows Foreman to act as a distributed lock manager.
|
6
6
|
Updates are key to security, but updates of an operating system are hard to apply and existing tools are hard to manage at scale. This might lead to a large drift between important security updates becoming available and all your hosts being successfully patched. Security experts recommend to install updates as soon as they come available. The ability to easily update software is the most effective way to improve server security. Automation is key to ensure this goal is reached.
|
@@ -16,6 +16,7 @@ With this plugin servers can acquire a lock in Foreman to ensure only one server
|
|
16
16
|
| >= 1.17 | ~> 1.0 |
|
17
17
|
| >= 3.0 | ~> 2.0 |
|
18
18
|
| >= 3.9 | ~> 3.0 |
|
19
|
+
| >= 3.13 | ~> 4.0 |
|
19
20
|
|
20
21
|
## Installation
|
21
22
|
|
data/lib/foreman_dlm/engine.rb
CHANGED
@@ -4,10 +4,6 @@ module ForemanDlm
|
|
4
4
|
class Engine < ::Rails::Engine
|
5
5
|
engine_name 'foreman_dlm'
|
6
6
|
|
7
|
-
config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
|
8
|
-
config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
|
9
|
-
config.autoload_paths += Dir["#{config.root}/app/jobs"]
|
10
|
-
|
11
7
|
# Add any db migrations
|
12
8
|
initializer 'foreman_dlm.load_app_instance_data' do |app|
|
13
9
|
ForemanDlm::Engine.paths['db/migrate'].existent.each do |path|
|
@@ -15,77 +11,79 @@ module ForemanDlm
|
|
15
11
|
end
|
16
12
|
end
|
17
13
|
|
18
|
-
initializer 'foreman_dlm.register_plugin', :before => :finisher_hook do |
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
14
|
+
initializer 'foreman_dlm.register_plugin', :before => :finisher_hook do |app|
|
15
|
+
app.reloader.to_prepare do
|
16
|
+
Foreman::Plugin.register :foreman_dlm do
|
17
|
+
requires_foreman '>= 3.13'
|
18
|
+
|
19
|
+
apipie_documented_controllers ["#{ForemanDlm::Engine.root}/app/controllers/api/v2/*.rb"]
|
20
|
+
|
21
|
+
settings do
|
22
|
+
category(:general) do
|
23
|
+
setting('dlm_stale_time',
|
24
|
+
type: :integer,
|
25
|
+
default: 4,
|
26
|
+
description: N_('Number of hours after which locked Distributed Lock is stale'),
|
27
|
+
full_name: N_('Distributed Lock stale time'),
|
28
|
+
validate: { numericality: { greater_than: 0 } })
|
29
|
+
end
|
32
30
|
end
|
33
|
-
end
|
34
31
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
32
|
+
# Add permissions
|
33
|
+
security_block :foreman_dlm do
|
34
|
+
permission :view_dlmlocks, {
|
35
|
+
:'foreman_dlm/dlmlocks' => [:index, :show, :auto_complete_search],
|
36
|
+
:'api/v2/dlmlocks' => [:index, :show],
|
37
|
+
}, :resource_type => 'ForemanDlm::Dlmlock'
|
38
|
+
|
39
|
+
permission :create_dlmlocks, {
|
40
|
+
:'api/v2/dlmlocks' => [:create],
|
41
|
+
}, :resource_type => 'ForemanDlm::Dlmlock'
|
42
|
+
|
43
|
+
permission :edit_dlmlocks, {
|
44
|
+
:'foreman_dlm/dlmlocks' => [:release, :enable, :disable],
|
45
|
+
:'api/v2/dlmlocks' => [:update, :acquire, :release],
|
46
|
+
}, :resource_type => 'ForemanDlm::Dlmlock'
|
47
|
+
|
48
|
+
permission :destroy_dlmlocks, {
|
49
|
+
:'foreman_dlm/dlmlocks' => [:destroy],
|
50
|
+
:'api/v2/dlmlocks' => [:destroy],
|
51
|
+
}, :resource_type => 'ForemanDlm::Dlmlock'
|
52
|
+
|
53
|
+
permission :view_dlmlock_events, {
|
54
|
+
:'api/v2/dlmlock_events' => [:index],
|
55
|
+
}, :resource_type => 'ForemanDlm::DlmlockEvent'
|
56
|
+
end
|
60
57
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
58
|
+
# Add a new role called 'Distributed Lock Manager' if it doesn't exist
|
59
|
+
role 'Distributed Lock Manager', [:view_dlmlocks,
|
60
|
+
:create_dlmlocks,
|
61
|
+
:edit_dlmlocks,
|
62
|
+
:destroy_dlmlocks,
|
63
|
+
:view_dlmlock_events],
|
64
|
+
'Role granting full access permissions to distributed locks'
|
65
|
+
|
66
|
+
# add menu entry
|
67
|
+
menu :top_menu, :foreman_dlm_dlmlocks,
|
68
|
+
url_hash: { controller: :'foreman_dlm/dlmlocks', action: :index },
|
69
|
+
caption: N_('Distributed Locks'),
|
70
|
+
parent: :monitor_menu,
|
71
|
+
after: :audits
|
72
|
+
|
73
|
+
# Dlm Facet
|
74
|
+
register_facet(ForemanDlm::DlmFacet, :dlm_facet) do
|
75
|
+
api_view list: 'foreman_dlm/api/v2/dlm_facets/base_with_root', single: 'foreman_dlm/api/v2/dlm_facets/show'
|
76
|
+
end
|
80
77
|
|
81
|
-
|
78
|
+
register_custom_status HostStatus::DlmlockStatus
|
82
79
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
80
|
+
# extend host show page
|
81
|
+
extend_page('hosts/show') do |context|
|
82
|
+
context.add_pagelet :main_tabs,
|
83
|
+
:name => N_('Locks'),
|
84
|
+
:partial => 'hosts/dlmlocks_tab',
|
85
|
+
:onlyif => proc { |host| host.dlm_facet }
|
86
|
+
end
|
89
87
|
end
|
90
88
|
end
|
91
89
|
end
|
data/lib/foreman_dlm/version.rb
CHANGED
@@ -22,7 +22,12 @@ class DlmlocksTest < IntegrationTestWithJavascript
|
|
22
22
|
search_bar.first('input').set('ho')
|
23
23
|
|
24
24
|
autocomplete_list = page.first('div[data-ouia-component-id="search-autocomplete-menu"]')
|
25
|
-
|
25
|
+
version = Foreman::Version.new
|
26
|
+
list = if version.major.to_i == 3 && version.minor.to_i <= 14
|
27
|
+
autocomplete_list.find_all('span.pf-c-menu__item-text').map(&:text)
|
28
|
+
else
|
29
|
+
autocomplete_list.find_all('span.pf-v5-c-menu__item-text').map(&:text)
|
30
|
+
end
|
26
31
|
|
27
32
|
assert_includes list, 'host'
|
28
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_dlm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.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
|
@@ -133,7 +132,6 @@ licenses:
|
|
133
132
|
metadata:
|
134
133
|
rubygems_mfa_required: 'true'
|
135
134
|
is_foreman_plugin: 'true'
|
136
|
-
post_install_message:
|
137
135
|
rdoc_options: []
|
138
136
|
require_paths:
|
139
137
|
- lib
|
@@ -151,8 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
149
|
- !ruby/object:Gem::Version
|
152
150
|
version: '0'
|
153
151
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
155
|
-
signing_key:
|
152
|
+
rubygems_version: 3.6.7
|
156
153
|
specification_version: 4
|
157
154
|
summary: Distributed Lock Manager for Foreman.
|
158
155
|
test_files:
|