foreman_maintain 1.1.12 → 1.1.14

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: 0d621d0e1184d6deb939587599eed9f025247de90cb18aef3d7ac81e813590e1
4
- data.tar.gz: 1b6a61eb0de1b6729252d159798c6b2f01f2e2f6647e8e9381eac634eca1fb2b
3
+ metadata.gz: b107bb35fc13fe807736e7bee91e6248335f03cd7ee254108d238f7e3f838dd3
4
+ data.tar.gz: ef3d49ecbd7753101de6e1729e8a1365c790e0c6cacc154614177140b5866963
5
5
  SHA512:
6
- metadata.gz: 26824e188738b6ff12c49538392c94c46fe3974522501dd82d6b70b9550d042b81720b8c5b17b7770e6d8d8d566219b2bdd1987a94e043a9c6cbd16b5ad96759
7
- data.tar.gz: 49851d74ea475c55aeeaf0db4f8e5d907e7de53cd464d04d846b34ba3cc015542027b1743db0777d4aea24f4da7d31cd3de75e2bd60fe359981973a301e757e6
6
+ metadata.gz: 18700fc8376da5b92903d67b8cd85aed9005b7974d45cb0c3943e63a00c9c79684671e2e320e2e96e9d5cd63c11cf17861407abb3ce24399f3a8eea2b1913484
7
+ data.tar.gz: d56a5be7d5ebddf6663b25c6dbbf95d526d5d05eeb19b1cd8002b38056c391fc1c60cb5e9e4138db6121da2103806c5332c9ba6330e2e727b50fafb384105ba4
@@ -59,6 +59,8 @@ module ForemanMaintain::Scenarios
59
59
  end
60
60
 
61
61
  def compose
62
+ ForemanMaintain.enable_maintenance_module
63
+
62
64
  if check_min_version('foreman', '2.5') || check_min_version('foreman-proxy', '2.5')
63
65
  pkgs_to_update = %w[satellite-maintain rubygem-foreman_maintain]
64
66
  yum_options = req_repos_to_update_pkgs.map do |id|
@@ -9,6 +9,24 @@ module ForemanMaintain::PackageManager
9
9
  true
10
10
  end
11
11
 
12
+ def module_enabled?(name)
13
+ _status, result = info(name)
14
+ result.match?(/Stream.+\[e\].+/)
15
+ end
16
+
17
+ def enable_module(name)
18
+ dnf_action('module enable', name, assumeyes: true)
19
+ end
20
+
21
+ def module_exists?(name)
22
+ status, _result = info(name)
23
+ status == 0
24
+ end
25
+
26
+ def info(name)
27
+ dnf_action('module info', name, with_status: true, assumeyes: true)
28
+ end
29
+
12
30
  private
13
31
 
14
32
  def dnf_action(action, packages, with_status: false, assumeyes: false)
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.1.12'.freeze
2
+ VERSION = '1.1.14'.freeze
3
3
  end
@@ -175,6 +175,9 @@ module ForemanMaintain
175
175
  package_name, command = pkg_and_cmd_name
176
176
 
177
177
  puts "Checking for new version of #{package_name}..."
178
+
179
+ enable_maintenance_module
180
+
178
181
  if ForemanMaintain.package_manager.update_available?(main_package_name)
179
182
  puts "\nUpdating #{package_name} package."
180
183
  ForemanMaintain.package_manager.update(main_package_name, :assumeyes => true)
@@ -185,6 +188,19 @@ module ForemanMaintain
185
188
  puts "Nothing to update, can't find new version of #{package_name}."
186
189
  end
187
190
 
191
+ def enable_maintenance_module
192
+ return unless el? && !el7?
193
+
194
+ maintenance_module = 'satellite-maintenance:el8'
195
+ package_manager = ForemanMaintain.package_manager
196
+
197
+ if package_manager.module_exists?(maintenance_module) &&
198
+ !package_manager.module_enabled?(maintenance_module)
199
+ puts "\nEnabling #{maintenance_module} module"
200
+ package_manager.enable_module(maintenance_module)
201
+ end
202
+ end
203
+
188
204
  def main_package_name
189
205
  'rubygem-foreman_maintain'
190
206
  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.1.12
4
+ version: 1.1.14
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-03-20 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp