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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da68f2093b4fd4dabd725c3f8fd59d8050bf46b69c25406bccb211289130dd83
|
4
|
+
data.tar.gz: 2d55369e3d21aa803de8e79adff315409db43ebf0f07d897d3393592dfe16601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
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.
|
501
|
+
rubygems_version: 3.4.10
|
501
502
|
signing_key:
|
502
503
|
specification_version: 4
|
503
504
|
summary: Foreman maintenance tool belt
|