foreman_maintain 1.4.2 → 1.4.3

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: 4d37937d8bc4cbf619ea0e654e6826ae92a96ecd74f1b260e5b402df7bcbdc68
4
- data.tar.gz: a0fcf7a0f6802f7547c26d640650ac29cafa3568f7fdbc648f31d3dbdbcf6a72
3
+ metadata.gz: 2d9b46e0f2566916075ef7ec1972734f31919fafaa10ce814a2e5006ece9ab62
4
+ data.tar.gz: 989952ede4062aaba32b380a5226b63e9aaa0c22ffbf34b79bc80a153a0b0920
5
5
  SHA512:
6
- metadata.gz: 2bab8216e974e96128a5f0fb88a201d1c8dd9da13d71b89efea76337c242f6459285e8af8a8dbcacbaa318f402c1b26cc7056e5e1d976946b8939f13bbaa4fda
7
- data.tar.gz: 59772c9b2ec381408458383f4e06bafb8bb3998f5c4cea60be7a2dc2a254803896a05aa2858aad48f34e54185b7db6a455534cafa5f671b6a52a69bbe0b07e74
6
+ metadata.gz: a9a380eb151bfadbbba33824d438dc69fe47732cf3219af14b8e78ebcb2bb8dd5ba590fc9887d936aa1eb662e644f8e085a39c2023a71e5d3d975075d37a57bb
7
+ data.tar.gz: 7725d0d13f08191822fbda79b828498d8b064a984ca8d38a841d1e400768ec6c530ea8d99c94ea35f6a62ac547455de32a9d4048d06a3d4a953fd065908385d1
@@ -0,0 +1,41 @@
1
+ require 'yaml'
2
+
3
+ class Checks::CheckKatelloAgentEnabled < ForemanMaintain::Check
4
+ metadata do
5
+ label :check_katello_agent_enabled
6
+ description 'Check whether the katello-agent feature is enabled before upgrading'
7
+ tags :pre_upgrade
8
+
9
+ confine do
10
+ !feature(:capsule)
11
+ end
12
+ end
13
+
14
+ def run
15
+ instance_name = feature(:instance).downstream ? "Satellite" : "Katello"
16
+ instance_version = feature(:instance).downstream ? "6.15" : "4.10"
17
+ installer_command = feature(:instance).downstream ? "satellite-installer" : "foreman-installer"
18
+ maintain_command = feature(:instance).downstream ? "satellite-maintain" : "foreman-maintain"
19
+
20
+ assert(
21
+ !katello_agent_enabled?,
22
+ "The katello-agent feature is enabled on this system. As of #{instance_name}"\
23
+ " #{instance_version}, katello-agent is removed and will no longer function."\
24
+ " Before proceeding with the upgrade, you should ensure that you have deployed"\
25
+ " and configured an alternative tool for remote package management and patching"\
26
+ " for content hosts, such as Remote Execution (REX) with pull-based transport."\
27
+ " See the Managing Hosts guide in the #{instance_name} documentation for more info."\
28
+ " Disable katello-agent with the command"\
29
+ " `#{installer_command} --foreman-proxy-content-enable-katello-agent false`"\
30
+ " before proceeding with the upgrade. Alternatively, you may skip this check and proceed by"\
31
+ " running #{maintain_command} again with the `--whitelist` option, which will automatically"\
32
+ " uninstall katello-agent."
33
+ )
34
+ end
35
+
36
+ private
37
+
38
+ def katello_agent_enabled?
39
+ feature(:installer).answers['foreman_proxy_content']['enable_katello_agent']
40
+ end
41
+ end
@@ -2,7 +2,8 @@ module ForemanMaintain
2
2
  module Concerns
3
3
  module PrimaryChecks
4
4
  def validate_downstream_packages
5
- return unless detector.feature(:installer)&.with_scenarios?
5
+ return unless detector.feature(:installer)
6
+
6
7
  if (package = package_name) && !package_manager.installed?(package)
7
8
  raise ForemanMaintain::Error::Fail,
8
9
  "Error: Important rpm package #{package} is not installed!"\
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.4.2'.freeze
2
+ VERSION = '1.4.3'.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.4.2
4
+ version: 1.4.3
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-10-26 00:00:00.000000000 Z
11
+ date: 2023-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -181,6 +181,7 @@ files:
181
181
  - definitions/checks/foreman_tasks/invalid/check_planning_state.rb
182
182
  - definitions/checks/foreman_tasks/not_paused.rb
183
183
  - definitions/checks/foreman_tasks/not_running.rb
184
+ - definitions/checks/katello_agent.rb
184
185
  - definitions/checks/maintenance_mode/check_consistency.rb
185
186
  - definitions/checks/non_rh_packages.rb
186
187
  - definitions/checks/package_manager/dnf/validate_dnf_config.rb