beaker_puppet_helpers 1.6.0 → 2.1.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 +4 -4
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +9 -11
- data/CHANGELOG.md +21 -0
- data/beaker_puppet_helpers.gemspec +4 -1
- data/lib/beaker_puppet_helpers/install_utils.rb +70 -12
- metadata +31 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4d4e63615ac64312d0629aa6845bc1b48717317b9279918fbdb41f7f58cbb88
|
4
|
+
data.tar.gz: 38ccbc1d294f2d73616866d06c3d2cbf7101611998180d8ced901b61a98ce680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94c853ad79f8c90f41aa0832db6eadaf75f92584d74412a95e326098d78e6ab4357de513c577e96c364d04138f90286bddd965712a78b9c4f2ab94118fa3b898
|
7
|
+
data.tar.gz: 264e3ce0e6394719acb3146248ea1868bce207499d5e45d6ae065a8134879e90b0af3839cadd57d75d62e493562cdbcc50bba87d08b473408987a7f0046b4410
|
@@ -11,10 +11,10 @@ jobs:
|
|
11
11
|
if: github.repository_owner == 'voxpupuli'
|
12
12
|
steps:
|
13
13
|
- uses: actions/checkout@v4
|
14
|
-
- name: Install Ruby 3.
|
14
|
+
- name: Install Ruby 3.4
|
15
15
|
uses: ruby/setup-ruby@v1
|
16
16
|
with:
|
17
|
-
ruby-version: '3.
|
17
|
+
ruby-version: '3.4'
|
18
18
|
bundler: 'none'
|
19
19
|
- name: Build gem
|
20
20
|
run: gem build --strict --verbose *.gemspec
|
data/.github/workflows/test.yml
CHANGED
@@ -11,30 +11,29 @@ env:
|
|
11
11
|
BUNDLE_WITHOUT: release
|
12
12
|
|
13
13
|
jobs:
|
14
|
-
|
14
|
+
rubocop_and_matrix:
|
15
15
|
runs-on: ubuntu-latest
|
16
|
-
|
16
|
+
outputs:
|
17
|
+
ruby: ${{ steps.ruby.outputs.versions }}
|
17
18
|
steps:
|
18
19
|
- uses: actions/checkout@v4
|
19
20
|
- name: Install Ruby ${{ matrix.ruby }}
|
20
21
|
uses: ruby/setup-ruby@v1
|
21
22
|
with:
|
22
|
-
ruby-version: "3.
|
23
|
+
ruby-version: "3.4"
|
23
24
|
bundler-cache: true
|
24
25
|
- name: Rubocop
|
25
26
|
run: bundle exec rake rubocop
|
27
|
+
- id: ruby
|
28
|
+
uses: voxpupuli/ruby-version@v1
|
26
29
|
|
27
30
|
build:
|
28
|
-
runs-on: ubuntu-
|
31
|
+
runs-on: ubuntu-latest
|
32
|
+
needs: rubocop_and_matrix
|
29
33
|
strategy:
|
30
34
|
fail-fast: false
|
31
35
|
matrix:
|
32
|
-
ruby:
|
33
|
-
- "3.3"
|
34
|
-
- "3.2"
|
35
|
-
- "3.1"
|
36
|
-
- "3.0"
|
37
|
-
- "2.7"
|
36
|
+
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
|
38
37
|
name: Ruby ${{ matrix.ruby }}
|
39
38
|
steps:
|
40
39
|
- uses: actions/checkout@v4
|
@@ -52,7 +51,6 @@ jobs:
|
|
52
51
|
|
53
52
|
tests:
|
54
53
|
needs:
|
55
|
-
- rubocop
|
56
54
|
- build
|
57
55
|
runs-on: ubuntu-latest
|
58
56
|
name: Test suite
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,27 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [2.1.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/2.1.0) (2025-03-19)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/2.0.0...2.1.0)
|
8
|
+
|
9
|
+
**Implemented enhancements:**
|
10
|
+
|
11
|
+
- 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))
|
12
|
+
|
13
|
+
## [2.0.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/2.0.0) (2025-03-18)
|
14
|
+
|
15
|
+
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/1.6.0...2.0.0)
|
16
|
+
|
17
|
+
**Breaking changes:**
|
18
|
+
|
19
|
+
- Drop support for nightly repos [\#57](https://github.com/voxpupuli/beaker_puppet_helpers/pull/57) ([bastelfreak](https://github.com/bastelfreak))
|
20
|
+
|
21
|
+
**Implemented enhancements:**
|
22
|
+
|
23
|
+
- 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))
|
24
|
+
- Implement OpenVox support [\#56](https://github.com/voxpupuli/beaker_puppet_helpers/pull/56) ([bastelfreak](https://github.com/bastelfreak))
|
25
|
+
|
5
26
|
## [1.6.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/1.6.0) (2024-12-11)
|
6
27
|
|
7
28
|
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/1.5.0...1.6.0)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'beaker_puppet_helpers'
|
5
|
-
s.version = '1.
|
5
|
+
s.version = '2.1.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'
|
@@ -18,4 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
# Run time dependencies
|
19
19
|
s.add_dependency 'beaker', '>= 5.8.1', '< 7'
|
20
20
|
s.add_dependency 'puppet-modulebuilder', '>= 0.3', '< 3'
|
21
|
+
# we need to declare both dependencies explicitly on Ruby 3.4+
|
22
|
+
s.add_dependency 'base64', '~> 0.2.0'
|
23
|
+
s.add_dependency 'benchmark', '~> 0.4.0'
|
21
24
|
end
|
@@ -7,16 +7,29 @@ module BeakerPuppetHelpers
|
|
7
7
|
class InstallUtils
|
8
8
|
# @api private
|
9
9
|
REPOS = {
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
openvox: {
|
11
|
+
release: {
|
12
|
+
apt: 'https://apt.voxpupuli.org/',
|
13
|
+
yum: 'https://yum.voxpupuli.org/',
|
14
|
+
},
|
13
15
|
},
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
puppet: {
|
17
|
+
release: {
|
18
|
+
apt: 'https://apt.puppet.com',
|
19
|
+
yum: 'https://yum.puppet.com',
|
20
|
+
},
|
17
21
|
},
|
18
22
|
}.freeze
|
19
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
|
+
collection.gsub(/\d+/, '')
|
31
|
+
end
|
32
|
+
|
20
33
|
# Install official Puppet release repository configuration on host(s).
|
21
34
|
#
|
22
35
|
# @example Install Puppet 7
|
@@ -24,17 +37,18 @@ module BeakerPuppetHelpers
|
|
24
37
|
#
|
25
38
|
# @param [Beaker::Host] host
|
26
39
|
# A host to act upon.
|
40
|
+
#
|
27
41
|
# @param [String] collection
|
28
42
|
# The collection to install. The default (puppet) is the latest
|
29
|
-
# available version.
|
30
|
-
#
|
31
|
-
# Whether to install nightly or release packages
|
43
|
+
# available version. Can also be openvox7, puppet8 and others.
|
44
|
+
# Method is called from beaker_install_helpers
|
32
45
|
#
|
33
46
|
# @note This method only works on redhat-like and debian-like hosts. There
|
34
47
|
# are no official Puppet releases for other platforms.
|
35
48
|
#
|
36
|
-
def self.install_puppet_release_repo_on(host, collection = 'puppet'
|
37
|
-
|
49
|
+
def self.install_puppet_release_repo_on(host, collection = 'puppet')
|
50
|
+
implementation = implementation_from_collection(collection)
|
51
|
+
repos = REPOS[implementation.to_sym][:release]
|
38
52
|
|
39
53
|
variant, version, _arch = host['packaging_platform'].split('-', 3)
|
40
54
|
|
@@ -56,7 +70,8 @@ module BeakerPuppetHelpers
|
|
56
70
|
url = "#{repos[:yum]}/#{collection}-release-#{variant}-#{version}.noarch.rpm"
|
57
71
|
host.install_package(url)
|
58
72
|
when 'debian', 'ubuntu'
|
59
|
-
|
73
|
+
relname = (implementation == 'openvox') ? "#{variant}#{version}" : host['platform'].codename
|
74
|
+
url = "#{repos[:apt]}/#{collection}-release-#{relname}.deb"
|
60
75
|
wget_on(host, url) do |filename|
|
61
76
|
host.install_package(filename)
|
62
77
|
end
|
@@ -69,6 +84,42 @@ module BeakerPuppetHelpers
|
|
69
84
|
end
|
70
85
|
end
|
71
86
|
|
87
|
+
# Determine the correct package name, based on implementation, AIO and OS
|
88
|
+
#
|
89
|
+
# @param [Beaker::Host] host
|
90
|
+
# The host to act on
|
91
|
+
# @param [Boolean] prefer_aio
|
92
|
+
# Whether to prefer AIO packages or OS packages
|
93
|
+
# @param [String] implementation
|
94
|
+
# If we are on OpenVox or Perforce
|
95
|
+
# @return [String] the package name
|
96
|
+
def self.package_name(host, prefer_aio: true, implementation: 'openvox')
|
97
|
+
case implementation
|
98
|
+
when 'openvox'
|
99
|
+
openvox_package_name
|
100
|
+
when 'puppet'
|
101
|
+
puppet_package_name(host, prefer_aio: prefer_aio)
|
102
|
+
when 'none'
|
103
|
+
'puppet'
|
104
|
+
else
|
105
|
+
raise StandardError, "Unknown requirement '#{implementation}'"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# Determine if we need the Perforce or OpenVox Package, based on the collection
|
110
|
+
#
|
111
|
+
# @param [Beaker::Host] host
|
112
|
+
# The host to act on
|
113
|
+
# @param collection
|
114
|
+
# The used collection (puppet7, openvox8...)
|
115
|
+
# @param [Boolean] prefer_aio
|
116
|
+
# Whether to prefer AIO packages or OS packages
|
117
|
+
# @return [String] the package name
|
118
|
+
def self.collection2packagename(host, collection, prefer_aio: true)
|
119
|
+
implementation = implementation_from_collection(collection)
|
120
|
+
package_name(host, prefer_aio: prefer_aio, implementation: implementation)
|
121
|
+
end
|
122
|
+
|
72
123
|
# Determine the Puppet package name
|
73
124
|
#
|
74
125
|
# @param [Beaker::Host] host
|
@@ -93,6 +144,13 @@ module BeakerPuppetHelpers
|
|
93
144
|
end
|
94
145
|
end
|
95
146
|
|
147
|
+
# Determine the openvox package name
|
148
|
+
#
|
149
|
+
# @return [String] The openvox package name
|
150
|
+
def self.openvox_package_name
|
151
|
+
'openvox-agent'
|
152
|
+
end
|
153
|
+
|
96
154
|
# @param [Beaker::Host] host
|
97
155
|
# The host to act on
|
98
156
|
# @api private
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker_puppet_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-19 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: beaker
|
@@ -50,6 +49,34 @@ dependencies:
|
|
50
49
|
- - "<"
|
51
50
|
- !ruby/object:Gem::Version
|
52
51
|
version: '3'
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: base64
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - "~>"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: 0.2.0
|
59
|
+
type: :runtime
|
60
|
+
prerelease: false
|
61
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - "~>"
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.2.0
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: benchmark
|
68
|
+
requirement: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 0.4.0
|
73
|
+
type: :runtime
|
74
|
+
prerelease: false
|
75
|
+
version_requirements: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - "~>"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 0.4.0
|
53
80
|
description: For use for the Beaker acceptance testing tool
|
54
81
|
email:
|
55
82
|
- voxpupuli@groups.io
|
@@ -85,7 +112,6 @@ homepage: https://github.com/voxpupuli/beaker_puppet_helpers
|
|
85
112
|
licenses:
|
86
113
|
- Apache-2.0
|
87
114
|
metadata: {}
|
88
|
-
post_install_message:
|
89
115
|
rdoc_options: []
|
90
116
|
require_paths:
|
91
117
|
- lib
|
@@ -103,8 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
129
|
- !ruby/object:Gem::Version
|
104
130
|
version: '0'
|
105
131
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
107
|
-
signing_key:
|
132
|
+
rubygems_version: 3.6.2
|
108
133
|
specification_version: 4
|
109
134
|
summary: Beaker's Puppet DSL Extension Helpers
|
110
135
|
test_files: []
|