beaker_puppet_helpers 2.0.0 → 2.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d218d5ad4ee763da0b629fbadedb93ca724a100c73ee6439d5421bbc1f94eadb
4
- data.tar.gz: 1339a28edb3a3208823b1eef7b4e347c027fcc5a8343219db2144a9bac643036
3
+ metadata.gz: 96b07dc57cf6ef1d1321846d99f810b208ec187cae8fcbb9f9671a7cb00684d5
4
+ data.tar.gz: 71d45ebf93c52dd19cf097d828487148190ffe249a52ba44fdf0b369642d9347
5
5
  SHA512:
6
- metadata.gz: f8176a75aa669f7cd620c16c7f350b8483fb601307a431edd9806fe16668254fa3eda110038c56922f1e84d30c83df2c7238fd285cc565eece7bda6ee8ac2d7d
7
- data.tar.gz: 468e019343afc503d231d5cbce64786d4b94568547b8b73a2373e42a4d6a88f4e478a9f3637b4c5638ce0a742721fd648ab408485a19619e5d58657cd0b1c84b
6
+ metadata.gz: d2a513bb98b4908fa0563adc2afd8d1e187db0f3ae79de0871a62a5d4db13c35fe5ee8c792a5f8f14c3c3eb6104c4ed6c47e175b8318097359dfbc2293ebeb8c
7
+ data.tar.gz: cb55fb6ce9dc07741e88b30ea2e3497a24ecc1c5f34c31850609923b505f0d70c1cac195716489154ffbc6b5584f4fb949d4fa0a1e53f4f317f2c48b28108bf1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.2.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/2.2.0) (2025-03-19)
6
+
7
+ [Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/2.1.0...2.2.0)
8
+
9
+ **Implemented enhancements:**
10
+
11
+ - Support the none collection in implementation helpers [\#62](https://github.com/voxpupuli/beaker_puppet_helpers/pull/62) ([ekohl](https://github.com/ekohl))
12
+
13
+ ## [2.1.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/2.1.0) (2025-03-19)
14
+
15
+ [Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/2.0.0...2.1.0)
16
+
17
+ **Implemented enhancements:**
18
+
19
+ - Add helper to get agent package name based on collection [\#60](https://github.com/voxpupuli/beaker_puppet_helpers/pull/60) ([bastelfreak](https://github.com/bastelfreak))
20
+
5
21
  ## [2.0.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/2.0.0) (2025-03-18)
6
22
 
7
23
  [Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/1.6.0...2.0.0)
@@ -12,8 +28,8 @@ All notable changes to this project will be documented in this file.
12
28
 
13
29
  **Implemented enhancements:**
14
30
 
15
- - Implement OpenVox support [\#56](https://github.com/voxpupuli/beaker_puppet_helpers/pull/56) ([bastelfreak](https://github.com/bastelfreak))
16
31
  - CI: Use voxpupuli/ruby-version@v1 / Add Ruby 3.4 support [\#58](https://github.com/voxpupuli/beaker_puppet_helpers/pull/58) ([bastelfreak](https://github.com/bastelfreak))
32
+ - Implement OpenVox support [\#56](https://github.com/voxpupuli/beaker_puppet_helpers/pull/56) ([bastelfreak](https://github.com/bastelfreak))
17
33
 
18
34
  ## [1.6.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/1.6.0) (2024-12-11)
19
35
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'beaker_puppet_helpers'
5
- s.version = '2.0.0'
5
+ s.version = '2.2.0'
6
6
  s.authors = ['Vox Pupuli']
7
7
  s.email = ['voxpupuli@groups.io']
8
8
  s.homepage = 'https://github.com/voxpupuli/beaker_puppet_helpers'
@@ -21,6 +21,19 @@ module BeakerPuppetHelpers
21
21
  },
22
22
  }.freeze
23
23
 
24
+ # returns the used implementation (puppet or openvox)
25
+ #
26
+ # @param [String] collection
27
+ # The used collection (puppet7, openvox8...)
28
+ # @return [String] the implementation
29
+ def self.implementation_from_collection(collection)
30
+ if collection == 'none'
31
+ 'puppet'
32
+ else
33
+ collection.gsub(/\d+/, '')
34
+ end
35
+ end
36
+
24
37
  # Install official Puppet release repository configuration on host(s).
25
38
  #
26
39
  # @example Install Puppet 7
@@ -38,8 +51,8 @@ module BeakerPuppetHelpers
38
51
  # are no official Puppet releases for other platforms.
39
52
  #
40
53
  def self.install_puppet_release_repo_on(host, collection = 'puppet')
41
- requirement_name = collection.gsub(/\d+/, '')
42
- repos = REPOS[requirement_name.to_sym][:release]
54
+ implementation = implementation_from_collection(collection)
55
+ repos = REPOS[implementation.to_sym][:release]
43
56
 
44
57
  variant, version, _arch = host['packaging_platform'].split('-', 3)
45
58
 
@@ -61,7 +74,7 @@ module BeakerPuppetHelpers
61
74
  url = "#{repos[:yum]}/#{collection}-release-#{variant}-#{version}.noarch.rpm"
62
75
  host.install_package(url)
63
76
  when 'debian', 'ubuntu'
64
- relname = (requirement_name == 'openvox') ? "#{variant}#{version}" : host['platform'].codename
77
+ relname = (implementation == 'openvox') ? "#{variant}#{version}" : host['platform'].codename
65
78
  url = "#{repos[:apt]}/#{collection}-release-#{relname}.deb"
66
79
  wget_on(host, url) do |filename|
67
80
  host.install_package(filename)
@@ -75,13 +88,13 @@ module BeakerPuppetHelpers
75
88
  end
76
89
  end
77
90
 
78
- # Determine if we need the Perforce or OpenVox Package name
91
+ # Determine the correct package name, based on implementation, AIO and OS
79
92
  #
80
93
  # @param [Beaker::Host] host
81
94
  # The host to act on
82
95
  # @param [Boolean] prefer_aio
83
96
  # Whether to prefer AIO packages or OS packages
84
- # @param implementation
97
+ # @param [String] implementation
85
98
  # If we are on OpenVox or Perforce
86
99
  # @return [String] the package name
87
100
  def self.package_name(host, prefer_aio: true, implementation: 'openvox')
@@ -97,6 +110,23 @@ module BeakerPuppetHelpers
97
110
  end
98
111
  end
99
112
 
113
+ # Determine if we need the Perforce or OpenVox Package, based on the collection
114
+ #
115
+ # @param [Beaker::Host] host
116
+ # The host to act on
117
+ # @param collection
118
+ # The used collection (none, puppet7, openvox8, ...)
119
+ # @param [Optional[Boolean]] prefer_aio
120
+ # Whether to prefer AIO packages or OS packages. If not specified, it's
121
+ # derived from the collection
122
+ # @return [String] the package name
123
+ def self.collection2packagename(host, collection, prefer_aio: nil)
124
+ prefer_aio = collection != 'none' if prefer_aio.nil?
125
+
126
+ implementation = implementation_from_collection(collection)
127
+ package_name(host, prefer_aio: prefer_aio, implementation: implementation)
128
+ end
129
+
100
130
  # Determine the Puppet package name
101
131
  #
102
132
  # @param [Beaker::Host] host
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker_puppet_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-18 00:00:00.000000000 Z
10
+ date: 2025-03-19 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: beaker