foreman_maintain 1.0.5 → 1.0.6
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_tasks.rb +14 -7
- data/definitions/scenarios/{upgrade_to_capsule_7_0.rb → upgrade_to_capsule_6_11.rb} +10 -10
- data/definitions/scenarios/{upgrade_to_capsule_7_0_z.rb → upgrade_to_capsule_6_11_z.rb} +11 -11
- data/definitions/scenarios/{upgrade_to_satellite_7_0.rb → upgrade_to_satellite_6_11.rb} +10 -10
- data/definitions/scenarios/{upgrade_to_satellite_7_0_z.rb → upgrade_to_satellite_6_11_z.rb} +11 -11
- data/lib/foreman_maintain/cli/self_upgrade_command.rb +1 -1
- data/lib/foreman_maintain/concerns/downstream.rb +1 -1
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41c40d80a596e78552a9e066e6d769db4fe57cd9e7c7368a7d64cf21f68edefa
|
4
|
+
data.tar.gz: 4908652d3cc57dde9b08081b0d5fa20fac5cc9f8ab41f19778243a29b0963002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa7003129978adaa2e1798c3fa191a5be628403b1d86df618bd92110829de5b8f0cd81a2f6c97b1df2befeeda693ba950acdf985c843482d2d027d333e771957
|
7
|
+
data.tar.gz: 1c16a69c401058063919df5c8b8a595a4b04d17c5662f93e12b9999bfa5e566f6276b1b4a1998ffb5a3d3f964af76a8275eae68554826a22b4aef8f3ca7b81fb
|
@@ -82,15 +82,22 @@ class Features::ForemanTasks < ForemanMaintain::Feature
|
|
82
82
|
def delete(state)
|
83
83
|
tasks_condition = condition(state)
|
84
84
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
85
|
+
sql = <<-SQL
|
86
|
+
DELETE FROM dynflow_steps USING foreman_tasks_tasks WHERE (foreman_tasks_tasks.external_id = dynflow_steps.execution_plan_uuid::varchar) AND #{tasks_condition};
|
87
|
+
DELETE FROM dynflow_actions USING foreman_tasks_tasks WHERE (foreman_tasks_tasks.external_id = dynflow_actions.execution_plan_uuid::varchar) AND #{tasks_condition};
|
88
|
+
DELETE FROM dynflow_execution_plans USING foreman_tasks_tasks WHERE (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) AND #{tasks_condition};
|
89
|
+
DELETE FROM foreman_tasks_tasks WHERE #{tasks_condition};
|
90
|
+
-- Delete locks and links which may now be orphaned
|
91
|
+
DELETE FROM foreman_tasks_locks as ftl where ftl.task_id NOT IN (SELECT id FROM foreman_tasks_tasks);
|
92
92
|
SQL
|
93
93
|
|
94
|
+
if check_min_version(foreman_plugin_name('foreman-tasks'), '4.0.0')
|
95
|
+
sql += 'DELETE FROM foreman_tasks_links as ftl ' \
|
96
|
+
'where ftl.task_id NOT IN (SELECT id FROM foreman_tasks_tasks);'
|
97
|
+
end
|
98
|
+
|
99
|
+
feature(:foreman_database).psql("BEGIN; #{sql}; COMMIT;")
|
100
|
+
|
94
101
|
count(state)
|
95
102
|
end
|
96
103
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module Scenarios::
|
1
|
+
module Scenarios::Capsule_6_11
|
2
2
|
class Abstract < ForemanMaintain::Scenario
|
3
3
|
def self.upgrade_metadata(&block)
|
4
4
|
metadata do
|
@@ -6,20 +6,20 @@ module Scenarios::Capsule_7_0
|
|
6
6
|
confine do
|
7
7
|
feature(:capsule) &&
|
8
8
|
(feature(:capsule).current_minor_version == '6.10' || \
|
9
|
-
ForemanMaintain.upgrade_in_progress == '
|
9
|
+
ForemanMaintain.upgrade_in_progress == '6.11')
|
10
10
|
end
|
11
11
|
instance_eval(&block)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def target_version
|
16
|
-
'
|
16
|
+
'6.11'
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
class PreUpgradeCheck < Abstract
|
21
21
|
upgrade_metadata do
|
22
|
-
description 'Checks before upgrading to Capsule
|
22
|
+
description 'Checks before upgrading to Capsule 6.11'
|
23
23
|
tags :pre_upgrade_checks
|
24
24
|
run_strategy :fail_slow
|
25
25
|
end
|
@@ -27,13 +27,13 @@ module Scenarios::Capsule_7_0
|
|
27
27
|
def compose
|
28
28
|
add_steps(find_checks(:default))
|
29
29
|
add_steps(find_checks(:pre_upgrade))
|
30
|
-
add_step(Checks::Repositories::Validate.new(:version => '
|
30
|
+
add_step(Checks::Repositories::Validate.new(:version => '6.11'))
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
34
|
class PreMigrations < Abstract
|
35
35
|
upgrade_metadata do
|
36
|
-
description 'Procedures before migrating to Capsule
|
36
|
+
description 'Procedures before migrating to Capsule 6.11'
|
37
37
|
tags :pre_migrations
|
38
38
|
end
|
39
39
|
|
@@ -46,7 +46,7 @@ module Scenarios::Capsule_7_0
|
|
46
46
|
|
47
47
|
class Migrations < Abstract
|
48
48
|
upgrade_metadata do
|
49
|
-
description 'Migration scripts to Capsule
|
49
|
+
description 'Migration scripts to Capsule 6.11'
|
50
50
|
tags :migrations
|
51
51
|
end
|
52
52
|
|
@@ -55,7 +55,7 @@ module Scenarios::Capsule_7_0
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def compose
|
58
|
-
add_step(Procedures::Repositories::Setup.new(:version => '
|
58
|
+
add_step(Procedures::Repositories::Setup.new(:version => '6.11'))
|
59
59
|
add_step(Procedures::Packages::UnlockVersions.new)
|
60
60
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
61
61
|
add_step_with_context(Procedures::Installer::Upgrade)
|
@@ -64,7 +64,7 @@ module Scenarios::Capsule_7_0
|
|
64
64
|
|
65
65
|
class PostMigrations < Abstract
|
66
66
|
upgrade_metadata do
|
67
|
-
description 'Procedures after migrating to Capsule
|
67
|
+
description 'Procedures after migrating to Capsule 6.11'
|
68
68
|
tags :post_migrations
|
69
69
|
end
|
70
70
|
|
@@ -77,7 +77,7 @@ module Scenarios::Capsule_7_0
|
|
77
77
|
|
78
78
|
class PostUpgradeChecks < Abstract
|
79
79
|
upgrade_metadata do
|
80
|
-
description 'Checks after upgrading to Capsule
|
80
|
+
description 'Checks after upgrading to Capsule 6.11'
|
81
81
|
tags :post_upgrade_checks
|
82
82
|
run_strategy :fail_slow
|
83
83
|
end
|
@@ -1,25 +1,25 @@
|
|
1
|
-
module Scenarios::
|
1
|
+
module Scenarios::Capsule_6_11_z
|
2
2
|
class Abstract < ForemanMaintain::Scenario
|
3
3
|
def self.upgrade_metadata(&block)
|
4
4
|
metadata do
|
5
5
|
tags :upgrade_scenario
|
6
6
|
confine do
|
7
7
|
feature(:capsule) &&
|
8
|
-
(feature(:capsule).current_minor_version == '
|
9
|
-
ForemanMaintain.upgrade_in_progress == '
|
8
|
+
(feature(:capsule).current_minor_version == '6.11' || \
|
9
|
+
ForemanMaintain.upgrade_in_progress == '6.11.z')
|
10
10
|
end
|
11
11
|
instance_eval(&block)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def target_version
|
16
|
-
'
|
16
|
+
'6.11.z'
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
class PreUpgradeCheck < Abstract
|
21
21
|
upgrade_metadata do
|
22
|
-
description 'Checks before upgrading to Capsule
|
22
|
+
description 'Checks before upgrading to Capsule 6.11.z'
|
23
23
|
tags :pre_upgrade_checks
|
24
24
|
run_strategy :fail_slow
|
25
25
|
end
|
@@ -27,13 +27,13 @@ module Scenarios::Capsule_7_0_z
|
|
27
27
|
def compose
|
28
28
|
add_steps(find_checks(:default))
|
29
29
|
add_steps(find_checks(:pre_upgrade))
|
30
|
-
add_step(Checks::Repositories::Validate.new(:version => '
|
30
|
+
add_step(Checks::Repositories::Validate.new(:version => '6.11'))
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
34
|
class PreMigrations < Abstract
|
35
35
|
upgrade_metadata do
|
36
|
-
description 'Procedures before migrating to Capsule
|
36
|
+
description 'Procedures before migrating to Capsule 6.11.z'
|
37
37
|
tags :pre_migrations
|
38
38
|
end
|
39
39
|
|
@@ -45,7 +45,7 @@ module Scenarios::Capsule_7_0_z
|
|
45
45
|
|
46
46
|
class Migrations < Abstract
|
47
47
|
upgrade_metadata do
|
48
|
-
description 'Migration scripts to Capsule
|
48
|
+
description 'Migration scripts to Capsule 6.11.z'
|
49
49
|
tags :migrations
|
50
50
|
end
|
51
51
|
|
@@ -54,7 +54,7 @@ module Scenarios::Capsule_7_0_z
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def compose
|
57
|
-
add_step(Procedures::Repositories::Setup.new(:version => '
|
57
|
+
add_step(Procedures::Repositories::Setup.new(:version => '6.11'))
|
58
58
|
add_step(Procedures::Packages::UnlockVersions.new)
|
59
59
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
60
60
|
add_step_with_context(Procedures::Installer::Upgrade)
|
@@ -63,7 +63,7 @@ module Scenarios::Capsule_7_0_z
|
|
63
63
|
|
64
64
|
class PostMigrations < Abstract
|
65
65
|
upgrade_metadata do
|
66
|
-
description 'Procedures after migrating to Capsule
|
66
|
+
description 'Procedures after migrating to Capsule 6.11.z'
|
67
67
|
tags :post_migrations
|
68
68
|
end
|
69
69
|
|
@@ -76,7 +76,7 @@ module Scenarios::Capsule_7_0_z
|
|
76
76
|
|
77
77
|
class PostUpgradeChecks < Abstract
|
78
78
|
upgrade_metadata do
|
79
|
-
description 'Checks after upgrading to Capsule
|
79
|
+
description 'Checks after upgrading to Capsule 6.11.z'
|
80
80
|
tags :post_upgrade_checks
|
81
81
|
run_strategy :fail_slow
|
82
82
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module Scenarios::
|
1
|
+
module Scenarios::Satellite_6_11
|
2
2
|
class Abstract < ForemanMaintain::Scenario
|
3
3
|
def self.upgrade_metadata(&block)
|
4
4
|
metadata do
|
@@ -6,20 +6,20 @@ module Scenarios::Satellite_7_0
|
|
6
6
|
confine do
|
7
7
|
feature(:satellite) &&
|
8
8
|
(feature(:satellite).current_minor_version == '6.10' || \
|
9
|
-
ForemanMaintain.upgrade_in_progress == '
|
9
|
+
ForemanMaintain.upgrade_in_progress == '6.11')
|
10
10
|
end
|
11
11
|
instance_eval(&block)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def target_version
|
16
|
-
'
|
16
|
+
'6.11'
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
class PreUpgradeCheck < Abstract
|
21
21
|
upgrade_metadata do
|
22
|
-
description 'Checks before upgrading to Satellite
|
22
|
+
description 'Checks before upgrading to Satellite 6.11'
|
23
23
|
tags :pre_upgrade_checks
|
24
24
|
run_strategy :fail_slow
|
25
25
|
end
|
@@ -29,13 +29,13 @@ module Scenarios::Satellite_7_0
|
|
29
29
|
add_steps(find_checks(:pre_upgrade))
|
30
30
|
|
31
31
|
add_step(Checks::Foreman::CheckpointSegments)
|
32
|
-
add_step(Checks::Repositories::Validate.new(:version => '
|
32
|
+
add_step(Checks::Repositories::Validate.new(:version => '6.11'))
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
class PreMigrations < Abstract
|
37
37
|
upgrade_metadata do
|
38
|
-
description 'Procedures before migrating to Satellite
|
38
|
+
description 'Procedures before migrating to Satellite 6.11'
|
39
39
|
tags :pre_migrations
|
40
40
|
end
|
41
41
|
|
@@ -48,7 +48,7 @@ module Scenarios::Satellite_7_0
|
|
48
48
|
|
49
49
|
class Migrations < Abstract
|
50
50
|
upgrade_metadata do
|
51
|
-
description 'Migration scripts to Satellite
|
51
|
+
description 'Migration scripts to Satellite 6.11'
|
52
52
|
tags :migrations
|
53
53
|
run_strategy :fail_fast
|
54
54
|
end
|
@@ -58,7 +58,7 @@ module Scenarios::Satellite_7_0
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def compose
|
61
|
-
add_step(Procedures::Repositories::Setup.new(:version => '
|
61
|
+
add_step(Procedures::Repositories::Setup.new(:version => '6.11'))
|
62
62
|
add_step(Procedures::Packages::UnlockVersions.new)
|
63
63
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
64
64
|
add_step_with_context(Procedures::Installer::Upgrade)
|
@@ -68,7 +68,7 @@ module Scenarios::Satellite_7_0
|
|
68
68
|
|
69
69
|
class PostMigrations < Abstract
|
70
70
|
upgrade_metadata do
|
71
|
-
description 'Procedures after migrating to Satellite
|
71
|
+
description 'Procedures after migrating to Satellite 6.11'
|
72
72
|
tags :post_migrations
|
73
73
|
end
|
74
74
|
|
@@ -81,7 +81,7 @@ module Scenarios::Satellite_7_0
|
|
81
81
|
|
82
82
|
class PostUpgradeChecks < Abstract
|
83
83
|
upgrade_metadata do
|
84
|
-
description 'Checks after upgrading to Satellite
|
84
|
+
description 'Checks after upgrading to Satellite 6.11'
|
85
85
|
tags :post_upgrade_checks
|
86
86
|
run_strategy :fail_slow
|
87
87
|
end
|
@@ -1,25 +1,25 @@
|
|
1
|
-
module Scenarios::
|
1
|
+
module Scenarios::Satellite_6_11_z
|
2
2
|
class Abstract < ForemanMaintain::Scenario
|
3
3
|
def self.upgrade_metadata(&block)
|
4
4
|
metadata do
|
5
5
|
tags :upgrade_scenario
|
6
6
|
confine do
|
7
7
|
feature(:satellite) &&
|
8
|
-
(feature(:satellite).current_minor_version == '
|
9
|
-
ForemanMaintain.upgrade_in_progress == '
|
8
|
+
(feature(:satellite).current_minor_version == '6.11' || \
|
9
|
+
ForemanMaintain.upgrade_in_progress == '6.11.z')
|
10
10
|
end
|
11
11
|
instance_eval(&block)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def target_version
|
16
|
-
'
|
16
|
+
'6.11.z'
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
class PreUpgradeCheck < Abstract
|
21
21
|
upgrade_metadata do
|
22
|
-
description 'Checks before upgrading to Satellite
|
22
|
+
description 'Checks before upgrading to Satellite 6.11.z'
|
23
23
|
tags :pre_upgrade_checks
|
24
24
|
run_strategy :fail_slow
|
25
25
|
end
|
@@ -27,13 +27,13 @@ module Scenarios::Satellite_7_0_z
|
|
27
27
|
def compose
|
28
28
|
add_steps(find_checks(:default))
|
29
29
|
add_steps(find_checks(:pre_upgrade))
|
30
|
-
add_step(Checks::Repositories::Validate.new(:version => '
|
30
|
+
add_step(Checks::Repositories::Validate.new(:version => '6.11'))
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
34
|
class PreMigrations < Abstract
|
35
35
|
upgrade_metadata do
|
36
|
-
description 'Procedures before migrating to Satellite
|
36
|
+
description 'Procedures before migrating to Satellite 6.11.z'
|
37
37
|
tags :pre_migrations
|
38
38
|
end
|
39
39
|
|
@@ -45,7 +45,7 @@ module Scenarios::Satellite_7_0_z
|
|
45
45
|
|
46
46
|
class Migrations < Abstract
|
47
47
|
upgrade_metadata do
|
48
|
-
description 'Migration scripts to Satellite
|
48
|
+
description 'Migration scripts to Satellite 6.11.z'
|
49
49
|
tags :migrations
|
50
50
|
end
|
51
51
|
|
@@ -54,7 +54,7 @@ module Scenarios::Satellite_7_0_z
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def compose
|
57
|
-
add_step(Procedures::Repositories::Setup.new(:version => '
|
57
|
+
add_step(Procedures::Repositories::Setup.new(:version => '6.11'))
|
58
58
|
add_step(Procedures::Packages::UnlockVersions.new)
|
59
59
|
add_step(Procedures::Packages::Update.new(:assumeyes => true))
|
60
60
|
add_step_with_context(Procedures::Installer::Upgrade)
|
@@ -64,7 +64,7 @@ module Scenarios::Satellite_7_0_z
|
|
64
64
|
|
65
65
|
class PostMigrations < Abstract
|
66
66
|
upgrade_metadata do
|
67
|
-
description 'Procedures after migrating to Satellite
|
67
|
+
description 'Procedures after migrating to Satellite 6.11.z'
|
68
68
|
tags :post_migrations
|
69
69
|
end
|
70
70
|
|
@@ -77,7 +77,7 @@ module Scenarios::Satellite_7_0_z
|
|
77
77
|
|
78
78
|
class PostUpgradeChecks < Abstract
|
79
79
|
upgrade_metadata do
|
80
|
-
description 'Checks after upgrading to Satellite
|
80
|
+
description 'Checks after upgrading to Satellite 6.11.z'
|
81
81
|
tags :post_upgrade_checks
|
82
82
|
run_strategy :fail_slow
|
83
83
|
end
|
@@ -3,7 +3,7 @@ module ForemanMaintain
|
|
3
3
|
class SelfUpgradeCommand < Base
|
4
4
|
option ['--target-version'], 'TARGET_VERSION',\
|
5
5
|
'Major version of the Satellite or Capsule'\
|
6
|
-
|
6
|
+
', e.g 6.11', :required => true
|
7
7
|
def execute
|
8
8
|
allow_major_version_upgrade_only
|
9
9
|
run_scenario(upgrade_scenario, upgrade_rescue_scenario)
|
@@ -116,7 +116,7 @@ module ForemanMaintain
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def common_repos(full_version)
|
119
|
-
sat_maint_version = if version(full_version) >= version('
|
119
|
+
sat_maint_version = if version(full_version) >= version('6.11') && !use_beta_repos?
|
120
120
|
full_version
|
121
121
|
else
|
122
122
|
full_version[0]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
@@ -334,14 +334,16 @@ files:
|
|
334
334
|
- definitions/scenarios/services.rb
|
335
335
|
- definitions/scenarios/upgrade_to_capsule_6_10.rb
|
336
336
|
- definitions/scenarios/upgrade_to_capsule_6_10_z.rb
|
337
|
+
- definitions/scenarios/upgrade_to_capsule_6_11.rb
|
338
|
+
- definitions/scenarios/upgrade_to_capsule_6_11_z.rb
|
337
339
|
- definitions/scenarios/upgrade_to_capsule_6_8.rb
|
338
340
|
- definitions/scenarios/upgrade_to_capsule_6_8_z.rb
|
339
341
|
- definitions/scenarios/upgrade_to_capsule_6_9.rb
|
340
342
|
- definitions/scenarios/upgrade_to_capsule_6_9_z.rb
|
341
|
-
- definitions/scenarios/upgrade_to_capsule_7_0.rb
|
342
|
-
- definitions/scenarios/upgrade_to_capsule_7_0_z.rb
|
343
343
|
- definitions/scenarios/upgrade_to_satellite_6_10.rb
|
344
344
|
- definitions/scenarios/upgrade_to_satellite_6_10_z.rb
|
345
|
+
- definitions/scenarios/upgrade_to_satellite_6_11.rb
|
346
|
+
- definitions/scenarios/upgrade_to_satellite_6_11_z.rb
|
345
347
|
- definitions/scenarios/upgrade_to_satellite_6_2.rb
|
346
348
|
- definitions/scenarios/upgrade_to_satellite_6_2_z.rb
|
347
349
|
- definitions/scenarios/upgrade_to_satellite_6_3.rb
|
@@ -358,8 +360,6 @@ files:
|
|
358
360
|
- definitions/scenarios/upgrade_to_satellite_6_8_z.rb
|
359
361
|
- definitions/scenarios/upgrade_to_satellite_6_9.rb
|
360
362
|
- definitions/scenarios/upgrade_to_satellite_6_9_z.rb
|
361
|
-
- definitions/scenarios/upgrade_to_satellite_7_0.rb
|
362
|
-
- definitions/scenarios/upgrade_to_satellite_7_0_z.rb
|
363
363
|
- extras/foreman-maintain.sh
|
364
364
|
- extras/foreman_protector/foreman-protector.conf
|
365
365
|
- extras/foreman_protector/foreman-protector.py
|