foreman_maintain 1.2.2 → 1.2.4

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: f1b6168d49244a6f59fd0500867fa753c55545cbb299af9c4572ca814d072927
4
- data.tar.gz: d5bf3284f717958e4fd3dec1adea6b7f71a67fa854c23457915aeb0417017604
3
+ metadata.gz: a8dea59abb9dd938c046267a9561ec9e6b67b1982b63ceb098842726b50dba2f
4
+ data.tar.gz: 44bb1053c3b8a810d4ec27c531d182fc83118635bf5e1d9f16ab6e6b55bd46a2
5
5
  SHA512:
6
- metadata.gz: 6d735d3febc81e314bcbe0dc8649536f34998f72aa2b1851c4d568fd90b38cb46dac41dd1ce24d9845c8135abecf90742d0ff9aef6afc03188362420dc1df936
7
- data.tar.gz: 4975f14be4a458950c88c3eb3b3edc0fccdd988e134a913c6fb5e7e2dcfdb29dd43ae11dcd5978673d5c0d468c3155a3cd91254d1caed89789038404b034805e
6
+ metadata.gz: a18584dc4a419be407d39587193735f66e8497ba6dbcb3670e786eca21abb0860da885267005ba351ab01aa5c3e5eee79b6ec9bc2d0763ed997779d7a011e492
7
+ data.tar.gz: '08e82fd2c29f07da6be8d9d302714d5aeaf9b7f208924f9a211aa133ab8bb7b9c769eec7495e94f5008a3d6dfd806dabccaffa1c8b98f6f3ec93ff75bdf1b661'
@@ -42,12 +42,8 @@ module Checks::ForemanProxy
42
42
  end
43
43
 
44
44
  def lookup_token_duration
