beaker-puppet 1.22.1 → 1.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -0
- data/CHANGELOG.md +35 -0
- data/beaker-puppet.gemspec +3 -1
- data/lib/beaker-puppet/install_utils/foss_utils.rb +25 -15
- data/lib/beaker-puppet/install_utils/module_utils.rb +2 -2
- data/lib/beaker-puppet/version.rb +1 -1
- data/spec/beaker-puppet/helpers/puppet_helpers_spec.rb +19 -19
- data/spec/beaker-puppet/install_utils/foss_utils_spec.rb +2 -2
- data/spec/beaker-puppet/install_utils/windows_utils_spec.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5557cad6a494d24bd383c9583db5ce43546677ede516270f1c8c390a2951951b
|
4
|
+
data.tar.gz: c0d92915ae1b5bcc059e4728a2699d3eac446de1c141fdc5487a553e34e3e89e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81f04cba47d505b66eed94d1fdd9fb80bbe1d11d4d18b55edf238815405d8d030b0e6506ad44af2f523664f7d0a468fc635ec9a6cda99fc1b653962c1d30f551
|
7
|
+
data.tar.gz: 5e691ffcaf6d56e408ee6be5acf025d1ae5605d1c5081fb9d095c948aa1968a9d67172d311932407567f6cd3b534b8267f19822606c3195d4bac17daa03af2bc
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,41 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [1.24.0](https://github.com/voxpupuli/beaker-puppet/tree/1.24.0) (2022-03-04)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.23.0...1.24.0)
|
8
|
+
|
9
|
+
**Implemented enhancements:**
|
10
|
+
|
11
|
+
- module setup on the target: Igrore files at the root level only [\#177](https://github.com/voxpupuli/beaker-puppet/pull/177) ([smortex](https://github.com/smortex))
|
12
|
+
|
13
|
+
**Merged pull requests:**
|
14
|
+
|
15
|
+
- gemspec: fix typo in Apache-2.0 license [\#180](https://github.com/voxpupuli/beaker-puppet/pull/180) ([bastelfreak](https://github.com/bastelfreak))
|
16
|
+
- Add Ruby 3.1 to CI [\#179](https://github.com/voxpupuli/beaker-puppet/pull/179) ([bastelfreak](https://github.com/bastelfreak))
|
17
|
+
- Depend on Ruby 2.4 or newer in gemspec [\#178](https://github.com/voxpupuli/beaker-puppet/pull/178) ([bastelfreak](https://github.com/bastelfreak))
|
18
|
+
|
19
|
+
## [1.23.0](https://github.com/voxpupuli/beaker-puppet/tree/1.23.0) (2022-02-23)
|
20
|
+
|
21
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.22.2...1.23.0)
|
22
|
+
|
23
|
+
**Implemented enhancements:**
|
24
|
+
|
25
|
+
- \(maint\) Follow redirects when curling MSI [\#176](https://github.com/voxpupuli/beaker-puppet/pull/176) ([joshcooper](https://github.com/joshcooper))
|
26
|
+
- Update agent download from URL logic to handle redirects [\#173](https://github.com/voxpupuli/beaker-puppet/pull/173) ([cthorn42](https://github.com/cthorn42))
|
27
|
+
|
28
|
+
**Merged pull requests:**
|
29
|
+
|
30
|
+
- Update specs to fix ruby 3 spec failures [\#174](https://github.com/voxpupuli/beaker-puppet/pull/174) ([cthorn42](https://github.com/cthorn42))
|
31
|
+
|
32
|
+
## [1.22.2](https://github.com/voxpupuli/beaker-puppet/tree/1.22.2) (2021-12-31)
|
33
|
+
|
34
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.22.1...1.22.2)
|
35
|
+
|
36
|
+
**Merged pull requests:**
|
37
|
+
|
38
|
+
- Fix install\_puppet\_on on el8 [\#170](https://github.com/voxpupuli/beaker-puppet/pull/170) ([gcampbell12](https://github.com/gcampbell12))
|
39
|
+
|
5
40
|
## [1.22.1](https://github.com/voxpupuli/beaker-puppet/tree/1.22.1) (2021-08-19)
|
6
41
|
|
7
42
|
[Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.22.0...1.22.1)
|
data/beaker-puppet.gemspec
CHANGED
@@ -10,7 +10,9 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = "https://github.com/voxpupuli/beaker-puppet"
|
11
11
|
s.summary = %q{Beaker's Puppet DSL Extension Helpers!}
|
12
12
|
s.description = %q{For use for the Beaker acceptance testing tool}
|
13
|
-
s.license = '
|
13
|
+
s.license = 'Apache-2.0'
|
14
|
+
|
15
|
+
s.required_ruby_version = '>= 2.4'
|
14
16
|
|
15
17
|
s.files = `git ls-files`.split("\n")
|
16
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -75,7 +75,7 @@ module Beaker
|
|
75
75
|
# redhat-8-arm64 is provided from amazon
|
76
76
|
return true if host.host_hash[:template] == 'redhat-8-arm64' && host.hostname =~ /.puppet.net$/
|
77
77
|
|
78
|
-
result = on(host, %(curl -fI "#{url}"), accept_all_exit_codes: true)
|
78
|
+
result = on(host, %(curl --location -fI "#{url}"), accept_all_exit_codes: true)
|
79
79
|
return result.exit_code.zero?
|
80
80
|
end
|
81
81
|
|
@@ -303,12 +303,10 @@ module Beaker
|
|
303
303
|
# run_in_parallel option includes install
|
304
304
|
run_in_parallel = run_in_parallel? opts, @options, 'install'
|
305
305
|
block_on hosts, { :run_in_parallel => run_in_parallel } do |host|
|
306
|
-
if host['platform'] =~ /el-(
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
relver = $1
|
311
|
-
install_puppet_from_rpm_on(host, opts.merge(:release => relver, :family => 'fedora'))
|
306
|
+
if host['platform'] =~ /(el|fedora)-(\d+)/
|
307
|
+
family = $1
|
308
|
+
relver = $2
|
309
|
+
install_puppet_from_rpm_on(host, opts.merge(:release => relver, :family => family))
|
312
310
|
elsif host['platform'] =~ /(ubuntu|debian|cumulus|huaweios)/
|
313
311
|
install_puppet_from_deb_on(host, opts)
|
314
312
|
elsif host['platform'] =~ /windows/
|
@@ -683,7 +681,7 @@ module Beaker
|
|
683
681
|
if host.is_cygwin?
|
684
682
|
# NOTE: it is critical that -o be before -O on Windows
|
685
683
|
proxy = opts[:package_proxy] ? "-x #{opts[:package_proxy]} " : ''
|
686
|
-
on host, "curl #{proxy}
|
684
|
+
on host, "curl #{proxy}--location --output \"#{msi_download_path}\" --remote-name #{link}"
|
687
685
|
|
688
686
|
#Because the msi installer doesn't add Puppet to the environment path
|
689
687
|
#Add both potential paths for simplicity
|
@@ -763,9 +761,9 @@ module Beaker
|
|
763
761
|
raise "You need to specify versions for OSX host\n eg. install_puppet({:version => '3.6.2',:facter_version => '2.1.0',:hiera_version => '1.3.4',})"
|
764
762
|
end
|
765
763
|
|
766
|
-
on host, "curl -
|
767
|
-
on host, "curl -
|
768
|
-
on host, "curl -
|
764
|
+
on host, "curl --location --remote-name #{opts[:mac_download_url]}/puppet-#{puppet_ver}.dmg"
|
765
|
+
on host, "curl --location --remote-name #{opts[:mac_download_url]}/facter-#{facter_ver}.dmg"
|
766
|
+
on host, "curl --location --remote-name #{opts[:mac_download_url]}/hiera-#{hiera_ver}.dmg"
|
769
767
|
|
770
768
|
host.install_package("puppet-#{puppet_ver}")
|
771
769
|
host.install_package("facter-#{facter_ver}")
|
@@ -817,7 +815,7 @@ module Beaker
|
|
817
815
|
|
818
816
|
pkg_name = "puppet-agent-#{agent_version}*"
|
819
817
|
dmg_name = "puppet-agent-#{agent_version}-1.osx#{version}.dmg"
|
820
|
-
on host, "curl -
|
818
|
+
on host, "curl --location --remote-name #{download_url}/#{dmg_name}"
|
821
819
|
|
822
820
|
host.install_package(pkg_name)
|
823
821
|
|
@@ -828,7 +826,7 @@ module Beaker
|
|
828
826
|
# Returns the latest puppet-agent version number from a given url.
|
829
827
|
#
|
830
828
|
# @param [String] url URL containing list of puppet-agent packages.
|
831
|
-
# Example: https://downloads.puppetlabs.com/mac/10.
|
829
|
+
# Example: https://downloads.puppetlabs.com/mac/puppet7/10.15/x86_64/
|
832
830
|
#
|
833
831
|
# @return [String] version puppet-agent version number (e.g. 1.4.1)
|
834
832
|
# Empty string if none found.
|
@@ -836,8 +834,20 @@ module Beaker
|
|
836
834
|
def get_latest_puppet_agent_build_from_url(url)
|
837
835
|
require 'oga'
|
838
836
|
require 'net/http'
|
839
|
-
|
840
|
-
|
837
|
+
|
838
|
+
full_url = "#{url}/index_by_lastModified_reverse.html"
|
839
|
+
response = Net::HTTP.get_response(URI(full_url))
|
840
|
+
counter = 0
|
841
|
+
|
842
|
+
# Redirect following
|
843
|
+
while response.is_a?(Net::HTTPRedirection) && counter < 15
|
844
|
+
response = Net::HTTP.get_response(URI.parse(Net::HTTP.get_response(URI(full_url))['location']))
|
845
|
+
counter = counter + 1
|
846
|
+
end
|
847
|
+
|
848
|
+
raise "The URL for puppet-agent download, #{response.uri}, returned #{response.message} with #{response.code}" unless response.is_a?(Net::HTTPSuccess)
|
849
|
+
|
850
|
+
document = Oga.parse_html(response.body)
|
841
851
|
agents = document.xpath('//a[contains(@href, "puppet-agent")]')
|
842
852
|
|
843
853
|
latest_match = agents.shift.attributes[0].value
|
@@ -15,8 +15,8 @@ module Beaker
|
|
15
15
|
|
16
16
|
# The directories in the module directory that will not be scp-ed to the test system when using
|
17
17
|
# `copy_module_to`
|
18
|
-
PUPPET_MODULE_INSTALL_IGNORE = ['
|
19
|
-
'bundle', 'spec', 'tests', 'log', '
|
18
|
+
PUPPET_MODULE_INSTALL_IGNORE = ['/.bundle', '/.git', '/.idea', '/.vagrant', '/.vendor', '/vendor', '/acceptance',
|
19
|
+
'/bundle', '/spec', '/tests', '/log', '/.svn', '/junit', '/pkg', '/example', '/tmp']
|
20
20
|
|
21
21
|
# Install the desired module on all hosts using either the PMT or a
|
22
22
|
# staging forge
|
@@ -174,7 +174,7 @@ describe ClassMixedWithDSLHelpers do
|
|
174
174
|
|
175
175
|
expect( subject ).to receive( :on ).
|
176
176
|
with( agent, 'puppet_command',
|
177
|
-
:acceptable_exit_codes => [0] )
|
177
|
+
{:acceptable_exit_codes => [0]} )
|
178
178
|
|
179
179
|
subject.apply_manifest_on( agent, 'class { "boo": }')
|
180
180
|
end
|
@@ -189,7 +189,7 @@ describe ClassMixedWithDSLHelpers do
|
|
189
189
|
and_return( 'puppet_command' )
|
190
190
|
|
191
191
|
expect( subject ).to receive( :on ).
|
192
|
-
with( host, 'puppet_command', :acceptable_exit_codes => [0] )
|
192
|
+
with( host, 'puppet_command', {:acceptable_exit_codes => [0]} )
|
193
193
|
end
|
194
194
|
|
195
195
|
result = subject.apply_manifest_on( the_hosts, 'include foobar' )
|
@@ -209,7 +209,7 @@ describe ClassMixedWithDSLHelpers do
|
|
209
209
|
and_return( 'puppet_command' )
|
210
210
|
the_hosts.each do |host|
|
211
211
|
allow( subject ).to receive( :on ).
|
212
|
-
|
212
|
+
with( host, 'puppet_command', {:acceptable_exit_codes => [0]} )
|
213
213
|
end
|
214
214
|
|
215
215
|
result = nil
|
@@ -228,11 +228,11 @@ describe ClassMixedWithDSLHelpers do
|
|
228
228
|
and_return( 'puppet_command' )
|
229
229
|
the_hosts.each do |host|
|
230
230
|
allow( subject ).to receive( :on ).
|
231
|
-
with( host, 'puppet_command', :acceptable_exit_codes => [0] )
|
231
|
+
with( host, 'puppet_command', {:acceptable_exit_codes => [0]} )
|
232
232
|
end
|
233
233
|
expect( subject ).to receive( :block_on ).with(
|
234
234
|
anything,
|
235
|
-
:run_in_parallel => true
|
235
|
+
{:run_in_parallel => true}
|
236
236
|
)
|
237
237
|
|
238
238
|
subject.apply_manifest_on( the_hosts, 'include foobar', { :run_in_parallel => true } )
|
@@ -246,11 +246,11 @@ describe ClassMixedWithDSLHelpers do
|
|
246
246
|
|
247
247
|
expect( subject ).to receive( :on ).
|
248
248
|
with( agent, 'puppet_command',
|
249
|
-
:acceptable_exit_codes => [0,2] )
|
249
|
+
{:acceptable_exit_codes => [0,2]} )
|
250
250
|
|
251
251
|
subject.apply_manifest_on( agent,
|
252
252
|
'class { "boo": }',
|
253
|
-
:catch_failures => true )
|
253
|
+
{:catch_failures => true} )
|
254
254
|
end
|
255
255
|
it 'allows acceptable exit codes through :catch_failures' do
|
256
256
|
allow( subject ).to receive( :hosts ).and_return( hosts )
|
@@ -260,12 +260,12 @@ describe ClassMixedWithDSLHelpers do
|
|
260
260
|
|
261
261
|
expect( subject ).to receive( :on ).
|
262
262
|
with( agent, 'puppet_command',
|
263
|
-
|
263
|
+
{:acceptable_exit_codes => [4,0,2]} )
|
264
264
|
|
265
265
|
subject.apply_manifest_on( agent,
|
266
266
|
'class { "boo": }',
|
267
|
-
:acceptable_exit_codes => [4],
|
268
|
-
|
267
|
+
{:acceptable_exit_codes => [4],
|
268
|
+
:catch_failures => true} )
|
269
269
|
end
|
270
270
|
it 'enforces a 0 exit code through :catch_changes' do
|
271
271
|
allow( subject ).to receive( :hosts ).and_return( hosts )
|
@@ -276,13 +276,13 @@ describe ClassMixedWithDSLHelpers do
|
|
276
276
|
expect( subject ).to receive( :on ).with(
|
277
277
|
agent,
|
278
278
|
'puppet_command',
|
279
|
-
:acceptable_exit_codes => [0]
|
279
|
+
{:acceptable_exit_codes => [0]}
|
280
280
|
)
|
281
281
|
|
282
282
|
subject.apply_manifest_on(
|
283
283
|
agent,
|
284
284
|
'class { "boo": }',
|
285
|
-
:catch_changes => true
|
285
|
+
{:catch_changes => true}
|
286
286
|
)
|
287
287
|
end
|
288
288
|
it 'enforces a 2 exit code through :expect_changes' do
|
@@ -294,13 +294,13 @@ describe ClassMixedWithDSLHelpers do
|
|
294
294
|
expect( subject ).to receive( :on ).with(
|
295
295
|
agent,
|
296
296
|
'puppet_command',
|
297
|
-
:acceptable_exit_codes => [2]
|
297
|
+
{:acceptable_exit_codes => [2]}
|
298
298
|
)
|
299
299
|
|
300
300
|
subject.apply_manifest_on(
|
301
301
|
agent,
|
302
302
|
'class { "boo": }',
|
303
|
-
:expect_changes => true
|
303
|
+
{:expect_changes => true}
|
304
304
|
)
|
305
305
|
end
|
306
306
|
it 'enforces exit codes through :expect_failures' do
|
@@ -312,13 +312,13 @@ describe ClassMixedWithDSLHelpers do
|
|
312
312
|
expect( subject ).to receive( :on ).with(
|
313
313
|
agent,
|
314
314
|
'puppet_command',
|
315
|
-
:acceptable_exit_codes => [1,4,6]
|
315
|
+
{:acceptable_exit_codes => [1,4,6]}
|
316
316
|
)
|
317
317
|
|
318
318
|
subject.apply_manifest_on(
|
319
319
|
agent,
|
320
320
|
'class { "boo": }',
|
321
|
-
:expect_failures => true
|
321
|
+
{:expect_failures => true}
|
322
322
|
)
|
323
323
|
end
|
324
324
|
it 'enforces exit codes through :expect_failures' do
|
@@ -341,14 +341,14 @@ describe ClassMixedWithDSLHelpers do
|
|
341
341
|
expect( subject ).to receive( :on ).with(
|
342
342
|
agent,
|
343
343
|
'puppet_command',
|
344
|
-
:acceptable_exit_codes => [1,2,3,4,5,6]
|
344
|
+
{:acceptable_exit_codes => [1,2,3,4,5,6]}
|
345
345
|
)
|
346
346
|
|
347
347
|
subject.apply_manifest_on(
|
348
348
|
agent,
|
349
349
|
'class { "boo": }',
|
350
|
-
:acceptable_exit_codes => (1..5),
|
351
|
-
|
350
|
+
{:acceptable_exit_codes => (1..5),
|
351
|
+
:expect_failures => true}
|
352
352
|
)
|
353
353
|
end
|
354
354
|
|
@@ -341,7 +341,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
341
341
|
|
342
342
|
it 'installs puppet on cygwin windows' do
|
343
343
|
allow(subject).to receive(:link_exists?).and_return( true )
|
344
|
-
expect(subject).to receive(:on).with(winhost, "curl
|
344
|
+
expect(subject).to receive(:on).with(winhost, "curl --location --output \"#{win_temp}\\puppet-3.7.1-x64.msi\" --remote-name http://downloads.puppet.com/windows/puppet-3.7.1-x64.msi")
|
345
345
|
expect(subject).to receive(:on).with(winhost, " echo 'export PATH=$PATH:\"/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/bin\":\"/cygdrive/c/Program Files/Puppet Labs/Puppet/bin\"' > /etc/bash.bashrc ")
|
346
346
|
expect(subject).to receive(:install_msi_on).with(winhost, "#{win_temp}\\puppet-3.7.1-x64.msi", {}, {:debug => nil})
|
347
347
|
|
@@ -350,7 +350,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
350
350
|
|
351
351
|
it 'installs puppet on cygwin windows via proxy' do
|
352
352
|
allow(subject).to receive(:link_exists?).and_return( true )
|
353
|
-
expect(subject).to receive(:on).with(winhost, "curl -x https://proxy.com
|
353
|
+
expect(subject).to receive(:on).with(winhost, "curl -x https://proxy.com --location --output \"#{win_temp}\\puppet-3.7.1-x64.msi\" --remote-name http://downloads.puppet.com/windows/puppet-3.7.1-x64.msi")
|
354
354
|
expect(subject).to receive(:on).with(winhost, " echo 'export PATH=$PATH:\"/cygdrive/c/Program Files (x86)/Puppet Labs/Puppet/bin\":\"/cygdrive/c/Program Files/Puppet Labs/Puppet/bin\"' > /etc/bash.bashrc ")
|
355
355
|
expect(subject).to receive(:install_msi_on).with(winhost, "#{win_temp}\\puppet-3.7.1-x64.msi", {}, {:debug => nil})
|
356
356
|
|
@@ -99,7 +99,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
99
99
|
expect_version_log_called
|
100
100
|
expect( subject ).to receive( :create_install_msi_batch_on ).with(
|
101
101
|
anything, anything,
|
102
|
-
'PUPPET_AGENT_STARTUP_MODE' => 'Manual')
|
102
|
+
{'PUPPET_AGENT_STARTUP_MODE' => 'Manual'})
|
103
103
|
subject.install_msi_on(hosts, msi_path, {})
|
104
104
|
end
|
105
105
|
|
@@ -112,7 +112,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
112
112
|
value = 'Automatic'
|
113
113
|
expect( subject ).to receive( :create_install_msi_batch_on ).with(
|
114
114
|
anything, anything,
|
115
|
-
'PUPPET_AGENT_STARTUP_MODE' => value)
|
115
|
+
{'PUPPET_AGENT_STARTUP_MODE' => value})
|
116
116
|
subject.install_msi_on(hosts, msi_path, {'PUPPET_AGENT_STARTUP_MODE' => value})
|
117
117
|
end
|
118
118
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.24.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: 2022-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -251,7 +251,7 @@ files:
|
|
251
251
|
- tasks/ci.rake
|
252
252
|
homepage: https://github.com/voxpupuli/beaker-puppet
|
253
253
|
licenses:
|
254
|
-
-
|
254
|
+
- Apache-2.0
|
255
255
|
metadata: {}
|
256
256
|
post_install_message:
|
257
257
|
rdoc_options: []
|
@@ -261,14 +261,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
261
261
|
requirements:
|
262
262
|
- - ">="
|
263
263
|
- !ruby/object:Gem::Version
|
264
|
-
version: '
|
264
|
+
version: '2.4'
|
265
265
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
266
266
|
requirements:
|
267
267
|
- - ">="
|
268
268
|
- !ruby/object:Gem::Version
|
269
269
|
version: '0'
|
270
270
|
requirements: []
|
271
|
-
rubygems_version: 3.2.
|
271
|
+
rubygems_version: 3.2.32
|
272
272
|
signing_key:
|
273
273
|
specification_version: 4
|
274
274
|
summary: Beaker's Puppet DSL Extension Helpers!
|