foreman_maintain 1.0.17 → 1.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/definitions/features/candlepin_database.rb +1 -10
- data/definitions/procedures/restore/reindex_databases.rb +22 -0
- data/definitions/scenarios/restore.rb +5 -0
- data/definitions/scenarios/self_upgrade.rb +2 -2
- data/lib/foreman_maintain/concerns/downstream.rb +2 -3
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16cb6948c9fce9920fd8916aba9c0ecb641b6acfee457aa984599976287e097b
|
4
|
+
data.tar.gz: ed5f56c95835b3c742323686d4207c33d9c5c1d37a9760013bb3810597f6296b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6daa7f789d47bf1d810f9974a34955695151f4481db5b0d5628de85fe97ede1dd7202985de28e8ca2d010abdef02b51509aa242abce37773daf8afda135b67c
|
7
|
+
data.tar.gz: fc1e55d663a20afa249d409318800282a78b652b9ebc1cb1bb5655a9ef608d79be1c5434421dfcbd3d3906b156d5262aca8dbcfb05b0de61b8342ef8ffb9e87f
|
@@ -75,7 +75,7 @@ class Features::CandlepinDatabase < ForemanMaintain::Feature
|
|
75
75
|
# rubocop:enable Metrics/MethodLength
|
76
76
|
|
77
77
|
def extend_with_db_options
|
78
|
-
db_options = { '-d' =>
|
78
|
+
db_options = { '-d' => configuration['database'] }
|
79
79
|
if check_option_using_cpdb_help('dbhost')
|
80
80
|
db_options['--dbhost'] = configuration['host']
|
81
81
|
db_options['--dbport'] = configuration['port']
|
@@ -83,15 +83,6 @@ class Features::CandlepinDatabase < ForemanMaintain::Feature
|
|
83
83
|
db_options
|
84
84
|
end
|
85
85
|
|
86
|
-
def construct_database_string
|
87
|
-
db_str = configuration['database']
|
88
|
-
extra_opts = []
|
89
|
-
extra_opts << "ssl=#{configuration['ssl']}" if configuration['ssl']
|
90
|
-
extra_opts << "sslfactory=#{configuration['sslfactory']}" if configuration['sslfactory']
|
91
|
-
db_str += "?#{extra_opts.join('&')}" unless extra_opts.empty?
|
92
|
-
db_str
|
93
|
-
end
|
94
|
-
|
95
86
|
def fetch_extra_param(url, key_name)
|
96
87
|
query_string = url.split('?')[1]
|
97
88
|
return nil unless query_string
|
@@ -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)
|
@@ -2,11 +2,11 @@ module ForemanMaintain::Scenarios
|
|
2
2
|
class SelfUpgradeBase < ForemanMaintain::Scenario
|
3
3
|
include ForemanMaintain::Concerns::Downstream
|
4
4
|
def target_version
|
5
|
-
@target_version ||= current_version.bump
|
5
|
+
@target_version ||= Gem::Version.new(current_version).bump.to_s
|
6
6
|
end
|
7
7
|
|
8
8
|
def current_version
|
9
|
-
feature(:instance).downstream.
|
9
|
+
feature(:instance).downstream.current_version.to_s[/^\d+\.\d+\.\d+/]
|
10
10
|
end
|
11
11
|
|
12
12
|
def maintenance_repo_label
|
@@ -66,7 +66,8 @@ module ForemanMaintain
|
|
66
66
|
server_version_full = "#{server_version.major}.#{server_version.minor}"
|
67
67
|
rh_repos.concat(product_specific_repos(server_version_full))
|
68
68
|
if server_version > version('6.3')
|
69
|
-
|
69
|
+
ansible_repo = ansible_repo(server_version)
|
70
|
+
rh_repos << ansible_repo if ansible_repo
|
70
71
|
end
|
71
72
|
|
72
73
|
rh_repos
|
@@ -83,8 +84,6 @@ module ForemanMaintain
|
|
83
84
|
|
84
85
|
if el7?
|
85
86
|
"rhel-#{el_major_version}-server-ansible-#{ansible_version}-rpms"
|
86
|
-
else
|
87
|
-
"ansible-#{ansible_version}-for-rhel-#{el_major_version}-x86_64-rpms"
|
88
87
|
end
|
89
88
|
end
|
90
89
|
|
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.19
|
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:
|
11
|
+
date: 2023-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.50.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: minitest-stub-const
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: Provides various features that helps keeping the Foreman/Satellite up
|
112
126
|
and running.
|
113
127
|
email: inecas@redhat.com
|
@@ -311,6 +325,7 @@ files:
|
|
311
325
|
- definitions/procedures/restore/postgres_owner.rb
|
312
326
|
- definitions/procedures/restore/pulpcore_dump.rb
|
313
327
|
- definitions/procedures/restore/regenerate_queues.rb
|
328
|
+
- definitions/procedures/restore/reindex_databases.rb
|
314
329
|
- definitions/procedures/selinux/set_file_security.rb
|
315
330
|
- definitions/procedures/service/base.rb
|
316
331
|
- definitions/procedures/service/daemon_reload.rb
|
@@ -468,7 +483,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
468
483
|
- !ruby/object:Gem::Version
|
469
484
|
version: '0'
|
470
485
|
requirements: []
|
471
|
-
rubygems_version: 3.
|
486
|
+
rubygems_version: 3.3.26
|
472
487
|
signing_key:
|
473
488
|
specification_version: 4
|
474
489
|
summary: Foreman maintenance tool belt
|