45
- data = feature(:foreman_database). \
46
- query("select s.value, s.default from settings s \
47
- where category IN ('Setting::Provisioning','Setting') \
48
- and name = 'token_duration'")
49
-
50
- YAML.load(data[0]['value'] || data[0]['default'])
45
+ data = feature(:hammer).run('--output yaml settings info --id token_duration')
46
+ YAML.load(data)['Value']
51
47
  end
52
48
  end
53
49
  end
@@ -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://$(hostname):#{proxy_settings[:https_port]}"
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
@@ -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)
@@ -0,0 +1,92 @@
1
+ module Scenarios::Capsule_6_13
2
+ class Abstract < ForemanMaintain::Scenario
3
+ def self.upgrade_metadata(&block)
4
+ metadata do
5
+ tags :upgrade_scenario
6
+ confine do
7
+ feature(:capsule) &&
8
+ (feature(:capsule).current_minor_version == '6.12' || \
9
+ ForemanMaintain.upgrade_in_progress == '6.13')
10
+ end
11
+ instance_eval(&block)
12
+ end
13
+ end
14
+
15
+ def target_version
16
+ '6.13'
17
+ end
18
+ end
19
+
20
+ class PreUpgradeCheck < Abstract
21
+ upgrade_metadata do
22
+ description 'Checks before upgrading to Capsule 6.13'
23
+ tags :pre_upgrade_checks
24
+ run_strategy :fail_slow
25
+ end
26
+
27
+ def compose
28
+ add_steps(find_checks(:default))
29
+ add_steps(find_checks(:pre_upgrade))
30
+ add_step(Checks::Foreman::CheckpointSegments)
31
+ add_step(Checks::Repositories::Validate.new(:version => '6.13'))
32
+ end
33
+ end
34
+
35
+ class PreMigrations < Abstract
36
+ upgrade_metadata do
37
+ description 'Procedures before migrating to Capsule 6.13'
38
+ tags :pre_migrations
39
+ end
40
+
41
+ def compose
42
+ add_steps(find_procedures(:pre_migrations))
43
+ add_step(Procedures::Service::Stop.new)
44
+ end
45
+ end
46
+
47
+ class Migrations < Abstract
48
+ upgrade_metadata do
49
+ description 'Migration scripts to Capsule 6.13'
50
+ tags :migrations
51
+ end
52
+
53
+ def set_context_mapping
54
+ context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
55
+ end
56
+
57
+ def compose
58
+ add_step(Procedures::Repositories::Setup.new(:version => '6.13'))
59
+ modules_to_enable = ["satellite-capsule:#{el_short_name}"]
60
+ add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
61
+ add_step(Procedures::Packages::UnlockVersions.new)
62
+ add_step(Procedures::Packages::Update.new(:assumeyes => true))
63
+ add_step_with_context(Procedures::Installer::Upgrade)
64
+ end
65
+ end
66
+
67
+ class PostMigrations < Abstract
68
+ upgrade_metadata do
69
+ description 'Procedures after migrating to Capsule 6.13'
70
+ tags :post_migrations
71
+ end
72
+
73
+ def compose
74
+ add_step(Procedures::RefreshFeatures)
75
+ add_step(Procedures::Service::Start.new)
76
+ add_steps(find_procedures(:post_migrations))
77
+ end
78
+ end
79
+
80
+ class PostUpgradeChecks < Abstract
81
+ upgrade_metadata do
82
+ description 'Checks after upgrading to Capsule 6.13'
83
+ tags :post_upgrade_checks
84
+ run_strategy :fail_slow
85
+ end
86
+
87
+ def compose
88
+ add_steps(find_checks(:default))
89
+ add_steps(find_checks(:post_upgrade))
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,92 @@
1
+ module Scenarios::Capsule_6_13_z
2
+ class Abstract < ForemanMaintain::Scenario
3
+ def self.upgrade_metadata(&block)
4
+ metadata do
5
+ tags :upgrade_scenario
6
+ confine do
7
+ feature(:capsule) &&
8
+ (feature(:capsule).current_minor_version == '6.13' || \
9
+ ForemanMaintain.upgrade_in_progress == '6.13.z')
10
+ end
11
+ instance_eval(&block)
12
+ end
13
+ end
14
+
15
+ def target_version
16
+ '6.13.z'
17
+ end
18
+ end
19
+
20
+ class PreUpgradeCheck < Abstract
21
+ upgrade_metadata do
22
+ description 'Checks before upgrading to Capsule 6.13.z'
23
+ tags :pre_upgrade_checks
24
+ run_strategy :fail_slow
25
+ end
26
+
27
+ def compose
28
+ add_steps(find_checks(:default))
29
+ add_steps(find_checks(:pre_upgrade))
30
+ add_step(Checks::Foreman::CheckpointSegments)
31
+ add_step(Checks::Repositories::Validate.new(:version => '6.13'))
32
+ end
33
+ end
34
+
35
+ class PreMigrations < Abstract
36
+ upgrade_metadata do
37
+ description 'Procedures before migrating to Capsule 6.13.z'
38
+ tags :pre_migrations
39
+ end
40
+
41
+ def compose
42
+ add_steps(find_procedures(:pre_migrations))
43
+ add_step(Procedures::Service::Stop.new)
44
+ end
45
+ end
46
+
47
+ class Migrations < Abstract
48
+ upgrade_metadata do
49
+ description 'Migration scripts to Capsule 6.13.z'
50
+ tags :migrations
51
+ end
52
+
53
+ def set_context_mapping
54
+ context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
55
+ end
56
+
57
+ def compose
58
+ add_step(Procedures::Repositories::Setup.new(:version => '6.13'))
59
+ modules_to_enable = ["satellite-capsule:#{el_short_name}"]
60
+ add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
61
+ add_step(Procedures::Packages::UnlockVersions.new)
62
+ add_step(Procedures::Packages::Update.new(:assumeyes => true))
63
+ add_step_with_context(Procedures::Installer::Upgrade)
64
+ end
65
+ end
66
+
67
+ class PostMigrations < Abstract
68
+ upgrade_metadata do
69
+ description 'Procedures after migrating to Capsule 6.13.z'
70
+ tags :post_migrations
71
+ end
72
+
73
+ def compose
74
+ add_step(Procedures::RefreshFeatures)
75
+ add_step(Procedures::Service::Start.new)
76
+ add_steps(find_procedures(:post_migrations))
77
+ end
78
+ end
79
+
80
+ class PostUpgradeChecks < Abstract
81
+ upgrade_metadata do
82
+ description 'Checks after upgrading to Capsule 6.13.z'
83
+ tags :post_upgrade_checks
84
+ run_strategy :fail_slow
85
+ end
86
+
87
+ def compose
88
+ add_steps(find_checks(:default))
89
+ add_steps(find_checks(:post_upgrade))
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,95 @@
1
+ module Scenarios::Satellite_6_13
2
+ class Abstract < ForemanMaintain::Scenario
3
+ def self.upgrade_metadata(&block)
4
+ metadata do
5
+ tags :upgrade_scenario
6
+ confine do
7
+ feature(:satellite) &&
8
+ (feature(:satellite).current_minor_version == '6.12' || \
9
+ ForemanMaintain.upgrade_in_progress == '6.13')
10
+ end
11
+ instance_eval(&block)
12
+ end
13
+ end
14
+
15
+ def target_version
16
+ '6.13'
17
+ end
18
+ end
19
+
20
+ class PreUpgradeCheck < Abstract
21
+ upgrade_metadata do
22
+ description 'Checks before upgrading to Satellite 6.13'
23
+ tags :pre_upgrade_checks
24
+ run_strategy :fail_slow
25
+ end
26
+
27
+ def compose
28
+ add_steps(find_checks(:default))
29
+ add_steps(find_checks(:pre_upgrade))
30
+ add_step(Checks::Foreman::CheckpointSegments)
31
+ add_step(Checks::Repositories::Validate.new(:version => '6.13'))
32
+ end
33
+ end
34
+
35
+ class PreMigrations < Abstract
36
+ upgrade_metadata do
37
+ description 'Procedures before migrating to Satellite 6.13'
38
+ tags :pre_migrations
39
+ end
40
+
41
+ def compose
42
+ add_steps(find_procedures(:pre_migrations))
43
+ add_step(Procedures::Service::Stop.new)
44
+ end
45
+ end
46
+
47
+ class Migrations < Abstract
48
+ upgrade_metadata do
49
+ description 'Migration scripts to Satellite 6.13'
50
+ tags :migrations
51
+ run_strategy :fail_fast
52
+ end
53
+
54
+ def set_context_mapping
55
+ context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
56
+ end
57
+
58
+ def compose
59
+ add_step(Procedures::Repositories::Setup.new(:version => '6.13'))
60
+ modules_to_enable = ["satellite:#{el_short_name}"]
61
+ add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
62
+ add_step(Procedures::Packages::UnlockVersions.new)
63
+ add_step(Procedures::Packages::Update.new(:assumeyes => true))
64
+ add_step_with_context(Procedures::Installer::Upgrade)
65
+ add_step(Procedures::Installer::UpgradeRakeTask)
66
+ end
67
+ end
68
+
69
+ class PostMigrations < Abstract
70
+ upgrade_metadata do
71
+ description 'Procedures after migrating to Satellite 6.13'
72
+ tags :post_migrations
73
+ end
74
+
75
+ def compose
76
+ add_step(Procedures::RefreshFeatures)
77
+ add_step(Procedures::Service::Start.new)
78
+ add_step(Procedures::Pulpcore::TrimRpmChangelogs.new)
79
+ add_steps(find_procedures(:post_migrations))
80
+ end
81
+ end
82
+
83
+ class PostUpgradeChecks < Abstract
84
+ upgrade_metadata do
85
+ description 'Checks after upgrading to Satellite 6.13'
86
+ tags :post_upgrade_checks
87
+ run_strategy :fail_slow
88
+ end
89
+
90
+ def compose
91
+ add_steps(find_checks(:default))
92
+ add_steps(find_checks(:post_upgrade))
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,94 @@
1
+ module Scenarios::Satellite_6_13_z
2
+ class Abstract < ForemanMaintain::Scenario
3
+ def self.upgrade_metadata(&block)
4
+ metadata do
5
+ tags :upgrade_scenario
6
+ confine do
7
+ feature(:satellite) &&
8
+ (feature(:satellite).current_minor_version == '6.13' || \
9
+ ForemanMaintain.upgrade_in_progress == '6.13.z')
10
+ end
11
+ instance_eval(&block)
12
+ end
13
+ end
14
+
15
+ def target_version
16
+ '6.13.z'
17
+ end
18
+ end
19
+
20
+ class PreUpgradeCheck < Abstract
21
+ upgrade_metadata do
22
+ description 'Checks before upgrading to Satellite 6.13.z'
23
+ tags :pre_upgrade_checks
24
+ run_strategy :fail_slow
25
+ end
26
+
27
+ def compose
28
+ add_steps(find_checks(:default))
29
+ add_steps(find_checks(:pre_upgrade))
30
+ add_step(Checks::Foreman::CheckpointSegments)
31
+ add_step(Checks::Repositories::Validate.new(:version => '6.13'))
32
+ end
33
+ end
34
+
35
+ class PreMigrations < Abstract
36
+ upgrade_metadata do
37
+ description 'Procedures before migrating to Satellite 6.13.z'
38
+ tags :pre_migrations
39
+ end
40
+
41
+ def compose
42
+ add_steps(find_procedures(:pre_migrations))
43
+ add_step(Procedures::Service::Stop.new)
44
+ end
45
+ end
46
+
47
+ class Migrations < Abstract
48
+ upgrade_metadata do
49
+ description 'Migration scripts to Satellite 6.13.z'
50
+ tags :migrations
51
+ end
52
+
53
+ def set_context_mapping
54
+ context.map(:assumeyes, Procedures::Installer::Upgrade => :assumeyes)
55
+ end
56
+
57
+ def compose
58
+ add_step(Procedures::Repositories::Setup.new(:version => '6.13'))
59
+ modules_to_enable = ["satellite:#{el_short_name}"]
60
+ add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
61
+ add_step(Procedures::Packages::UnlockVersions.new)
62
+ add_step(Procedures::Packages::Update.new(:assumeyes => true))
63
+ add_step_with_context(Procedures::Installer::Upgrade)
64
+ add_step(Procedures::Installer::UpgradeRakeTask)
65
+ end
66
+ end
67
+
68
+ class PostMigrations < Abstract
69
+ upgrade_metadata do
70
+ description 'Procedures after migrating to Satellite 6.13.z'
71
+ tags :post_migrations
72
+ end
73
+
74
+ def compose
75
+ add_step(Procedures::RefreshFeatures)
76
+ add_step(Procedures::Service::Start.new)
77
+ add_step(Procedures::Pulpcore::TrimRpmChangelogs.new)
78
+ add_steps(find_procedures(:post_migrations))
79
+ end
80
+ end
81
+
82
+ class PostUpgradeChecks < Abstract
83
+ upgrade_metadata do
84
+ description 'Checks after upgrading to Satellite 6.13.z'
85
+ tags :post_upgrade_checks
86
+ run_strategy :fail_slow
87
+ end
88
+
89
+ def compose
90
+ add_steps(find_checks(:default))
91
+ add_steps(find_checks(:post_upgrade))
92
+ end
93
+ end
94
+ end
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.2.2'.freeze
2
+ VERSION = '1.2.4'.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.2
4
+ version: 1.2.4
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-01-03 00:00:00.000000000 Z
11
+ date: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -324,6 +324,7 @@ files:
324
324
  - definitions/procedures/restore/postgres_owner.rb
