foreman_maintain 1.6.0 → 1.6.1

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: 86d36d447cf87e6f991443352eb5fb9cfdc2b43b634b382c7564f5b86f7e70d1
4
- data.tar.gz: 3811b68a80511a95cb5a67b9c8176f623f840ab500e1986b31cd8eac488378ee
3
+ metadata.gz: 548814bfe86ff4c1e83329ac60bbbf5b9502f6cc77c258d82cb7fa5777a00fdf
4
+ data.tar.gz: c16c7ee88083f281e69cedbe605990c9e3b54e5e15f3ba4aaa0b3e3b1d5acc10
5
5
  SHA512:
6
- metadata.gz: df3b536d2f6b89e478fb0355f4f5fbf7049f4d9195dd11c15c46133d341e1d5bd4fd14aabebd35f2b5dd92d341159e5fd8a15a7ddf7ab1f7f9241b3498fe1fe1
7
- data.tar.gz: 0c6f8a11f9955900d30c771866ffbeb49ed6bb6c5432fe3575ecef0069d7b76db0099b6a2e37b01adc600013996a46e12d1ffd72986f882cd09b8d9b4cbc5bae
6
+ metadata.gz: e37f22cb90fcd75430b186cb468dc58c7d625c52ec104427119f6e88d1f6d511d98dbedbfff1c9293abd29816156e936d3bb70ada7c21cfb4c1cdca61f2d255e
7
+ data.tar.gz: 236e8c299154a4d132506995933f30d8f11ccaf1fdba5756844bc5d9b978d0ce7bd1fa65a2fe5d51abd9e2925e54bf634c083897b1ef14d410e38f4d54ad032e
@@ -3,14 +3,14 @@ module Procedures::Packages
3
3
  metadata do
4
4
  description 'Enable the given stream modules'
5
5
  confine do
6
- package_manager.instance_of?(ForemanMaintain::PackageManager::Dnf)
6
+ package_manager.modules_supported?
7
7
  end
8
8
  param :module_names, 'Module names', :array => true, :required => true
9
9
  advanced_run false
10
10
  end
11
11
 
12
12
  def run
13
- execute!("dnf module enable #{@module_names.join(' ')} -y")
13
+ package_manager.enable_module(@module_names.join(' '))
14
14
  end
15
15
  end
16
16
  end
@@ -0,0 +1,16 @@
1
+ module Procedures::Packages
2
+ class SwitchModules < ForemanMaintain::Procedure
3
+ metadata do
4
+ description 'Switch the given stream modules'
5
+ confine do
6
+ package_manager.modules_supported?
7
+ end
8
+ param :module_names, 'Module names', :array => true, :required => true
9
+ advanced_run false
10
+ end
11
+
12
+ def run
13
+ package_manager.switch_module(@module_names.join(' '))
14
+ end
15
+ end
16
+ end
@@ -41,6 +41,8 @@ module Scenarios::Capsule_6_16
41
41
  def compose
42
42
  add_step(Procedures::Repositories::Setup.new(:version => '6.16'))
43
43
  if el8?
44
+ modules_to_switch = ['postgresql:13']
45
+ add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
44
46
  modules_to_enable = ["satellite-capsule:#{el_short_name}"]
45
47
  add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
46
48
  end
@@ -53,6 +53,8 @@ module Scenarios::Foreman_Nightly
53
53
  def compose
54
54
  add_step(Procedures::Repositories::Setup.new(:version => 'nightly'))
55
55
  if el8?
56
+ modules_to_switch = ['postgresql:13']
57
+ add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
56
58
  modules_to_enable = ["foreman:#{el_short_name}"]
57
59
  add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
58
60
  end
@@ -53,6 +53,8 @@ module Scenarios::Katello_Nightly
53
53
  def compose
54
54
  add_step(Procedures::Repositories::Setup.new(:version => 'nightly'))
55
55
  if el8?
56
+ modules_to_switch = ['postgresql:13']
57
+ add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
56
58
  modules_to_enable = ["katello:#{el_short_name}", "pulpcore:#{el_short_name}"]
57
59
  add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
58
60
  end
@@ -41,6 +41,8 @@ module Scenarios::Satellite_6_16
41
41
  def compose
42
42
  add_step(Procedures::Repositories::Setup.new(:version => '6.16'))
43
43
  if el8?
44
+ modules_to_switch = ['postgresql:13']
45
+ add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
44
46
  modules_to_enable = ["satellite:#{el_short_name}"]
45
47
  add_step(Procedures::Packages::EnableModules.new(:module_names => modules_to_enable))
46
48
  end
@@ -55,6 +55,11 @@ module ForemanMaintain::PackageManager
55
55
  raise NotImplementedError
56
56
  end
57
57
 
58
+ # confirms that Package Manager supports modules
59
+ def modules_supported?
60
+ false
61
+ end
62
+
58
63
  private
59
64
 
60
65
  def sys
@@ -95,6 +95,10 @@ module ForemanMaintain::PackageManager
95
95
  dnf_action('clean', 'metadata', :assumeyes => assumeyes)
96
96
  end
97
97
 
98
+ def modules_supported?
99
+ true
100
+ end
101
+
98
102
  def module_enabled?(name)
99
103
  _status, result = info(name)
100
104
  result.match?(/Stream.+\[e\].+/)
@@ -104,6 +108,10 @@ module ForemanMaintain::PackageManager
104
108
  dnf_action('module enable', name, assumeyes: true)
105
109
  end
106
110
 
111
+ def switch_module(name)
112
+ dnf_action('module switch-to', name, assumeyes: true)
113
+ end
114
+
107
115
  def module_exists?(name)
108
116
  status, _result = info(name)
109
117
  status == 0
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.6.0'.freeze
2
+ VERSION = '1.6.1'.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.6.0
4
+ version: 1.6.1
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: 2024-03-13 00:00:00.000000000 Z
11
+ date: 2024-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -268,6 +268,7 @@ files:
268
268
  - definitions/procedures/packages/installer_confirmation.rb
269
269
  - definitions/procedures/packages/lock_versions.rb
270
270
  - definitions/procedures/packages/locking_status.rb
271
+ - definitions/procedures/packages/switch_modules.rb
271
272
  - definitions/procedures/packages/uninstall.rb
272
273
  - definitions/procedures/packages/unlock_versions.rb
273
274
  - definitions/procedures/packages/update.rb