foreman_maintain 0.9.2 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/definitions/checks/foreman/check_puppet_capsules.rb +43 -0
  3. data/definitions/checks/foreman_proxy/check_tftp_storage.rb +3 -1
  4. data/definitions/checks/pulpcore/group_ownership_check.rb +18 -0
  5. data/definitions/checks/repositories/check_non_rh_repository.rb +9 -4
  6. data/definitions/checks/repositories/check_upstream_repository.rb +4 -4
  7. data/definitions/features/candlepin.rb +1 -2
  8. data/definitions/features/pulpcore.rb +2 -1
  9. data/definitions/features/upstream_repositories.rb +23 -0
  10. data/definitions/procedures/pulp/remove.rb +12 -0
  11. data/definitions/procedures/pulpcore/migrate.rb +1 -1
  12. data/definitions/procedures/puppet/remove_puppet.rb +58 -0
  13. data/definitions/procedures/puppet/remove_puppet_data.rb +21 -0
  14. data/definitions/procedures/repositories/backup_enabled_repos.rb +16 -0
  15. data/definitions/procedures/repositories/disable.rb +2 -2
  16. data/definitions/procedures/repositories/enable.rb +13 -0
  17. data/definitions/scenarios/puppet.rb +21 -0
  18. data/definitions/scenarios/restore.rb +11 -2
  19. data/definitions/scenarios/self_upgrade.rb +102 -0
  20. data/definitions/scenarios/upgrade_to_capsule_7_0.rb +89 -0
  21. data/definitions/scenarios/upgrade_to_capsule_7_0_z.rb +89 -0
  22. data/definitions/scenarios/upgrade_to_satellite_6_10.rb +1 -8
  23. data/definitions/scenarios/upgrade_to_satellite_7_0.rb +93 -0
  24. data/definitions/scenarios/upgrade_to_satellite_7_0_z.rb +90 -0
  25. data/lib/foreman_maintain/cli/plugin_command.rb +14 -0
  26. data/lib/foreman_maintain/cli/restore_command.rb +5 -1
  27. data/lib/foreman_maintain/cli/self_upgrade_command.rb +38 -0
  28. data/lib/foreman_maintain/cli.rb +4 -0
  29. data/lib/foreman_maintain/concerns/downstream.rb +57 -29
  30. data/lib/foreman_maintain/concerns/system_helpers.rb +11 -4
  31. data/lib/foreman_maintain/repository_manager/el.rb +85 -0
  32. data/lib/foreman_maintain/repository_manager.rb +13 -0
  33. data/lib/foreman_maintain/version.rb +1 -1
  34. data/lib/foreman_maintain.rb +1 -0
  35. metadata +19 -7
  36. data/definitions/features/system_repos.rb +0 -50
  37. data/lib/foreman_maintain/concerns/el_repos_manager_common.rb +0 -20
  38. data/lib/foreman_maintain/repos_manager/dnf_config_manager.rb +0 -13
  39. data/lib/foreman_maintain/repos_manager/el_common.rb +0 -0
  40. data/lib/foreman_maintain/repos_manager/yum_config_manager.rb +0 -20
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: 0.9.2
4
+ version: 1.0.2
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: 2021-11-10 00:00:00.000000000 Z
11
+ date: 2022-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -149,6 +149,7 @@ files:
149
149
  - definitions/checks/foreman/check_duplicate_permission.rb
150
150
  - definitions/checks/foreman/check_duplicate_roles.rb
151
151
  - definitions/checks/foreman/check_https_proxies.rb
152
+ - definitions/checks/foreman/check_puppet_capsules.rb
152
153
  - definitions/checks/foreman/db_up.rb
153
154
  - definitions/checks/foreman/facts_names.rb
154
155
  - definitions/checks/foreman/puppet_class_duplicates.rb
@@ -168,6 +169,7 @@ files:
168
169
  - definitions/checks/original_assets.rb
169
170
  - definitions/checks/package_manager/yum/validate_yum_config.rb
170
171
  - definitions/checks/pulpcore/db_up.rb
172
+ - definitions/checks/pulpcore/group_ownership_check.rb
171
173
  - definitions/checks/puppet/provide_upgrade_guide.rb
172
174
  - definitions/checks/puppet/verify_no_empty_cacert_requests.rb
173
175
  - definitions/checks/puppet/warn_about_puppet_removal.rb
@@ -212,9 +214,9 @@ files:
212
214
  - definitions/features/satellite.rb
213
215
  - definitions/features/service.rb
214
216
  - definitions/features/sync_plans.rb
215
- - definitions/features/system_repos.rb
216
217
  - definitions/features/tar.rb
217
218
  - definitions/features/upstream.rb
219
+ - definitions/features/upstream_repositories.rb
218
220
  - definitions/procedures/backup/accessibility_confirmation.rb
219
221
  - definitions/procedures/backup/clean.rb
220
222
  - definitions/procedures/backup/compress_data.rb
@@ -286,9 +288,13 @@ files:
286
288
  - definitions/procedures/pulp/remove.rb
287
289
  - definitions/procedures/pulpcore/migrate.rb
288
290
  - definitions/procedures/puppet/delete_empty_ca_cert_request_files.rb
291
+ - definitions/procedures/puppet/remove_puppet.rb
292
+ - definitions/procedures/puppet/remove_puppet_data.rb
289
293
  - definitions/procedures/refresh_features.rb
290
294
  - definitions/procedures/remote_execution/remove_existing_settingsd.rb
295
+ - definitions/procedures/repositories/backup_enabled_repos.rb
291
296
  - definitions/procedures/repositories/disable.rb
297
+ - definitions/procedures/repositories/enable.rb
292
298
  - definitions/procedures/repositories/setup.rb
293
299
  - definitions/procedures/restore/candlepin_dump.rb
294
300
  - definitions/procedures/restore/configs.rb
@@ -320,7 +326,9 @@ files:
320
326
  - definitions/scenarios/maintenance_mode.rb
321
327
  - definitions/scenarios/packages.rb
322
328
  - definitions/scenarios/prep_6_10_upgrade.rb
329
+ - definitions/scenarios/puppet.rb
323
330
  - definitions/scenarios/restore.rb
331
+ - definitions/scenarios/self_upgrade.rb
324
332
  - definitions/scenarios/services.rb
325
333
  - definitions/scenarios/upgrade_to_capsule_6_10.rb
326
334
  - definitions/scenarios/upgrade_to_capsule_6_10_z.rb
@@ -328,6 +336,8 @@ files:
328
336
  - definitions/scenarios/upgrade_to_capsule_6_8_z.rb
329
337
  - definitions/scenarios/upgrade_to_capsule_6_9.rb
330
338
  - definitions/scenarios/upgrade_to_capsule_6_9_z.rb
339
+ - definitions/scenarios/upgrade_to_capsule_7_0.rb
340
+ - definitions/scenarios/upgrade_to_capsule_7_0_z.rb
331
341
  - definitions/scenarios/upgrade_to_satellite_6_10.rb
332
342
  - definitions/scenarios/upgrade_to_satellite_6_10_z.rb
333
343
  - definitions/scenarios/upgrade_to_satellite_6_2.rb
@@ -346,6 +356,8 @@ files:
346
356
  - definitions/scenarios/upgrade_to_satellite_6_8_z.rb
347
357
  - definitions/scenarios/upgrade_to_satellite_6_9.rb
348
358
  - definitions/scenarios/upgrade_to_satellite_6_9_z.rb
359
+ - definitions/scenarios/upgrade_to_satellite_7_0.rb
360
+ - definitions/scenarios/upgrade_to_satellite_7_0_z.rb
349
361
  - extras/foreman-maintain.sh
350
362
  - extras/foreman_protector/foreman-protector.conf
351
363
  - extras/foreman_protector/foreman-protector.py
@@ -367,14 +379,15 @@ files:
367
379
  - lib/foreman_maintain/cli/health_command.rb
368
380
  - lib/foreman_maintain/cli/maintenance_mode_command.rb
369
381
  - lib/foreman_maintain/cli/packages_command.rb
382
+ - lib/foreman_maintain/cli/plugin_command.rb
370
383
  - lib/foreman_maintain/cli/restore_command.rb
384
+ - lib/foreman_maintain/cli/self_upgrade_command.rb
371
385
  - lib/foreman_maintain/cli/service_command.rb
372
386
  - lib/foreman_maintain/cli/transform_clamp_options.rb
373
387
  - lib/foreman_maintain/cli/upgrade_command.rb
374
388
  - lib/foreman_maintain/concerns/base_database.rb
375
389
  - lib/foreman_maintain/concerns/directory_marker.rb
376
390
  - lib/foreman_maintain/concerns/downstream.rb
377
- - lib/foreman_maintain/concerns/el_repos_manager_common.rb
378
391
  - lib/foreman_maintain/concerns/finders.rb
379
392
  - lib/foreman_maintain/concerns/hammer.rb
380
393
  - lib/foreman_maintain/concerns/logger.rb
@@ -403,9 +416,8 @@ files:
403
416
  - lib/foreman_maintain/procedure.rb
404
417
  - lib/foreman_maintain/reporter.rb
405
418
  - lib/foreman_maintain/reporter/cli_reporter.rb