325
325
  - definitions/procedures/restore/pulpcore_dump.rb
326
326
  - definitions/procedures/restore/regenerate_queues.rb
327
+ - definitions/procedures/restore/reindex_databases.rb
327
328
  - definitions/procedures/selinux/set_file_security.rb
328
329
  - definitions/procedures/service/base.rb
329
330
  - definitions/procedures/service/daemon_reload.rb
@@ -351,6 +352,8 @@ files:
351
352
  - definitions/scenarios/upgrade_to_capsule_6_11_z.rb
352
353
  - definitions/scenarios/upgrade_to_capsule_6_12.rb
353
354
  - definitions/scenarios/upgrade_to_capsule_6_12_z.rb
355
+ - definitions/scenarios/upgrade_to_capsule_6_13.rb
356
+ - definitions/scenarios/upgrade_to_capsule_6_13_z.rb
354
357
  - definitions/scenarios/upgrade_to_capsule_6_8.rb
355
358
  - definitions/scenarios/upgrade_to_capsule_6_8_z.rb
356
359
  - definitions/scenarios/upgrade_to_capsule_6_9.rb
@@ -363,6 +366,8 @@ files:
363
366
  - definitions/scenarios/upgrade_to_satellite_6_11_z.rb
364
367
  - definitions/scenarios/upgrade_to_satellite_6_12.rb
365
368
  - definitions/scenarios/upgrade_to_satellite_6_12_z.rb
369
+ - definitions/scenarios/upgrade_to_satellite_6_13.rb
370
+ - definitions/scenarios/upgrade_to_satellite_6_13_z.rb
366
371
  - definitions/scenarios/upgrade_to_satellite_6_2.rb
367
372
  - definitions/scenarios/upgrade_to_satellite_6_2_z.rb
368
373
  - definitions/scenarios/upgrade_to_satellite_6_3.rb