foreman_maintain 1.10.3 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/definitions/checks/container/podman_login.rb +30 -0
  3. data/definitions/checks/iop_advisor/db_up.rb +33 -0
  4. data/definitions/checks/iop_inventory/db_up.rb +33 -0
  5. data/definitions/checks/iop_remediations/db_up.rb +33 -0
  6. data/definitions/checks/iop_vmaas/db_up.rb +33 -0
  7. data/definitions/checks/iop_vulnerability/db_up.rb +33 -0
  8. data/definitions/features/containers.rb +8 -0
  9. data/definitions/features/iop.rb +46 -0
  10. data/definitions/features/iop_advisor_database.rb +45 -0
  11. data/definitions/features/iop_inventory_database.rb +45 -0
  12. data/definitions/features/iop_remediations_database.rb +45 -0
  13. data/definitions/features/iop_vmaas_database.rb +45 -0
  14. data/definitions/features/iop_vulnerability_database.rb +45 -0
  15. data/definitions/procedures/backup/online/iop_advisor_db.rb +20 -0
  16. data/definitions/procedures/backup/online/iop_inventory_db.rb +20 -0
  17. data/definitions/procedures/backup/online/iop_remediations_db.rb +21 -0
  18. data/definitions/procedures/backup/online/iop_vmaas_db.rb +20 -0
  19. data/definitions/procedures/backup/online/iop_vulnerability_db.rb +21 -0
  20. data/definitions/procedures/restore/drop_databases.rb +46 -1
  21. data/definitions/procedures/restore/iop_advisor_dump.rb +27 -0
  22. data/definitions/procedures/restore/iop_inventory_dump.rb +27 -0
  23. data/definitions/procedures/restore/iop_remediations_dump.rb +27 -0
  24. data/definitions/procedures/restore/iop_vmaas_dump.rb +25 -0
  25. data/definitions/procedures/restore/iop_vulnerability_dump.rb +27 -0
  26. data/definitions/reports/advisor_on_prem_remediations.rb +33 -0
  27. data/definitions/reports/alternate_content_sources.rb +46 -0
  28. data/definitions/reports/content.rb +54 -0
  29. data/definitions/reports/image_mode_hosts.rb +50 -0
  30. data/definitions/reports/inventory.rb +25 -1
  31. data/definitions/reports/networking.rb +78 -0
  32. data/definitions/reports/platform.rb +1 -1
  33. data/definitions/scenarios/backup.rb +10 -0
  34. data/definitions/scenarios/restore.rb +25 -0
  35. data/definitions/scenarios/satellite_upgrade.rb +1 -0
  36. data/definitions/scenarios/update.rb +1 -0
  37. data/lib/foreman_maintain/cli/report_command.rb +112 -10
  38. data/lib/foreman_maintain/concerns/downstream.rb +5 -0
  39. data/lib/foreman_maintain/utils/backup.rb +5 -0
  40. data/lib/foreman_maintain/utils/service/systemd.rb +2 -2
  41. data/lib/foreman_maintain/version.rb +1 -1
  42. metadata +31 -3
