foreman_maintain 0.6.14 → 0.6.15
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/definitions/features/dynflow_sidekiq.rb +7 -4
- data/definitions/procedures/service/list.rb +12 -2
- data/lib/foreman_maintain.rb +2 -0
- data/lib/foreman_maintain/cli/upgrade_command.rb +3 -0
- data/lib/foreman_maintain/concerns/primary_checks.rb +23 -0
- data/lib/foreman_maintain/utils/service/systemd.rb +2 -1
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddf7d7720cb922e61c0d6245c14929ebb3745307b7b166f89921667a4948d4f1
|
4
|
+
data.tar.gz: 88c7794cbeb2c13d0bb8e86f4762a516ceec7e7ac48aa03b4c00bcb12bcbe33f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 786f1416f313f3a60d8109edf2c25636770c6592ffb74d921587d23b4da89f1fdd034cb42e610a1df86b54d9118e97b12f7bc8e004019ab664655d577893c1f9
|
7
|
+
data.tar.gz: 672090585c8fa8b490af89bc9fe14b94aca471ef1457e0553697285e24f20878e2c9743054c6451364418f6d403f129bef6636c7615605a43503843a133b7c83
|
@@ -7,10 +7,6 @@ class Features::DynflowSidekiq < ForemanMaintain::Feature
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
def services
|
11
|
-
service_names.map { |service| system_service service, instance_priority(service) }
|
12
|
-
end
|
13
|
-
|
14
10
|
def config_files
|
15
11
|
# Workaround until foreman-installer can deploy scaled workers
|
16
12
|
service_symlinks = configured_instances.map do |service|
|
@@ -22,6 +18,13 @@ class Features::DynflowSidekiq < ForemanMaintain::Feature
|
|
22
18
|
].flatten
|
23
19
|
end
|
24
20
|
|
21
|
+
def services
|
22
|
+
service_names.map do |service|
|
23
|
+
system_service service, instance_priority(service),
|
24
|
+
:instance_parent_unit => 'dynflow-sidekiq@'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
25
28
|
private
|
26
29
|
|
27
30
|
def instance_priority(instance)
|
@@ -16,12 +16,22 @@ module Procedures::Service
|
|
16
16
|
|
17
17
|
def unit_files_list(services)
|
18
18
|
if systemd_installed?
|
19
|
-
|
20
|
-
|
19
|
+
execute("systemctl list-unit-files --type=service | \
|
20
|
+
grep '#{build_regex_for_services(services)}'")
|
21
21
|
else
|
22
22
|
regex = services.map { |service| "^#{service.name} " }.join('\|')
|
23
23
|
execute("chkconfig --list 2>&1 | grep '#{regex}'")
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
def build_regex_for_services(services)
|
28
|
+
services.map do |service|
|
29
|
+
if service.respond_to?(:instance_parent_unit) && service.instance_parent_unit
|
30
|
+
"^#{service.instance_parent_unit}.service"
|
31
|
+
else
|
32
|
+
"^#{service.name}.service"
|
33
|
+
end
|
34
|
+
end.join('\|')
|
35
|
+
end
|
26
36
|
end
|
27
37
|
end
|
data/lib/foreman_maintain.rb
CHANGED
@@ -21,6 +21,7 @@ module ForemanMaintain
|
|
21
21
|
require 'foreman_maintain/concerns/base_database'
|
22
22
|
require 'foreman_maintain/concerns/directory_marker'
|
23
23
|
require 'foreman_maintain/concerns/downstream'
|
24
|
+
require 'foreman_maintain/concerns/primary_checks'
|
24
25
|
require 'foreman_maintain/top_level_modules'
|
25
26
|
require 'foreman_maintain/yaml_storage'
|
26
27
|
require 'foreman_maintain/config'
|
@@ -41,6 +42,7 @@ module ForemanMaintain
|
|
41
42
|
require 'foreman_maintain/error'
|
42
43
|
|
43
44
|
class << self
|
45
|
+
include ForemanMaintain::Concerns::PrimaryChecks
|
44
46
|
attr_accessor :config, :logger
|
45
47
|
|
46
48
|
LOGGER_LEVEL_MAPPING = {
|
@@ -56,6 +56,7 @@ module ForemanMaintain
|
|
56
56
|
disable_self_upgrade_option
|
57
57
|
|
58
58
|
def execute
|
59
|
+
ForemanMaintain.validate_downstream_packages
|
59
60
|
ForemanMaintain.perform_self_upgrade unless disable_self_upgrade?
|
60
61
|
print_versions(UpgradeRunner.available_targets)
|
61
62
|
end
|
@@ -67,6 +68,7 @@ module ForemanMaintain
|
|
67
68
|
disable_self_upgrade_option
|
68
69
|
|
69
70
|
def execute
|
71
|
+
ForemanMaintain.validate_downstream_packages
|
70
72
|
ForemanMaintain.perform_self_upgrade unless disable_self_upgrade?
|
71
73
|
upgrade_runner.run_phase(:pre_upgrade_checks)
|
72
74
|
exit upgrade_runner.exit_code
|
@@ -86,6 +88,7 @@ module ForemanMaintain
|
|
86
88
|
end
|
87
89
|
|
88
90
|
def execute
|
91
|
+
ForemanMaintain.validate_downstream_packages
|
89
92
|
ForemanMaintain.perform_self_upgrade unless disable_self_upgrade?
|
90
93
|
if phase
|
91
94
|
upgrade_runner.run_phase(phase.to_sym)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module ForemanMaintain
|
2
|
+
module Concerns
|
3
|
+
module PrimaryChecks
|
4
|
+
def validate_downstream_packages
|
5
|
+
return unless detector.feature(:installer) && detector.feature(:installer).with_scenarios?
|
6
|
+
if (package = package_name) && !package_manager.installed?(package)
|
7
|
+
raise ForemanMaintain::Error::Fail,
|
8
|
+
"Error: Important rpm package #{package} is not installed!"\
|
9
|
+
"\nInstall #{package} rpm to ensure system consistency."
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def package_name
|
14
|
+
installed_scenario = detector.feature(:installer).last_scenario
|
15
|
+
if installed_scenario == 'satellite'
|
16
|
+
'satellite'
|
17
|
+
elsif installed_scenario == 'capsule'
|
18
|
+
'satellite-capsule'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,16 +1,17 @@
|
|
1
1
|
module ForemanMaintain::Utils
|
2
2
|
module Service
|
3
3
|
class Systemd < Abstract
|
4
|
+
attr_reader :instance_parent_unit
|
4
5
|
def initialize(name, priority, options = {})
|
5
6
|
super
|
6
7
|
@sys = SystemHelpers.new
|
8
|
+
@instance_parent_unit = options.fetch(:instance_parent_unit, nil)
|
7
9
|
end
|
8
10
|
|
9
11
|
def command(action, options = {})
|
10
12
|
do_wait = options.fetch(:wait, true) # wait for service to start
|
11
13
|
all = @options.fetch(:all, false)
|
12
14
|
skip_enablement = @options.fetch(:skip_enablement, false)
|
13
|
-
|
14
15
|
if skip_enablement && %w[enable disable].include?(action)
|
15
16
|
return skip_enablement_message(action, @name)
|
16
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_maintain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -338,6 +338,7 @@ files:
|
|
338
338
|
- lib/foreman_maintain/concerns/hammer.rb
|
339
339
|
- lib/foreman_maintain/concerns/logger.rb
|
340
340
|
- lib/foreman_maintain/concerns/metadata.rb
|
341
|
+
- lib/foreman_maintain/concerns/primary_checks.rb
|
341
342
|
- lib/foreman_maintain/concerns/reporter.rb
|
342
343
|
- lib/foreman_maintain/concerns/scenario_metadata.rb
|
343
344
|
- lib/foreman_maintain/concerns/system_helpers.rb
|