beaker_puppet_helpers 1.1.1 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +2 -2
- data/CHANGELOG.md +17 -1
- data/Rakefile +2 -2
- data/beaker_puppet_helpers.gemspec +1 -1
- data/lib/beaker_puppet_helpers/install_utils.rb +8 -2
- data/lib/beaker_puppet_helpers/module_utils.rb +4 -3
- data/spec/beaker_puppet_helpers/module_utils_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecec587a641c9175b474f3f5862cce202097db3a13c6085e96e38b5795dbb42a
|
4
|
+
data.tar.gz: 0cda17558b4ccfd995d8747158460a7e9793739b1601bbc14a3265057445a3a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69df43481f5173128fffc205b27a9a7b91b73bc707986092b7626065e3072c1601b89addb7e8223417ecefbbc5525397a28d44dda4a60bf60c833c29a75e95cc
|
7
|
+
data.tar.gz: 76b71365c7c9821195f7e6c94b49924dc0a84612173fad6d2f057c86b952c1a6483e5bfe1d804aa6464408407fe47f87e7cc25041b2cdc0f88619772ba5495a6
|
data/.github/workflows/test.yml
CHANGED
@@ -15,7 +15,7 @@ jobs:
|
|
15
15
|
runs-on: ubuntu-latest
|
16
16
|
name: Rubocop
|
17
17
|
steps:
|
18
|
-
- uses: actions/checkout@
|
18
|
+
- uses: actions/checkout@v4
|
19
19
|
- name: Install Ruby ${{ matrix.ruby }}
|
20
20
|
uses: ruby/setup-ruby@v1
|
21
21
|
with:
|
@@ -36,7 +36,7 @@ jobs:
|
|
36
36
|
- "2.7"
|
37
37
|
name: Ruby ${{ matrix.ruby }}
|
38
38
|
steps:
|
39
|
-
- uses: actions/checkout@
|
39
|
+
- uses: actions/checkout@v4
|
40
40
|
- name: Install Ruby ${{ matrix.ruby }}
|
41
41
|
uses: ruby/setup-ruby@v1
|
42
42
|
with:
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,23 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [1.2.1](https://github.com/voxpupuli/beaker_puppet_helpers/tree/1.2.1) (2024-01-08)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/1.2.0...1.2.1)
|
8
|
+
|
9
|
+
**Fixed bugs:**
|
10
|
+
|
11
|
+
- shell escape Puppet command options [\#40](https://github.com/voxpupuli/beaker_puppet_helpers/pull/40) ([ekohl](https://github.com/ekohl))
|
12
|
+
- FreeBSD has the Puppet major version in the package name [\#39](https://github.com/voxpupuli/beaker_puppet_helpers/pull/39) ([evgeni](https://github.com/evgeni))
|
13
|
+
|
14
|
+
## [1.2.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/1.2.0) (2023-10-17)
|
15
|
+
|
16
|
+
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/1.1.1...1.2.0)
|
17
|
+
|
18
|
+
**Implemented enhancements:**
|
19
|
+
|
20
|
+
- Always use puppet-agent for Debian 12+ & Ubuntu 23.04+ [\#37](https://github.com/voxpupuli/beaker_puppet_helpers/pull/37) ([ekohl](https://github.com/ekohl))
|
21
|
+
|
5
22
|
## [1.1.1](https://github.com/voxpupuli/beaker_puppet_helpers/tree/1.1.1) (2023-06-16)
|
6
23
|
|
7
24
|
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/1.1.0...1.1.1)
|
@@ -54,7 +71,6 @@ All notable changes to this project will be documented in this file.
|
|
54
71
|
- Fix various RSpec cops before enabling rubocop-rspec [\#13](https://github.com/voxpupuli/beaker_puppet_helpers/pull/13) ([ekohl](https://github.com/ekohl))
|
55
72
|
- Drop Ruby 2.5 and 2.6 support [\#12](https://github.com/voxpupuli/beaker_puppet_helpers/pull/12) ([ekohl](https://github.com/ekohl))
|
56
73
|
- Make RuboCop mostly happy [\#11](https://github.com/voxpupuli/beaker_puppet_helpers/pull/11) ([ekohl](https://github.com/ekohl))
|
57
|
-
- Bump actions/checkout from 2 to 3 [\#10](https://github.com/voxpupuli/beaker_puppet_helpers/pull/10) ([dependabot[bot]](https://github.com/apps/dependabot))
|
58
74
|
- Simplify variable setting [\#9](https://github.com/voxpupuli/beaker_puppet_helpers/pull/9) ([ekohl](https://github.com/ekohl))
|
59
75
|
- Use rubocop config from voxpupuli-rubocop [\#6](https://github.com/voxpupuli/beaker_puppet_helpers/pull/6) ([bastelfreak](https://github.com/bastelfreak))
|
60
76
|
- dependabot: check for github actions and gems [\#5](https://github.com/voxpupuli/beaker_puppet_helpers/pull/5) ([bastelfreak](https://github.com/bastelfreak))
|
data/Rakefile
CHANGED
@@ -35,7 +35,7 @@ DESC
|
|
35
35
|
task :acceptance do
|
36
36
|
hosts = {
|
37
37
|
aio: %w[centos7 centos8 debian10 debian11],
|
38
|
-
foss: %w[debian10 debian11],
|
38
|
+
foss: %w[debian10 debian11 debian12 fedora37 fedora38],
|
39
39
|
}
|
40
40
|
default_hosts = hosts.map { |type, h| h.map { |host| "#{host}-64{type=#{type}}" }.join('-') }.join('-')
|
41
41
|
hosts = ENV['BEAKER_HOSTS'] || default_hosts
|
@@ -66,7 +66,7 @@ rescue LoadError
|
|
66
66
|
else
|
67
67
|
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
68
68
|
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
|
69
|
-
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog]
|
69
|
+
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog github_actions]
|
70
70
|
config.user = 'voxpupuli'
|
71
71
|
config.project = 'beaker_puppet_helpers'
|
72
72
|
config.future_release = Gem::Specification.load("#{config.project}.gemspec").version.to_s
|
@@ -78,10 +78,16 @@ module BeakerPuppetHelpers
|
|
78
78
|
# @return [String] The Puppet package name
|
79
79
|
def self.puppet_package_name(host, prefer_aio: true)
|
80
80
|
case host['packaging_platform'].split('-', 3).first
|
81
|
-
when
|
81
|
+
when 'debian'
|
82
|
+
# 12 started to ship puppet-agent with puppet as a legacy package
|
83
|
+
prefer_aio || host['packaging_platform'].split('-', 3)[1].to_i >= 12 ? 'puppet-agent' : 'puppet'
|
84
|
+
when /el|fedora|sles|cisco_/
|
82
85
|
prefer_aio ? 'puppet-agent' : 'puppet'
|
83
86
|
when /freebsd/
|
84
|
-
'sysutils/
|
87
|
+
'sysutils/puppet8'
|
88
|
+
when 'ubuntu'
|
89
|
+
# 23.04 started to ship puppet-agent with puppet as a legacy package
|
90
|
+
prefer_aio || host['packaging_platform'].split('-', 3)[1].to_i >= 2304 ? 'puppet-agent' : 'puppet'
|
85
91
|
else
|
86
92
|
'puppet'
|
87
93
|
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'shellwords'
|
3
4
|
require 'beaker/command'
|
4
5
|
require 'puppet/modulebuilder'
|
5
6
|
|
6
7
|
module BeakerPuppetHelpers
|
7
8
|
# Methods to help install puppet modules
|
8
9
|
module ModuleUtils
|
9
|
-
# Install the desired module with the PMT on a given host
|
10
|
+
# Install the desired module with the Puppet Module Tool (PMT) on a given host
|
10
11
|
#
|
11
12
|
# @param [Beaker::Host, Array<Beaker::Host>, String, Symbol] hosts
|
12
13
|
# One or more hosts to act upon, or a role (String or Symbol) that
|
@@ -21,8 +22,8 @@ module BeakerPuppetHelpers
|
|
21
22
|
block_on hosts do |host|
|
22
23
|
puppet_opts = {}
|
23
24
|
puppet_opts.merge!(host[:default_module_install_opts]) if host[:default_module_install_opts]
|
24
|
-
puppet_opts[:version] = version if version
|
25
|
-
puppet_opts[:module_repository] = module_repository if module_repository
|
25
|
+
puppet_opts[:version] = Shellwords.escape(version) if version
|
26
|
+
puppet_opts[:module_repository] = Shellwords.escape(module_repository) if module_repository
|
26
27
|
|
27
28
|
on host, Beaker::PuppetCommand.new('module', ['install', module_name], puppet_opts)
|
28
29
|
end
|
@@ -37,6 +37,13 @@ describe BeakerPuppetHelpers::ModuleUtils do
|
|
37
37
|
dsl.install_puppet_module_via_pmt_on(host, 'test', '1.2.3')
|
38
38
|
end
|
39
39
|
|
40
|
+
it 'escapes the version parameter' do
|
41
|
+
expect(Beaker::PuppetCommand).to receive(:new).with('module', %w[install test], { version: '\\>\\=\\ 4.0\\ \\<\\ 6.0' }).once
|
42
|
+
expect(dsl).to receive(:on).with(host, anything).once
|
43
|
+
|
44
|
+
dsl.install_puppet_module_via_pmt_on(host, 'test', '>= 4.0 < 6.0')
|
45
|
+
end
|
46
|
+
|
40
47
|
it 'accepts the module_repository parameter' do
|
41
48
|
expect(Beaker::PuppetCommand).to receive(:new).with('module', %w[install test], { module_repository: 'http://forge.example.com' }).once
|
42
49
|
expect(dsl).to receive(:on).with(host, anything).once
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker_puppet_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: beaker
|