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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbe5e2f041a482d1800b74195b3d0cbaeb504d14345c86402d4ee9402f052999
4
- data.tar.gz: 96420eefe94c8632ec43a52d105af613aaf7b30107e59f6a69abc9549a02200b
3
+ metadata.gz: d333d2c850308e6bf590acee0dfd55d4b257cdebebb7b148e4ef49fe48f001dd
4
+ data.tar.gz: eac9b73a13ff0f7829ddf0cea8380491884d6631e3d42ca42b9b88e76bbd4698
5
5
  SHA512:
6
- metadata.gz: 2207cfef121cf8a15ce12c0c961b249b31ac3fb92b2275c15df58b245fc987261c634d53bd0fad5cfe8de3c71106fd30016f76fa7ffac67da2b5ab593fb02347
7
- data.tar.gz: a121716d79737dbe7e480bca7aa767dd17090226d8ef51f19c9f49e8ce82b7b8620416bc5cecc2a654068f7a7e0d0ed8ba93dbf2eedac71ccbbb36517f7bbd0b
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 add_rule(options = {})
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
- rule = options.fetch(:rule) # needs validation
33
- execute!("nft add rule #{family} #{table} #{chain} #{rule}")
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)
@@ -4,6 +4,7 @@ module Procedures::Content
4
4
  description 'Prepare content for Pulp 3'
5
5
  for_feature :pulpcore
6
6
  param :quiet, 'Keep the output on a single line', :flag => true, :default => false
7
+ do_not_whitelist
7
8
  end
8
9
 
9
10
  def run
@@ -9,6 +9,7 @@ module Procedures::Content
9
9
  end
10
10
 
11
11
  param :skip_deb, 'Do not run debian options in installer.'
12
+ do_not_whitelist
12
13
  end
13
14
 
14
15
  def run
@@ -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
- add_rule(rule: nftables_rule)
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 nftables_rule
26
- 'tcp dport https reject'
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
- steps_to_whitelist = steps_with_error + steps_with_skipped
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
- recommend << format(<<-MESSAGE.strip_heredoc, whitelist_labels)
329
- Resolve the failed steps and rerun
330
- the command. In case the failures are false positives,
331
- use --whitelist="%s"
332
- MESSAGE
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)
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.0.8'.freeze
2
+ VERSION = '1.0.9'.freeze
3
3
  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: 1.0.8
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-22 00:00:00.000000000 Z
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