406
- - lib/foreman_maintain/repos_manager/dnf_config_manager.rb
407
- - lib/foreman_maintain/repos_manager/el_common.rb
408
- - lib/foreman_maintain/repos_manager/yum_config_manager.rb
419
+ - lib/foreman_maintain/repository_manager.rb
420
+ - lib/foreman_maintain/repository_manager/el.rb
409
421
  - lib/foreman_maintain/runner.rb
410
422
  - lib/foreman_maintain/runner/execution.rb
411
423
  - lib/foreman_maintain/runner/stored_execution.rb
@@ -1,50 +0,0 @@
1
- class Features::SystemRepos < ForemanMaintain::Feature
2
- metadata do
3
- label :system_repos
4
- description 'Feature for operations on yum repositories of system'
5
- end
6
-
7
- def upstream_repos
8
- repositories = {}
9
- enabled_repos_hash.each do |repo, url|
10
- upstream_repo_urls.each do |regex|
11
- repositories[repo] = url if url =~ regex
12
- end
13
- end
14
- repositories
15
- end
16
-
17
- def enabled_repos_hash
18
- repos = execute("yum repolist enabled -d 6 -e 0 2> /dev/null | grep -E 'Repo-id|Repo-baseurl'")
19
- return {} if repos.empty?
20
-
21
- Hash[*repos.delete!(' ').split("\n")]
22
- end
23
-
24
- def upstream_repos_ids
25
- trim_repoids(upstream_repos.keys)
26
- end
27
-
28
- def disable_repos(repo_ids)
29
- execute!("yum-config-manager --disable #{repo_ids.join(',')}")
30
- end
31
-
32
- private
33
-
34
- def trim_repoids(repos)
35
- repos.map { |r| r.gsub(%r{Repo-id:|\/+\w*}, '') }
36
- end
37
-
38
- def upstream_repo_urls
39
- repo_urls = { :Foreman => %r{yum.theforeman.org\/},
40
- :Katello => %r{fedorapeople.org\/groups\/katello\/releases\/yum\/[\/|\w|.]*} }
41
- [/#{repo_urls[:Foreman]}+releases/,
42
- /#{repo_urls[:Foreman]}+plugins/,
43
- /#{repo_urls[:Katello]}+katello/,
44
- /#{repo_urls[:Katello]}+client/,
45
- /#{repo_urls[:Katello]}+candlepin/,
46
- /#{repo_urls[:Katello]}+pulp/,
47
- %r{yum.puppetlabs.com\/el\/[\w|\/|\.]*\/x86_64},
48
- %r{repos.fedorapeople.org\/repos\/pulp\/[\/|\w|.]*\/x86_64}]
49
- end
50
- end
@@ -1,20 +0,0 @@
1
- module ForemanMaintain
2
- module Concerns
3
- module ElReposManagerCommon
4
- include ForemanMaintain::Concerns::OsFacts
5
-
6
- def package_manager
7
- return 'dnf' if el8?
8
-
9
- 'yum'
10
- end
11
-
12
- def enabled_repos_hash
13
- repos = execute("#{package_manager} repolist enabled -d 6 -e 0 2> /dev/null | grep -E 'Repo-id|Repo-baseurl'")
14
- return {} if repos.empty?
15
-
16
- Hash[*repos.delete!(' ').split("\n")]
17
- end
18
- end
19
- end
20
- end
@@ -1,13 +0,0 @@
1
- module ForemanMaintain::ReposManager
2
- class DnfConfigManager
3
- include ForemanMaintain::Concerns::ElReposManagerCommon
4
-
5
- def disable_repos(repo_ids)
6
- execute!("dnf config-manager --set-disabled #{repo_ids.join(',')}")
7
- end
8
-
9
- def enable_repos(repo_ids)
10
- execute!("dnf config-manager --set-enabled #{repo_ids.join(',')}")
11
- end
12
- end
13
- end
File without changes
@@ -1,20 +0,0 @@
1
- module ForemanMaintain::ReposManager
2
- class YumConfigManager
3
- include ForemanMaintain::Concerns::ElReposManagerCommon
4
-
5
- def disable_repos(repo_ids)
6
- execute!("yum-config-manager --disable #{repo_ids.join(',')}")
7
- end
8
-
9
- def enable_repos(repo_ids)
10
- execute!("yum-config-manager --enable #{repo_ids.join(',')}")
11
- end
12
-
13
- def enabled_repos_hash
14
- repos = execute("yum repolist enabled -d 6 -e 0 2> /dev/null | grep -E 'Repo-id|Repo-baseurl'")
15
- return {} if repos.empty?
16
-
17
- Hash[*repos.delete!(' ').split("\n")]
18
- end
19
- end
20
- end