beaker_puppet_helpers 1.2.0 → 1.3.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 +2 -1
- data/CHANGELOG.md +18 -0
- data/beaker_puppet_helpers.gemspec +1 -1
- data/lib/beaker_puppet_helpers/dsl.rb +25 -0
- data/lib/beaker_puppet_helpers/install_utils.rb +1 -1
- data/lib/beaker_puppet_helpers/module_utils.rb +3 -2
- data/spec/beaker_puppet_helpers/module_utils_spec.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 860333658bb4763948199ffd7f44aa8d63f91f82e1433237e173646a7f846946
|
4
|
+
data.tar.gz: ab16c43125a9ad5a07bd3f84e0e48897fb759b0a79c2be4af36601126dd09942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e80f94672298bb94adf4aea463aa2dcfa0271d36a6e6e9916964cac8ba0944229888b7bf5c2cc9be42829ef19df8829caf28e1b3dd8dd0060f999d12be077de
|
7
|
+
data.tar.gz: 0360e4c00279e81aa205ca1933fbaa00288d3dc549b0f97ef247fd2990994cb5b2b9fadb73d6b7f531becf918ded29d6641a5bc4d55aed4807c10e51cb779f05
|
@@ -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.3
|
15
15
|
uses: ruby/setup-ruby@v1
|
16
16
|
with:
|
17
|
-
ruby-version: '3.
|
17
|
+
ruby-version: '3.3'
|
18
18
|
bundler: 'none'
|
19
19
|
- name: Build gem
|
20
20
|
run: gem build --strict --verbose *.gemspec
|
data/.github/workflows/test.yml
CHANGED
@@ -19,7 +19,7 @@ jobs:
|
|
19
19
|
- name: Install Ruby ${{ matrix.ruby }}
|
20
20
|
uses: ruby/setup-ruby@v1
|
21
21
|
with:
|
22
|
-
ruby-version: "3.
|
22
|
+
ruby-version: "3.3"
|
23
23
|
bundler-cache: true
|
24
24
|
- name: Rubocop
|
25
25
|
run: bundle exec rake rubocop
|
@@ -30,6 +30,7 @@ jobs:
|
|
30
30
|
fail-fast: false
|
31
31
|
matrix:
|
32
32
|
ruby:
|
33
|
+
- "3.3"
|
33
34
|
- "3.2"
|
34
35
|
- "3.1"
|
35
36
|
- "3.0"
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,24 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [1.3.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/1.3.0) (2024-05-02)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/1.2.1...1.3.0)
|
8
|
+
|
9
|
+
**Implemented enhancements:**
|
10
|
+
|
11
|
+
- Add Ruby 3.3 to CI [\#44](https://github.com/voxpupuli/beaker_puppet_helpers/pull/44) ([traylenator](https://github.com/traylenator))
|
12
|
+
- New beaker helper `bolt_supported?` to show bolt availability [\#42](https://github.com/voxpupuli/beaker_puppet_helpers/pull/42) ([traylenator](https://github.com/traylenator))
|
13
|
+
|
14
|
+
## [1.2.1](https://github.com/voxpupuli/beaker_puppet_helpers/tree/1.2.1) (2024-01-08)
|
15
|
+
|
16
|
+
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/1.2.0...1.2.1)
|
17
|
+
|
18
|
+
**Fixed bugs:**
|
19
|
+
|
20
|
+
- shell escape Puppet command options [\#40](https://github.com/voxpupuli/beaker_puppet_helpers/pull/40) ([ekohl](https://github.com/ekohl))
|
21
|
+
- 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))
|
22
|
+
|
5
23
|
## [1.2.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/1.2.0) (2023-10-17)
|
6
24
|
|
7
25
|
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/1.1.1...1.2.0)
|
@@ -224,5 +224,30 @@ module BeakerPuppetHelpers
|
|
224
224
|
def fact(name, opts = {})
|
225
225
|
fact_on(default, name, opts)
|
226
226
|
end
|
227
|
+
|
228
|
+
# Show if bolt package is available
|
229
|
+
#
|
230
|
+
# @param [Beaker::Host] host
|
231
|
+
# @return True if package is available.
|
232
|
+
#
|
233
|
+
def bolt_supported?(host = default)
|
234
|
+
#
|
235
|
+
# Supported platforms
|
236
|
+
# https://github.com/puppetlabs/bolt/blob/main/documentation/bolt_installing.md
|
237
|
+
# https://github.com/puppetlabs/bolt-vanagon/tree/main/configs/platforms
|
238
|
+
|
239
|
+
case host['packaging_platform'].split('-', 3)[0, 1]
|
240
|
+
when %w[el 7], %w[el 8], %w[el 9],
|
241
|
+
%w[debian 10], %w[debian 11],
|
242
|
+
['ubuntu', '20.04'], ['ubuntu', '22.04'],
|
243
|
+
%w[osx 11], %w[osx 12],
|
244
|
+
%w[sles 12], %w[sles 15],
|
245
|
+
%w[fedora 36],
|
246
|
+
%w[windows 2012r2]
|
247
|
+
true
|
248
|
+
else
|
249
|
+
false
|
250
|
+
end
|
251
|
+
end
|
227
252
|
end
|
228
253
|
end
|
@@ -84,7 +84,7 @@ module BeakerPuppetHelpers
|
|
84
84
|
when /el|fedora|sles|cisco_/
|
85
85
|
prefer_aio ? 'puppet-agent' : 'puppet'
|
86
86
|
when /freebsd/
|
87
|
-
'sysutils/
|
87
|
+
'sysutils/puppet8'
|
88
88
|
when 'ubuntu'
|
89
89
|
# 23.04 started to ship puppet-agent with puppet as a legacy package
|
90
90
|
prefer_aio || host['packaging_platform'].split('-', 3)[1].to_i >= 2304 ? 'puppet-agent' : 'puppet'
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'shellwords'
|
3
4
|
require 'beaker/command'
|
4
5
|
require 'puppet/modulebuilder'
|
5
6
|
|
@@ -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.3.0
|
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-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: beaker
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.5.9
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Beaker's Puppet DSL Extension Helpers
|