@@ -0,0 +1,27 @@
1
+ module Procedures::Restore
2
+ class IopAdvisorDump < ForemanMaintain::Procedure
3
+ metadata do
4
+ description 'Restore IoP Advisor dump from backup'
5
+ param :backup_dir,
6
+ 'Path to backup directory',
7
+ :required => true
8
+ preparation_steps { Checks::IopAdvisor::DBUp.new }
9
+ confine do
10
+ feature(:iop_advisor_database)
11
+ end
12
+ end
13
+
14
+ def run
15
+ backup = ForemanMaintain::Utils::Backup.new(@backup_dir)
16
+
17
+ with_spinner('Restoring IoP Advisor dump') do |_spinner|
18
+ if backup.file_map[:candlepin_dump][:present]
19
+ local = feature(:iop_advisor_database).local?
20
+ feature(:iop_advisor_database).restore_dump(
21
+ backup.file_map[:iop_advisor_dump][:path], local
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ module Procedures::Restore
2
+ class IopInventoryDump < ForemanMaintain::Procedure
3
+ metadata do
4
+ description 'Restore IoP Inventory dump from backup'
5
+ param :backup_dir,
6
+ 'Path to backup directory',
7
+ :required => true
8
+ preparation_steps { Checks::IopInventory::DBUp.new }
9
+ confine do
10
+ feature(:iop_inventory_database)
11
+ end
12
+ end
13
+
14
+ def run
15
+ backup = ForemanMaintain::Utils::Backup.new(@backup_dir)
16
+
17
+ with_spinner('Restoring IoP Inventory dump') do |_spinner|
18
+ if backup.file_map[:candlepin_dump][:present]
19
+ local = feature(:iop_inventory_database).local?
20
+ feature(:iop_inventory_database).restore_dump(
21
+ backup.file_map[:iop_inventory_dump][:path], local
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ module Procedures::Restore
2
+ class IopRemediationsDump < ForemanMaintain::Procedure
3
+ metadata do
4
+ description 'Restore IoP Remediations dump from backup'
5
+ param :backup_dir,
6
+ 'Path to backup directory',
7
+ :required => true
8
+ preparation_steps { Checks::IopRemediations::DBUp.new }
9
+ confine do
10
+ feature(:iop_remediations_database)
11
+ end
12
+ end
13
+
14
+ def run
15
+ backup = ForemanMaintain::Utils::Backup.new(@backup_dir)
16
+
17
+ with_spinner('Restoring IoP Remediations dump') do |_spinner|
18
+ if backup.file_map[:candlepin_dump][:present]
19
+ local = feature(:iop_remediations_database).local?
20
+ feature(:iop_remediations_database).restore_dump(
21
+ backup.file_map[:iop_remediations_dump][:path], local
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,25 @@
1
+ module Procedures::Restore
2
+ class IopVmaasDump < ForemanMaintain::Procedure
3
+ metadata do
4
+ description 'Restore IoP Vmaas dump from backup'
5
+ param :backup_dir,
6
+ 'Path to backup directory',
7
+ :required => true
8
+ preparation_steps { Checks::IopVmaas::DBUp.new }
9
+ confine do
10
+ feature(:iop_vmaas_database)
11
+ end
12
+ end
13
+
14
+ def run
15
+ backup = ForemanMaintain::Utils::Backup.new(@backup_dir)
16
+
17
+ with_spinner('Restoring IoP Vmaas dump') do |_spinner|
18
+ if backup.file_map[:candlepin_dump][:present]
19
+ local = feature(:iop_vmaas_database).local?
20
+ feature(:iop_vmaas_database).restore_dump(backup.file_map[:iop_vmaas_dump][:path], local)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ module Procedures::Restore
2
+ class IopVulnerabilityDump < ForemanMaintain::Procedure
3
+ metadata do
4
+ description 'Restore IoP Vulnerability dump from backup'
5
+ param :backup_dir,
6
+ 'Path to backup directory',
7
+ :required => true
8
+ preparation_steps { Checks::IopVulnerability::DBUp.new }
9
+ confine do
10
+ feature(:iop_vulnerability_database)
11
+ end
12
+ end
13
+
14
+ def run
15
+ backup = ForemanMaintain::Utils::Backup.new(@backup_dir)
16
+
17
+ with_spinner('Restoring IoP Vulnerability dump') do |_spinner|
18
+ if backup.file_map[:candlepin_dump][:present]
19
+ local = feature(:iop_vulnerability_database).local?
20
+ feature(:iop_vulnerability_database).restore_dump(
21
+ backup.file_map[:iop_vulnerability_dump][:path], local
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,33 @@
1
+ module Reports
2
+ class AdvisorOnPremRemediations < ForemanMaintain::Report
3
+ metadata do
4
+ description 'Report number of remediations based on advisor rules from advisor on premise'
5
+ end
6
+
7
+ def run
8
+ data_field('advisor_on_prem_remediations_enabled') { advisor_on_prem_remediations_enabled }
9
+ data_field('advisor_on_prem_remediations_count') { advisor_on_prem_remediations_count }
10
+ end
11
+
12
+ def advisor_on_prem_remediations_enabled
13
+ if @iop_enabled.nil?
14
+ @iop_enabled = feature(:installer)&.answers&.dig(
15
+ 'foreman::plugin::rh_cloud', 'enable_iop_advisor_engine'
16
+ ) || false
17
+ end
18
+ @iop_enabled
19
+ end
20
+
21
+ def advisor_on_prem_remediations_count
22
+ if advisor_on_prem_remediations_enabled
23
+ return sql_count('
24
+ job_invocations AS jobs
25
+ INNER JOIN remote_execution_features AS rexf ON jobs.remote_execution_feature_id = rexf.id
26
+ INNER JOIN template_invocations AS tinv ON jobs.id = tinv.job_invocation_id
27
+ WHERE rexf.label = \'rh_cloud_remediate_hosts\'
28
+ AND tinv.host_id IS NOT NULL
29
+ ')
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,46 @@
1
+ module Checks
2
+ module Report
3
+ class AlternateContentSources < ForemanMaintain::Report
4
+ metadata do
5
+ description 'Facts about ACSs'
6
+ confine do
7
+ feature(:katello)
8
+ end
9
+ end
10
+
11
+ def run
12
+ data_field('custom_alternate_content_sources_count') { custom_alternate_content_sources }
13
+ data_field('simplified_alternate_content_sources_count') do
14
+ simplified_alternate_content_sources
15
+ end
16
+ data_field('rhui_alternate_content_sources_count') { rhui_alternate_content_sources }
17
+ data_field('yum_alternate_content_sources_count') { yum_alternate_content_sources }
18
+ data_field('file_alternate_content_sources_count') { file_alternate_content_sources }
19
+ end
20
+
21
+ def custom_alternate_content_sources
22
+ sql_count(
23
+ "katello_alternate_content_sources WHERE alternate_content_source_type = 'custom'"
24
+ )
25
+ end
26
+
27
+ def simplified_alternate_content_sources
28
+ sql_count(
29
+ "katello_alternate_content_sources WHERE alternate_content_source_type = 'simplified'"
30
+ )
31
+ end
32
+
33
+ def rhui_alternate_content_sources
34
+ sql_count("katello_alternate_content_sources WHERE alternate_content_source_type = 'rhui'")
35
+ end
36
+
37
+ def yum_alternate_content_sources
38
+ sql_count("katello_alternate_content_sources WHERE content_type = 'yum'")
39
+ end
40
+
41
+ def file_alternate_content_sources
42
+ sql_count("katello_alternate_content_sources WHERE content_type = 'file'")
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,54 @@
1
+ module Checks
2
+ module Report
3
+ class Content < ForemanMaintain::Report
4
+ metadata do
5
+ description 'Facts about Katello content'
6
+ confine do
7
+ feature(:katello)
8
+ end
9
+ end
10
+
11
+ def run
12
+ data_field('custom_library_yum_repositories_count') { custom_library_yum_repositories }
13
+ data_field('redhat_library_yum_repositories_count') { redhat_library_yum_repositories }
14
+ data_field('library_debian_repositories_count') { library_repositories('deb') }
15
+ data_field('library_container_repositories_count') { library_repositories('docker') }
16
+ data_field('library_file_repositories_count') { library_repositories('file') }
17
+ data_field('library_python_repositories_count') { library_repositories('python') }
18
+ data_field('library_ansible_collection_repositories_count') do
19
+ library_repositories('ansible_collection')
20
+ end
21
+ data_field('library_ostree_repositories_count') { library_repositories('ostree') }
22
+ end
23
+
24
+ def custom_library_yum_repositories
25
+ query_snippet =
26
+ <<-SQL
27
+ "katello_root_repositories"
28
+ WHERE "katello_root_repositories"."id" NOT IN
29
+ (SELECT "katello_root_repositories"."id" FROM "katello_root_repositories" INNER JOIN "katello_products"
30
+ ON "katello_products"."id" = "katello_root_repositories"."product_id" INNER JOIN "katello_providers"
31
+ ON "katello_providers"."id" = "katello_products"."provider_id" WHERE "katello_providers"."provider_type" = 'Red Hat')
32
+ AND "katello_root_repositories"."content_type" = 'yum'
33
+ SQL
34
+ sql_count(query_snippet)
35
+ end
36
+
37
+ def redhat_library_yum_repositories
38
+ query_snippet =
39
+ <<-SQL
40
+ "katello_root_repositories"
41
+ INNER JOIN "katello_products" ON "katello_products"."id" = "katello_root_repositories"."product_id"
42
+ INNER JOIN "katello_providers" ON "katello_providers"."id" = "katello_products"."provider_id"
43
+ WHERE "katello_providers"."provider_type" = 'Red Hat'
44
+ AND "katello_root_repositories"."content_type" = 'yum'
45
+ SQL
46
+ sql_count(query_snippet)
47
+ end
48
+
49
+ def library_repositories(content_type)
50
+ sql_count("katello_root_repositories WHERE content_type = '#{content_type}'")
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,50 @@
1
+ module Reports
2
+ class ImageModeHosts < ForemanMaintain::Report
3
+ metadata do
4
+ description 'Report metrics related to use of image mode'
5
+ confine do
6
+ feature(:katello)
7
+ end
8
+ end
9
+
10
+ def run
11
+ merge_data('image_mode_hosts_by_os_count') { image_mode_hosts_by_os_count }
12
+ data['remote_execution_transient_package_actions_count'] = transient_actions_count
13
+ end
14
+
15
+ # OS usage on image mode hosts
16
+ def image_mode_hosts_by_os_count
17
+ query(
18
+ <<-SQL
19
+ select max(operatingsystems.name) as os_name, count(*) as hosts_count
20
+ from hosts inner join operatingsystems on operatingsystem_id = operatingsystems.id inner join katello_content_facets on hosts.id = katello_content_facets.host_id
21
+ where bootc_booted_digest is not null
22
+ group by operatingsystems.name
23
+ SQL
24
+ ).
25
+ to_h { |row| [row['os_name'], row['hosts_count'].to_i] }
26
+ end
27
+
28
+ def transient_actions_count
29
+ cte = <<~CTE
30
+ WITH bootc_hosts AS (
31
+ SELECT hosts.id FROM hosts
32
+ INNER JOIN katello_content_facets AS kcf ON hosts.id = kcf.host_id
33
+ WHERE kcf.bootc_booted_digest IS NOT NULL
34
+ )
35
+ CTE
36
+
37
+ sql = <<~SQL
38
+ job_invocations AS ji
39
+ INNER JOIN remote_execution_features AS ref ON ji.remote_execution_feature_id = ref.id
40
+ INNER JOIN template_invocations AS ti ON ji.id = ti.job_invocation_id
41
+ INNER JOIN bootc_hosts ON bootc_hosts.id = ti.host_id
42
+ WHERE ref.label LIKE 'katello_package%'
43
+ OR ref.label LIKE 'katello_errata%'
44
+ OR ref.label LIKE 'katello_group%'
45
+ SQL
46
+
47
+ sql_count(sql, cte: cte)
48
+ end
49
+ end
50
+ end
@@ -7,9 +7,11 @@ module Reports
7
7
  def run
8
8
  merge_data('hosts_by_type_count') { hosts_by_type_count }
9
9
  merge_data('hosts_by_os_count') { hosts_by_os_count }
10
+ merge_data('hosts_by_family_count') { hosts_by_family_count }
10
11
  merge_data('facts_by_type') { facts_by_type }
11
12
  merge_data('audits') { audits }
12
13
  merge_data('parameters_count') { parameters }
14
+ hosts_running_rhel_ai
13
15
  end
14
16
 
15
17
  # Hosts
@@ -24,12 +26,23 @@ module Reports
24
26
  <<-SQL
25
27
  select max(operatingsystems.name) as os_name, count(*) as hosts_count
26
28
  from hosts inner join operatingsystems on operatingsystem_id = operatingsystems.id
27
- group by operatingsystem_id
29
+ group by operatingsystems.name
28
30
  SQL
29
31
  ).
30
32
  to_h { |row| [row['os_name'], row['hosts_count'].to_i] }
31
33
  end
32
34
 
35
+ def hosts_by_family_count
36
+ query(
37
+ <<-SQL
38
+ select max(operatingsystems.type) as os_family, count(*) as hosts_count
39
+ from hosts inner join operatingsystems on operatingsystem_id = operatingsystems.id
40
+ group by operatingsystems.type
41
+ SQL
42
+ ).
43
+ to_h { |row| [row['os_family'], row['hosts_count'].to_i] }
44
+ end
45
+
33
46
  # Facts usage
34
47
  def facts_by_type
35
48
  query(
@@ -80,5 +93,16 @@ module Reports
80
93
  max_created_at: row['max_created_at'],
81
94
  }
82
95
  end
96
+
97
+ def hosts_running_rhel_ai
98
+ query = <<~SQL
99
+ hosts
100
+ INNER JOIN katello_subscription_facets AS ksf ON hosts.id = ksf.host_id
101
+ INNER JOIN katello_subscription_facet_installed_products AS ksfip ON ksfip.subscription_facet_id = ksf.id
102
+ INNER JOIN katello_installed_products AS kip ON ksfip.installed_product_id = kip.id
103
+ WHERE kip.name = 'Red Hat Enterprise Linux AI'
104
+ SQL
105
+ data_field('rhel_ai_workload_host_count') { sql_count(query) }
106
+ end
83
107
  end
84
108
  end
@@ -0,0 +1,78 @@
1
+ require 'socket'
2
+
3
+ module Reports
4
+ class Networking < ForemanMaintain::Report
5
+ metadata do
6
+ description 'Report information about networking'
7
+ end
8
+
9
+ def run
10
+ subnet_counts_by_type
11
+ hosts_by_address_family
12
+ interfaces_by_address_family
13
+ preference_settings
14
+ end
15
+
16
+ private
17
+
18
+ # How many ipv4 subnets are defined in Foreman?
19
+ # How many ipv6 subnets are defined in Foreman?
20
+ def subnet_counts_by_type
21
+ %w[Ipv4 Ipv6].each do |type|
22
+ data_field("subnet_#{type.downcase}_count") do
23
+ sql_count("subnets where type = 'Subnet::#{type}'")
24
+ end
25
+ end
26
+ end
27
+
28
+ # How many hosts in Foreman have an interface with an ipv4 address but no ipv6 address?
29
+ # How many hosts in Foreman have an interface with no ipv4 address but an ipv6 address?
30
+ # How many hosts in Foreman have an interface with both ipv4 and ipv6 addresses?
31
+ def hosts_by_address_family
32
+ { 'ipv4only': 'nics.ip IS NOT NULL AND nics.ip6 IS NULL',
33
+ 'ipv6only': 'nics.ip IS NULL AND nics.ip6 IS NOT NULL',
34
+ 'dualstack': 'nics.ip IS NOT NULL AND nics.ip6 IS NOT NULL' }.each do |kind, condition|
35
+ query = <<~SQL
36
+ hosts
37
+ WHERE id IN (SELECT host_id FROM nics WHERE #{condition})
38
+ SQL
39
+ data_field("hosts_with_#{kind}_interface_count") { sql_count(query) }
40
+ end
41
+ end
42
+
43
+ # How many of Foreman's interfaces:
44
+ # - only have a non-loopback, non-multicast ipv4 address?
45
+ # - only have a non-loopback, non-multicast, non-link-local ipv6 address?
46
+ # - have a non-loopback, non-multicast ipv4 address
47
+ # as well as a non-loopback, non-multicast, non-link-local ipv6 address?
48
+ def interfaces_by_address_family
49
+ by_name = Socket.getifaddrs.group_by(&:name).transform_values { |addrs| addrs.map(&:addr) }
50
+ with_ipv4, without_ipv4 = by_name.partition { |_name, addrs| relevant_ipv4?(addrs) }
51
+ dualstack, ipv4_only = with_ipv4.partition { |_name, addrs| relevant_ipv6?(addrs) }
52
+ ipv6_only = without_ipv4.select { |_name, addrs| relevant_ipv6?(addrs) }
53
+
54
+ data_field("foreman_interfaces_ipv4only_count") { ipv4_only.count }
55
+ data_field("foreman_interfaces_ipv6only_count") { ipv6_only.count }
56
+ data_field("foreman_interfaces_dualstack_count") { dualstack.count }
57
+ end
58
+
59
+ def relevant_ipv4?(addrs)
60
+ addrs.any? { |addr| addr.ipv4? && !(addr.ipv4_loopback? || addr.ipv4_multicast?) }
61
+ end
62
+
63
+ def relevant_ipv6?(addrs)
64
+ addrs.any? do |addr|
65
+ addr.ipv6? && !(addr.ipv6_loopback? || addr.ipv6_multicast? || addr.ipv6_linklocal?)
66
+ end
67
+ end
68
+
69
+ def preference_settings
70
+ %w[remote_execution_connect_by_ip_prefer_ipv6 discovery_prefer_ipv6].each do |setting|
71
+ data_field("setting_#{setting}") do
72
+ value = sql_setting(setting)
73
+ value.nil? ? false : YAML.safe_load(value)
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -57,7 +57,7 @@ module Reports
57
57
 
58
58
  def settings_fields
59
59
  data_field('modified_settings') do
60
- query("select name from settings").
60
+ query("select name from settings WHERE value IS NOT NULL").
61
61
  map { |setting_line| setting_line['name'] }.
62
62
  join(',')
63
63
  end
@@ -46,6 +46,11 @@ module ForemanMaintain::Scenarios
46
46
  Procedures::Backup::Pulp => :backup_dir,
47
47
  Procedures::Backup::Online::CandlepinDB => :backup_dir,
48
48
  Procedures::Backup::Online::ForemanDB => :backup_dir,
49
+ Procedures::Backup::Online::IopAdvisorDB => :backup_dir,
50
+ Procedures::Backup::Online::IopInventoryDB => :backup_dir,
51
+ Procedures::Backup::Online::IopRemediationsDB => :backup_dir,
52
+ Procedures::Backup::Online::IopVmaasDB => :backup_dir,
53
+ Procedures::Backup::Online::IopVulnerabilityDB => :backup_dir,
49
54
  Procedures::Backup::Online::PulpcoreDB => :backup_dir)
50
55
  context.map(:preserve_dir,
51
56
  Procedures::Backup::PrepareDirectory => :preserve_dir)
@@ -102,6 +107,11 @@ module ForemanMaintain::Scenarios
102
107
  add_steps_with_context(
103
108
  Procedures::Backup::Online::CandlepinDB,
104
109
  Procedures::Backup::Online::ForemanDB,
110
+ Procedures::Backup::Online::IopAdvisorDB,
111
+ Procedures::Backup::Online::IopInventoryDB,
112
+ Procedures::Backup::Online::IopRemediationsDB,
113
+ Procedures::Backup::Online::IopVmaasDB,
114
+ Procedures::Backup::Online::IopVulnerabilityDB,
105
115
  Procedures::Backup::Online::PulpcoreDB
106
116
  )
107
117
  end
@@ -52,6 +52,7 @@ module ForemanMaintain::Scenarios
52
52
  end
53
53
  # rubocop:enable Metrics/MethodLength,Metrics/AbcSize
54
54
 
55
+ # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity
55
56
  def restore_sql_dumps(backup)
56
57
  if feature(:instance).postgresql_local?
57
58
  add_step(Procedures::Service::Start.new(:only => ['postgresql']))
@@ -62,6 +63,24 @@ module ForemanMaintain::Scenarios
62
63
  if backup.file_map[:foreman_dump][:present]
63
64
  add_steps_with_context(Procedures::Restore::ForemanDump)
64
65
  end
66
+ if backup.file_map[:iop_advisor_dump][:present]
67
+ add_steps_with_context(Procedures::Restore::IopAdvisorDump)
68
+ end
69
+ if backup.file_map[:iop_inventory_dump][:present]
70
+ add_steps_with_context(Procedures::Restore::IopInventoryDump)
71
+ end
72
+ if backup.file_map[:iop_remediations_dump][:present]
73
+ add_steps_with_context(Procedures::Restore::IopRemediationsDump)
74
+ end
75
+ if backup.file_map[:iop_advisor_dump][:present]
76
+ add_steps_with_context(Procedures::Restore::IopAdvisorDump)
77
+ end
78
+ if backup.file_map[:iop_vmaas_dump][:present]
79
+ add_steps_with_context(Procedures::Restore::IopVmaasDump)
80
+ end
81
+ if backup.file_map[:iop_vulnerability_dump][:present]
82
+ add_steps_with_context(Procedures::Restore::IopVulnerabilityDump)
83
+ end
65
84
  if backup.file_map[:pulpcore_dump][:present]
66
85
  add_steps_with_context(Procedures::Restore::PulpcoreDump)
67
86
  end
@@ -69,6 +88,7 @@ module ForemanMaintain::Scenarios
69
88
  add_step(Procedures::Service::Stop.new(:only => ['postgresql']))
70
89
  end
71
90
  end
91
+ # rubocop:enable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity
72
92
 
73
93
  def set_context_mapping
74
94
  context.map(:backup_dir,
@@ -81,6 +101,11 @@ module ForemanMaintain::Scenarios
81
101
  Procedures::Restore::DropDatabases => :backup_dir,
82
102
  Procedures::Restore::CandlepinDump => :backup_dir,
83
103
  Procedures::Restore::ForemanDump => :backup_dir,
104
+ Procedures::Restore::IopAdvisorDump => :backup_dir,
105
+ Procedures::Restore::IopInventoryDump => :backup_dir,
106
+ Procedures::Restore::IopRemediationsDump => :backup_dir,
107
+ Procedures::Restore::IopVmaasDump => :backup_dir,
108
+ Procedures::Restore::IopVulnerabilityDump => :backup_dir,
84
109
  Procedures::Restore::PulpcoreDump => :backup_dir,
85
110
  Procedures::Restore::ExtractFiles => :backup_dir)
86
111
  end
@@ -36,6 +36,7 @@ module Scenarios::Satellite
36
36
  Checks::CheckHotfixInstalled,
37
37
  Checks::CheckTmout,
38
38
  Checks::CheckUpstreamRepository,
39
+ Checks::Container::PodmanLogin, # if downstream, connected, containers used
39
40
  Checks::Disk::AvailableSpace,
40
41
  Checks::Disk::AvailableSpaceCandlepin, # if candlepin
41
42
  Checks::Disk::PostgresqlMountpoint,
@@ -35,6 +35,7 @@ module Scenarios::Update
35
35
  Checks::CheckTmout,
36
36
  Checks::CheckIpv6Disable,
37
37
  Checks::CheckUpstreamRepository,
38
+ Checks::Container::PodmanLogin, # if downstream, connected, containers used
38
39
  Checks::Disk::AvailableSpace,
39
40
  Checks::Disk::AvailableSpaceCandlepin, # if candlepin
40
41
  Checks::Foreman::ValidateExternalDbVersion, # if external database