foreman_maintain 1.2.11 → 1.2.12

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: d0f3b9203f42dad6fb7097b9c21ace971d08ac3cdcd9ef86a6e35accd6fe16e6
4
- data.tar.gz: d82a421c9712d6985c3b2fb1aa260f0d71525c4c74f8819cb93250aebdb74d6b
3
+ metadata.gz: da68f2093b4fd4dabd725c3f8fd59d8050bf46b69c25406bccb211289130dd83
4
+ data.tar.gz: 2d55369e3d21aa803de8e79adff315409db43ebf0f07d897d3393592dfe16601
5
5
  SHA512:
6
- metadata.gz: 8966a30d6dcd6c54cc38c74b5f0727d152ee7ac206b72ce9b25fccc5720503d44ea9fc8c5484f06c7cca21b0ecb09e4513cf007b845044a9e139d41246201214
7
- data.tar.gz: f0638a7a69eff853b8d75f75febde176d8e585f6197b9cd88507d16804b52c11b403912fbe092c01bcda77eba2ef7177dba866e3af83864d71f6ff4642f3ec58
6
+ metadata.gz: 00da118403806e13ae41ebef9eceb6f4480278203659ff9b7018a91f2c453637ac7d3a2e63a85985b5f5d06265993d8dbdac3ea3cb23f4d30f33355aa111c562
7
+ data.tar.gz: 6bc88a7f89d38490ec2742d3b8dcfed65fb8a8a459d9f452b22fc2723b4ee5874a72720aeddcc8e6b00b85ff7092d978cbefa23c7a2ecc2df6436d7f09c469c5
@@ -0,0 +1,23 @@
1
+ module Procedures::Restore
2
+ class RequiredPackages < ForemanMaintain::Procedure
3
+ metadata do
4
+ description 'Ensure required packages are installed before restore'
5
+
6
+ param :backup_dir,
7
+ 'Path to backup directory',
8
+ :required => true
9
+ end
10
+
11
+ def run
12
+ backup = ForemanMaintain::Utils::Backup.new(@backup_dir)
13
+ required_packages = []
14
+ required_packages << 'puppetserver' if backup.with_puppetserver?
15
+ required_packages << 'qpid-cpp-server' if backup.with_qpidd?
16
+ if required_packages.any?
17
+ with_spinner('Installing required packages') do
18
+ ForemanMaintain.package_manager.install(required_packages, assumeyes: true)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -28,6 +28,7 @@ module ForemanMaintain::Scenarios
28
28
 
29
29
  add_steps_with_context(Procedures::Restore::Confirmation,
30
30
  Procedures::Selinux::SetFileSecurity,
31
+ Procedures::Restore::RequiredPackages,
31
32
  Procedures::Restore::Configs)
32
33
  add_step_with_context(Procedures::Crond::Stop) if feature(:cron)
33
34
  unless backup.incremental?
@@ -103,6 +104,7 @@ module ForemanMaintain::Scenarios
103
104
  Checks::Restore::ValidateBackup => :backup_dir,
104
105
  Checks::Restore::ValidateHostname => :backup_dir,
105
106
  Checks::Restore::ValidateInterfaces => :backup_dir,
107
+ Procedures::Restore::RequiredPackages => :backup_dir,
106
108
  Procedures::Restore::Configs => :backup_dir,
107
109
  Procedures::Restore::DropDatabases => :backup_dir,
108
110
  Procedures::Restore::CandlepinDump => :backup_dir,
@@ -337,6 +337,18 @@ module ForemanMaintain
337
337
  def online_backup?
338
338
  !!metadata.fetch('online', false)
339
339
  end
340
+
341
+ def installed_rpms
342
+ metadata.fetch('rpms', metadata.fetch(:rpms, []))
343
+ end
344
+
345
+ def with_puppetserver?
346
+ installed_rpms.any? { |rpm| rpm.start_with?('puppetserver-') }
347
+ end
348
+
349
+ def with_qpidd?
350
+ installed_rpms.any? { |rpm| rpm.start_with?('qpid-cpp-server-') }
351
+ end
340
352
  end
341
353
  end
342
354
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.2.11'.freeze
2
+ VERSION = '1.2.12'.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.2.11
4
+ version: 1.2.12
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: 2023-07-10 00:00:00.000000000 Z
11
+ date: 2023-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -326,6 +326,7 @@ files:
326
326
  - definitions/procedures/restore/pulpcore_dump.rb
327
327
  - definitions/procedures/restore/regenerate_queues.rb
328
328
  - definitions/procedures/restore/reindex_databases.rb
329
+ - definitions/procedures/restore/required_packages.rb
329
330
  - definitions/procedures/selinux/set_file_security.rb
330
331
  - definitions/procedures/service/base.rb
331
332
  - definitions/procedures/service/daemon_reload.rb
@@ -497,7 +498,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
497
498
  - !ruby/object:Gem::Version
498
499
  version: '0'
499
500
  requirements: []
500
- rubygems_version: 3.2.33
501
+ rubygems_version: 3.4.10
501
502
  signing_key:
502
503
  specification_version: 4
503
504
  summary: Foreman maintenance tool belt