foreman_maintain 1.1.9 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/definitions/features/foreman_proxy.rb +1 -1
- data/definitions/features/foreman_tasks.rb +2 -0
- data/definitions/features/sync_plans.rb +11 -1
- data/definitions/procedures/restore/reindex_databases.rb +22 -0
- data/definitions/scenarios/restore.rb +5 -0
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05e00cf48a6dfb5684ac74e789ba933225d4c380a2b83d3e8df8cd607d537c8c
|
4
|
+
data.tar.gz: c639bf3716c44df18b63125880f6521558ee754992e21eac73021e14e3ebfd5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1899bd4d44b5ab634dfdd516c9db1e0cf4c45ced30b3de818bcbaa0b45bdedafe690a6e42eff5643e2b2e986c8289c792db34f3609161e33c9c773c27414cb93
|
7
|
+
data.tar.gz: 68ee21c7b7e59cbc9a8d944fdebba54e82b72a5b67c4fbf5284f36caab4926f1223d0c5168d6303e624f4ed49b87c5167bbec6c222dc8d874a8b8fdb4d5af9ef
|
@@ -144,7 +144,7 @@ class Features::ForemanProxy < ForemanMaintain::Feature
|
|
144
144
|
|
145
145
|
cmd = "curl -w '\n%{http_code}' -s "
|
146
146
|
cmd += format_shell_args('--cert' => ssl_cert, '--key' => ssl_key, '--cacert' => ssl_ca)
|
147
|
-
cmd += " https
|
147
|
+
cmd += " https://#{hostname}:#{proxy_settings[:https_port]}"
|
148
148
|
cmd
|
149
149
|
end
|
150
150
|
|
@@ -17,6 +17,7 @@ class Features::ForemanTasks < ForemanMaintain::Feature
|
|
17
17
|
Actions::Candlepin::ListenOnCandlepinEvents
|
18
18
|
Actions::Katello::EventQueue::Monitor
|
19
19
|
Actions::Insights::EmailPoller
|
20
|
+
ForemanInventoryUpload::Async::GenerateAllReportsJob
|
20
21
|
ForemanInventoryUpload::Async::GenerateReportJob
|
21
22
|
ForemanInventoryUpload::Async::QueueForUploadJob
|
22
23
|
ForemanInventoryUpload::Async::UploadReportJob
|
@@ -24,6 +25,7 @@ class Features::ForemanTasks < ForemanMaintain::Feature
|
|
24
25
|
InsightsCloud::Async::InsightsFullSync
|
25
26
|
InsightsCloud::Async::InsightsResolutionsSync
|
26
27
|
InsightsCloud::Async::InsightsRulesSync
|
28
|
+
InsightsCloud::Async::InsightsScheduledSync
|
27
29
|
InventorySync::Async::InventoryFullSync
|
28
30
|
InventorySync::Async::InventoryHostsSync
|
29
31
|
InventorySync::Async::InventoryScheduledSync
|
@@ -33,12 +33,22 @@ class Features::SyncPlans < ForemanMaintain::Feature
|
|
33
33
|
feature(:foreman_database).query(query).map { |r| r['id'].to_i }
|
34
34
|
end
|
35
35
|
|
36
|
+
def validate_sync_plan_ids(ids)
|
37
|
+
ids_condition = ids.map { |id| "'#{id}'" }.join(',')
|
38
|
+
query = <<-SQL
|
39
|
+
SELECT id FROM katello_sync_plans WHERE id IN (#{ids_condition})
|
40
|
+
SQL
|
41
|
+
feature(:foreman_database).query(query).map { |r| r['id'].to_i }
|
42
|
+
end
|
43
|
+
|
36
44
|
def make_disable(ids)
|
37
45
|
update_records(ids, false)
|
38
46
|
end
|
39
47
|
|
40
48
|
def make_enable
|
41
|
-
|
49
|
+
# remove ids of sync plans which no longer exist in DB
|
50
|
+
@data[:disabled] = validate_sync_plan_ids(@data[:disabled])
|
51
|
+
update_records(@data[:disabled], true)
|
42
52
|
end
|
43
53
|
|
44
54
|
def load_from_storage(storage)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Procedures::Restore
|
2
|
+
class ReindexDatabases < ForemanMaintain::Procedure
|
3
|
+
include ForemanMaintain::Concerns::SystemService
|
4
|
+
|
5
|
+
metadata do
|
6
|
+
description 'REINDEX databases'
|
7
|
+
|
8
|
+
confine do
|
9
|
+
feature(:instance).postgresql_local?
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def run
|
14
|
+
with_spinner('Reindexing the databases') do |spinner|
|
15
|
+
feature(:service).handle_services(spinner, 'start', :only => ['postgresql'])
|
16
|
+
|
17
|
+
spinner.update('Reindexing the databases')
|
18
|
+
execute!('runuser - postgres -c "reindexdb -a"')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -45,6 +45,11 @@ module ForemanMaintain::Scenarios
|
|
45
45
|
add_step(Procedures::Service::Stop.new(:only => ['postgresql']))
|
46
46
|
end
|
47
47
|
restore_mongo_dump(backup)
|
48
|
+
|
49
|
+
if feature(:instance).postgresql_local? && !backup.online_backup?
|
50
|
+
add_step_with_context(Procedures::Restore::ReindexDatabases)
|
51
|
+
end
|
52
|
+
|
48
53
|
add_steps_with_context(Procedures::Pulp::Migrate,
|
49
54
|
Procedures::Pulpcore::Migrate,
|
50
55
|
Procedures::Restore::CandlepinResetMigrations)
|
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.1.
|
4
|
+
version: 1.1.11
|
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-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -322,6 +322,7 @@ files:
|
|
322
322
|
- definitions/procedures/restore/postgres_owner.rb
|
323
323
|
- definitions/procedures/restore/pulpcore_dump.rb
|
324
324
|
- definitions/procedures/restore/regenerate_queues.rb
|
325
|
+
- definitions/procedures/restore/reindex_databases.rb
|
325
326
|
- definitions/procedures/selinux/set_file_security.rb
|
326
327
|
- definitions/procedures/service/base.rb
|
327
328
|
- definitions/procedures/service/daemon_reload.rb
|
@@ -484,7 +485,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
484
485
|
- !ruby/object:Gem::Version
|
485
486
|
version: '0'
|
486
487
|
requirements: []
|
487
|
-
rubygems_version: 3.
|
488
|
+
rubygems_version: 3.2.33
|
488
489
|
signing_key:
|
489
490
|
specification_version: 4
|
490
491
|
summary: Foreman maintenance tool belt
|