foreman_maintain 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/definitions/checks/package_manager/yum/validate_yum_config.rb +1 -3
- data/definitions/features/nftables.rb +5 -3
- data/definitions/procedures/content/prepare.rb +1 -0
- data/definitions/procedures/content/switchover.rb +1 -0
- data/definitions/procedures/restore/candlepin_reset_migrations.rb +14 -0
- data/definitions/scenarios/restore.rb +2 -1
- data/lib/foreman_maintain/concerns/firewall/nftables_maintenance_mode.rb +3 -3
- data/lib/foreman_maintain/concerns/metadata.rb +4 -0
- data/lib/foreman_maintain/reporter/cli_reporter.rb +24 -6
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +3 -3
- data/definitions/procedures/packages/enable_version_locking.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d333d2c850308e6bf590acee0dfd55d4b257cdebebb7b148e4ef49fe48f001dd
|
4
|
+
data.tar.gz: eac9b73a13ff0f7829ddf0cea8380491884d6631e3d42ca42b9b88e76bbd4698
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f402842dfca9d32804e9825f9a7552c2eac13e81244b80436d46b51a79e8330ce208fcf91c9bf0d5d0bafd3b46ea868916bb54e6c3b8a486273cfed2cb672d2
|
7
|
+
data.tar.gz: 20f99acb920a6a6cd1496e3b9429f635dc24275ce9bd8a70bceb44202147cc8ce9f9930de631a3e0ffac3b80c80b2526ada9ce3e88fe4b690dff0d9fa6aa101c
|
@@ -41,9 +41,7 @@ module Checks::PackageManager
|
|
41
41
|
|
42
42
|
def yum_config_options
|
43
43
|
@yum_config_options ||= {
|
44
|
-
'exclude' => '^exclude\s*=\s*\S+.*$'
|
45
|
-
'clean_requirements_on_remove' =>
|
46
|
-
'^clean_requirements_on_remove\s*=\S*(1|yes|true)$'
|
44
|
+
'exclude' => '^exclude\s*=\s*\S+.*$'
|
47
45
|
}
|
48
46
|
end
|
49
47
|
end
|
@@ -25,12 +25,14 @@ class Features::Nftables < ForemanMaintain::Feature
|
|
25
25
|
execute!("nft add chain #{family} #{table} #{chain} #{chain_options}")
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
28
|
+
def add_rules(options = {})
|
29
29
|
family = options.fetch(:family, ip_family)
|
30
30
|
table = options.fetch(:table, table_name)
|
31
31
|
chain = options.fetch(:chain, chain_name)
|
32
|
-
|
33
|
-
|
32
|
+
rules = options.fetch(:rules) # needs validation
|
33
|
+
rules.each do |rule|
|
34
|
+
execute!("nft add rule #{family} #{table} #{chain} #{rule}")
|
35
|
+
end
|
34
36
|
end
|
35
37
|
|
36
38
|
def table_exist?(name = table_name)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Procedures::Restore
|
2
|
+
class CandlepinResetMigrations < ForemanMaintain::Procedure
|
3
|
+
metadata do
|
4
|
+
description 'Ensure Candlepin runs all migrations after restoring the database'
|
5
|
+
confine do
|
6
|
+
feature(:candlepin_database)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
FileUtils.rm_f('/var/lib/candlepin/.puppet-candlepin-rpm-version')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -46,7 +46,8 @@ module ForemanMaintain::Scenarios
|
|
46
46
|
end
|
47
47
|
restore_mongo_dump(backup)
|
48
48
|
add_steps_with_context(Procedures::Pulp::Migrate,
|
49
|
-
Procedures::Pulpcore::Migrate
|
49
|
+
Procedures::Pulpcore::Migrate,
|
50
|
+
Procedures::Restore::CandlepinResetMigrations)
|
50
51
|
|
51
52
|
add_steps_with_context(Procedures::Restore::RegenerateQueues) if backup.online_backup?
|
52
53
|
add_steps_with_context(Procedures::Service::Start,
|
@@ -10,7 +10,7 @@ module ForemanMaintain
|
|
10
10
|
unless table_exist?
|
11
11
|
add_table
|
12
12
|
add_chain(:chain_options => nftables_chain_options)
|
13
|
-
|
13
|
+
add_rules(rules: nftables_rules)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -22,8 +22,8 @@ module ForemanMaintain
|
|
22
22
|
'{type filter hook input priority 0\\;}'
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
'tcp dport
|
25
|
+
def nftables_rules
|
26
|
+
['iifname "lo" accept', 'tcp dport 443 reject']
|
27
27
|
end
|
28
28
|
|
29
29
|
def status_for_maintenance_mode
|
@@ -100,6 +100,10 @@ module ForemanMaintain
|
|
100
100
|
@data[:advanced_run] = advanced_run
|
101
101
|
end
|
102
102
|
|
103
|
+
def do_not_whitelist
|
104
|
+
@data[:do_not_whitelist] = true
|
105
|
+
end
|
106
|
+
|
103
107
|
def self.eval_dsl(metadata, &block)
|
104
108
|
new(metadata).tap do |dsl|
|
105
109
|
dsl.instance_eval(&block)
|
@@ -317,7 +317,11 @@ module ForemanMaintain
|
|
317
317
|
|
318
318
|
steps_with_error = scenario.steps_with_error(:whitelisted => false)
|
319
319
|
steps_with_skipped = scenario.steps_with_skipped(:whitelisted => true)
|
320
|
-
|
320
|
+
not_skippable_steps = scenario.steps_with_error.select do |step|
|
321
|
+
step.metadata[:do_not_whitelist] == true
|
322
|
+
end
|
323
|
+
|
324
|
+
steps_to_whitelist = steps_with_error + steps_with_skipped - not_skippable_steps
|
321
325
|
unless steps_with_error.empty?
|
322
326
|
message << format(<<-MESSAGE.strip_heredoc, format_steps(steps_with_error, "\n", 2))
|
323
327
|
The following steps ended up in failing state:
|
@@ -325,11 +329,25 @@ module ForemanMaintain
|
|
325
329
|
%s
|
326
330
|
MESSAGE
|
327
331
|
whitelist_labels = steps_to_whitelist.map(&:label_dashed).join(',')
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
332
|
+
unless whitelist_labels.empty?
|
333
|
+
recommend << if scenario.detector.feature(:instance).downstream
|
334
|
+
format(<<-MESSAGE.strip_heredoc, whitelist_labels)
|
335
|
+
Resolve the failed steps and rerun the command.
|
336
|
+
|
337
|
+
If the situation persists and, you are unclear what to do next,
|
338
|
+
contact Red Hat Technical Support.
|
339
|
+
|
340
|
+
In case the failures are false positives, use
|
341
|
+
--whitelist="%s"
|
342
|
+
MESSAGE
|
343
|
+
else
|
344
|
+
format(<<-MESSAGE.strip_heredoc, whitelist_labels)
|
345
|
+
Resolve the failed steps and rerun the command.
|
346
|
+
In case the failures are false positives, use
|
347
|
+
--whitelist="%s"
|
348
|
+
MESSAGE
|
349
|
+
end
|
350
|
+
end
|
333
351
|
end
|
334
352
|
|
335
353
|
steps_with_warning = scenario.steps_with_warning(:whitelisted => false)
|
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: 1.0.
|
4
|
+
version: 1.0.9
|
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: 2022-04
|
11
|
+
date: 2022-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -273,7 +273,6 @@ files:
|
|
273
273
|
- definitions/procedures/maintenance_mode/enable_maintenance_mode.rb
|
274
274
|
- definitions/procedures/maintenance_mode/is_enabled.rb
|
275
275
|
- definitions/procedures/packages/check_update.rb
|
276
|
-
- definitions/procedures/packages/enable_version_locking.rb
|
277
276
|
- definitions/procedures/packages/install.rb
|
278
277
|
- definitions/procedures/packages/installer_confirmation.rb
|
279
278
|
- definitions/procedures/packages/lock_versions.rb
|
@@ -298,6 +297,7 @@ files:
|
|
298
297
|
- definitions/procedures/repositories/enable.rb
|
299
298
|
- definitions/procedures/repositories/setup.rb
|
300
299
|
- definitions/procedures/restore/candlepin_dump.rb
|
300
|
+
- definitions/procedures/restore/candlepin_reset_migrations.rb
|
301
301
|
- definitions/procedures/restore/configs.rb
|
302
302
|
- definitions/procedures/restore/confirmation.rb
|
303
303
|
- definitions/procedures/restore/drop_databases.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Procedures::Packages
|
2
|
-
class EnableVersionLocking < ForemanMaintain::Procedure
|
3
|
-
metadata do
|
4
|
-
description 'Install and configure tools for version locking'
|
5
|
-
param :assumeyes, 'Do not ask for confirmation'
|
6
|
-
end
|
7
|
-
|
8
|
-
def run
|
9
|
-
installed_fm_packages = []
|
10
|
-
['satellite-maintain', 'rubygem-foreman_maintain'].each do |pkg|
|
11
|
-
installed_fm_packages << find_package(pkg)
|
12
|
-
end
|
13
|
-
package_manager.reinstall(installed_fm_packages, :assumeyes => @assumeyes)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|