beaker-pe 2.11.4 → 2.11.9
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/dependabot.yml +8 -0
- data/CODEOWNERS +2 -1
- data/README.md +2 -2
- data/beaker-pe.gemspec +1 -1
- data/lib/beaker-pe/install/pe_utils.rb +52 -6
- data/lib/beaker-pe/pe-client-tools/executable_helper.rb +1 -0
- data/lib/beaker-pe/pe-client-tools/install_helper.rb +9 -0
- data/lib/beaker-pe/version.rb +1 -1
- data/spec/beaker-pe/install/pe_utils_spec.rb +10 -3
- metadata +8 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4197540caf650f2becd54033331accdf18962cc11b6105b3c270612f3db83177
|
|
4
|
+
data.tar.gz: 56f0df650510231101a0b0018532841a96835298912e704983f7890aadc99407
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 44c3f5e5c6bf878baa921ed03e1bbb8710fe1ae1cf82802825e4b6241d2d37e1580a6fdc5c530752c67454df00c5459157f59c44a1051233f405b764850104d4
|
|
7
|
+
data.tar.gz: 4ab1aa98440c6865cdb02d2dd3aa67745931d7a65d0ee3109f2b6139d954a1805fa60d3e04c7654dde11a08da8c0c1c32f663bec2250eab47c340ff429144f1e
|
data/CODEOWNERS
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
#This Repository is maintained by both the beaker and
|
|
1
|
+
#This Repository is maintained by both the beaker, installer, and Night's Watch teams, depending on the location of the changes
|
|
2
2
|
* @puppetlabs/beaker
|
|
3
3
|
/lib/beaker-pe/install @puppetlabs/installer-and-management
|
|
4
|
+
/lib/beaker-pe/pe-client-tools @puppetlabs/night-s-watch
|
|
4
5
|
/spec/beaker-pe/install @puppetlabs/installer-and-management
|
data/README.md
CHANGED
|
@@ -70,10 +70,10 @@ you'd like to provide your own hosts file, set the `CONFIG` environment variable
|
|
|
70
70
|
# Release
|
|
71
71
|
|
|
72
72
|
To release new versions, we use a
|
|
73
|
-
[Jenkins job](https://cinext-jenkinsmaster-sre-prod-1.delivery.puppetlabs.net/job/qe_beaker-pe-gem_init-
|
|
73
|
+
[Jenkins job](https://cinext-jenkinsmaster-sre-prod-1.delivery.puppetlabs.net/job/qe_beaker-pe-gem_init-multijob_main/)
|
|
74
74
|
(access to internal infrastructure will be required to view job).
|
|
75
75
|
|
|
76
|
-
To release a new version (from the
|
|
76
|
+
To release a new version (from the main branch), you'll need to just provide
|
|
77
77
|
a new beaker-pe version number to the job, and you're off to the races.
|
|
78
78
|
|
|
79
79
|
# Questions
|
data/beaker-pe.gemspec
CHANGED
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
|
22
22
|
s.add_development_dependency 'rspec-its'
|
|
23
23
|
s.add_development_dependency 'fakefs', '~> 0.6', '< 0.14.0'
|
|
24
24
|
s.add_development_dependency 'rake', '~> 12.3.3'
|
|
25
|
-
s.add_development_dependency 'simplecov'
|
|
25
|
+
s.add_development_dependency 'simplecov', '= 0.18.5'
|
|
26
26
|
s.add_development_dependency 'pry', '~> 0.10'
|
|
27
27
|
|
|
28
28
|
# Documentation dependencies
|
|
@@ -6,7 +6,6 @@ require "beaker-answers"
|
|
|
6
6
|
require "timeout"
|
|
7
7
|
require "json"
|
|
8
8
|
require "deep_merge"
|
|
9
|
-
|
|
10
9
|
module Beaker
|
|
11
10
|
module DSL
|
|
12
11
|
module InstallUtils
|
|
@@ -185,6 +184,12 @@ module Beaker
|
|
|
185
184
|
pe_debug = host[:pe_debug] || opts[:pe_debug] ? ' -x' : ''
|
|
186
185
|
use_puppet_ca_cert = host[:use_puppet_ca_cert] || opts[:use_puppet_ca_cert]
|
|
187
186
|
|
|
187
|
+
# PE 2019.8.3 had a bug in the frictionless install of osx-10.14 and osx-10.15
|
|
188
|
+
# We need to do a bit of a hacky process to install the agent
|
|
189
|
+
if host['platform'] =~ /osx-10\.1(4|5)/ && (pe_version.eql?('2019.8.3') || pe_version.eql?('2019.8.4'))
|
|
190
|
+
return "curl -kO https://#{downloadhost}:8140/packages/current/#{host['platform']}.bash && bash #{host['platform']}.bash"
|
|
191
|
+
end
|
|
192
|
+
|
|
188
193
|
if host['platform'] =~ /windows/ then
|
|
189
194
|
if use_puppet_ca_cert
|
|
190
195
|
frictionless_install_opts << '-UsePuppetCA'
|
|
@@ -292,7 +297,7 @@ module Beaker
|
|
|
292
297
|
fetch_and_push_pe(host, path, filename, extension)
|
|
293
298
|
else
|
|
294
299
|
curlopts = opts[:use_proxy] ? " --proxy #{opts[:proxy_hostname]}:3128" : ""
|
|
295
|
-
on host, "cd #{host['working_dir']}; curl -O #{path}/#{filename}#{extension}#{curlopts}"
|
|
300
|
+
on host, "cd #{host['working_dir']}; curl -L -O #{path}/#{filename}#{extension}#{curlopts}"
|
|
296
301
|
end
|
|
297
302
|
end
|
|
298
303
|
end
|
|
@@ -328,7 +333,7 @@ module Beaker
|
|
|
328
333
|
on host, "cd #{host['working_dir']}; chmod 644 #{filename}#{extension}"
|
|
329
334
|
elsif host.is_cygwin?
|
|
330
335
|
curlopts = opts[:use_proxy] ? " --proxy #{opts[:proxy_hostname]}:3128" : ""
|
|
331
|
-
on host, "cd #{host['working_dir']}; curl -O #{path}/#{filename}#{extension}#{curlopts}"
|
|
336
|
+
on host, "cd #{host['working_dir']}; curl -L -O #{path}/#{filename}#{extension}#{curlopts}"
|
|
332
337
|
else
|
|
333
338
|
on host, powershell("$webclient = New-Object System.Net.WebClient; $webclient.DownloadFile('#{path}/#{filename}#{extension}','#{host['working_dir']}\\#{filename}#{extension}')")
|
|
334
339
|
end
|
|
@@ -381,7 +386,7 @@ module Beaker
|
|
|
381
386
|
command_file_push = 'cat '
|
|
382
387
|
else
|
|
383
388
|
curlopts = opts[:use_proxy] ? "--proxy #{opts[:proxy_hostname]}:3128 " : ""
|
|
384
|
-
command_file_push = "curl #{curlopts}#{path}/"
|
|
389
|
+
command_file_push = "curl -L #{curlopts}#{path}/"
|
|
385
390
|
end
|
|
386
391
|
on host, "cd #{host['working_dir']}; #{command_file_push}#{filename}#{extension} | #{unpack}"
|
|
387
392
|
|
|
@@ -582,6 +587,8 @@ module Beaker
|
|
|
582
587
|
do_install_pe_with_pe_managed_external_postgres(hosts,opts)
|
|
583
588
|
when :simple_monolithic
|
|
584
589
|
simple_monolithic_install(hosts.first, hosts.drop(1), opts)
|
|
590
|
+
when :simple_monolithic_install_with_preload
|
|
591
|
+
simple_monolithic_install_with_preload(hosts.first, hosts.drop(1), opts)
|
|
585
592
|
when :simple_split
|
|
586
593
|
# This isn't implemented yet, so just do a generic install instead
|
|
587
594
|
#simple_split_install(hosts, opts)
|
|
@@ -628,7 +635,11 @@ module Beaker
|
|
|
628
635
|
|
|
629
636
|
mono_roles = ['master', 'database', 'dashboard']
|
|
630
637
|
if has_all_roles?(hosts.first, mono_roles) && hosts.drop(1).all? {|host| host['roles'].include?('frictionless')}
|
|
631
|
-
:
|
|
638
|
+
if hosts.first['template'] =~ /-preload/ && opts[:type] != :upgrade
|
|
639
|
+
:simple_monolithic_install_with_preload
|
|
640
|
+
else
|
|
641
|
+
:simple_monolithic
|
|
642
|
+
end
|
|
632
643
|
elsif hosts[0]['roles'].include?('master') && hosts[1]['roles'].include?('database') && hosts[2]['roles'].include?('dashboard') && hosts.drop(3).all? {|host| host['roles'].include?('frictionless')}
|
|
633
644
|
:simple_split
|
|
634
645
|
elsif hosts.any? {|host| host['roles'].include?('pe_postgres')}
|
|
@@ -683,6 +694,37 @@ module Beaker
|
|
|
683
694
|
end
|
|
684
695
|
end
|
|
685
696
|
|
|
697
|
+
# Configure PE on a monolithic master and some number of frictionless agents if a node is using a PE preloaded image for the master node.
|
|
698
|
+
# @param [Host] master The node to configure the master on
|
|
699
|
+
# @param [Array<Host>] agents The nodes to install agents on
|
|
700
|
+
# @param [Hash{Symbol=>Symbol, String}] opts The options for how to install or upgrade PE
|
|
701
|
+
#
|
|
702
|
+
# @example
|
|
703
|
+
# simple_monolithic_install_with_preload(master, agents, {:type => :install, :pe_ver => '2017.2.0'})
|
|
704
|
+
#
|
|
705
|
+
# @return nil
|
|
706
|
+
#
|
|
707
|
+
# @api private
|
|
708
|
+
def simple_monolithic_install_with_preload(master, agents, opts={})
|
|
709
|
+
step "Performing a standard monolithic install with frictionless agents on a preloaded image"
|
|
710
|
+
all_hosts = [master, *agents]
|
|
711
|
+
configure_type_defaults_on([master])
|
|
712
|
+
|
|
713
|
+
# Set PE distribution on the agents, creates working directories
|
|
714
|
+
prepare_hosts(all_hosts, opts)
|
|
715
|
+
register_feature_flags!(opts)
|
|
716
|
+
generate_installer_conf_file_for(master, all_hosts, opts)
|
|
717
|
+
|
|
718
|
+
step "Stop agent on master" do
|
|
719
|
+
stop_agent_on(master)
|
|
720
|
+
end
|
|
721
|
+
|
|
722
|
+
if manage_puppet_service?(master[:pe_ver], options)
|
|
723
|
+
configure_puppet_agent_service(:ensure => 'stopped', :enabled => false)
|
|
724
|
+
end
|
|
725
|
+
|
|
726
|
+
install_agents_only_on(agents, opts)
|
|
727
|
+
end
|
|
686
728
|
|
|
687
729
|
# Configure the master to use a proxy and drop unproxied connections
|
|
688
730
|
def config_hosts_for_proxy_access hosts
|
|
@@ -1011,7 +1053,11 @@ module Beaker
|
|
|
1011
1053
|
facts_result = on(master, 'puppet facts')
|
|
1012
1054
|
raise ArgumentError, fail_message if facts_result.exit_code != 0
|
|
1013
1055
|
facts_hash = JSON.parse(facts_result.stdout.chomp)
|
|
1014
|
-
|
|
1056
|
+
# In Puppet 7, facts are at the top level of the hash. Before that
|
|
1057
|
+
# version, they were wrapped inside a `values` key. Since we're
|
|
1058
|
+
# trying to determine the agent version here, we can't just switch
|
|
1059
|
+
# our behavior by agent version, so we check both possible locations.
|
|
1060
|
+
puppet_agent_version = facts_hash['aio_agent_version'] || facts_hash.dig('values', 'aio_agent_version')
|
|
1015
1061
|
raise ArgumentError, fail_message if puppet_agent_version.nil?
|
|
1016
1062
|
logger.warn("#{log_prefix} Read puppet-agent version #{puppet_agent_version} from master")
|
|
1017
1063
|
# saving so that we don't have to query the master more than once
|
|
@@ -47,6 +47,15 @@ module Beaker
|
|
|
47
47
|
else
|
|
48
48
|
install_dev_repos_on(product, host, directory, '/tmp/repo_configs',{:dev_builds_url => opts[:dev_builds_url]})
|
|
49
49
|
host.install_package('pe-client-tools')
|
|
50
|
+
if host['platform'] =~ /cisco|centos|redhat|eos|sles|el-|fedora-(2[2-9]|3[0-9])/
|
|
51
|
+
host.exec(Command.new('rpm -q pe-client-tools')) do |command|
|
|
52
|
+
raise "Wanted version not installed." unless command.stdout =~ /-#{opts[:pe_client_tools_version]}/
|
|
53
|
+
end
|
|
54
|
+
elsif host['platform'] =~ /ubuntu|debian|cumulus|huaweios/
|
|
55
|
+
host.exec(Command.new("apt-cache policy pe-client-tools | sed -n -e 's/Installed: //p'")) do |command|
|
|
56
|
+
raise "Wanted version not installed." unless command.stdout =~ /-#{opts[:pe_client_tools_version]}/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
50
59
|
end
|
|
51
60
|
end
|
|
52
61
|
end
|
data/lib/beaker-pe/version.rb
CHANGED
|
@@ -1091,7 +1091,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1091
1091
|
path = unixhost['pe_dir']
|
|
1092
1092
|
filename = "#{ unixhost['dist'] }"
|
|
1093
1093
|
extension = '.tar'
|
|
1094
|
-
expect( subject ).to receive( :on ).with( unixhost, "cd #{ unixhost['working_dir'] }; curl #{ path }/#{ filename }#{ extension } | tar -xvf -" ).once
|
|
1094
|
+
expect( subject ).to receive( :on ).with( unixhost, "cd #{ unixhost['working_dir'] }; curl -L #{ path }/#{ filename }#{ extension } | tar -xvf -" ).once
|
|
1095
1095
|
subject.fetch_pe( [unixhost], {} )
|
|
1096
1096
|
end
|
|
1097
1097
|
|
|
@@ -1121,7 +1121,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1121
1121
|
path = unixhost['pe_dir']
|
|
1122
1122
|
filename = "#{ unixhost['dist'] }"
|
|
1123
1123
|
extension = '.tar.gz'
|
|
1124
|
-
expect( subject ).to receive( :on ).with( unixhost, "cd #{ unixhost['working_dir'] }; curl #{ path }/#{ filename }#{ extension } | gunzip | tar -xvf -" ).once
|
|
1124
|
+
expect( subject ).to receive( :on ).with( unixhost, "cd #{ unixhost['working_dir'] }; curl -L #{ path }/#{ filename }#{ extension } | gunzip | tar -xvf -" ).once
|
|
1125
1125
|
subject.fetch_pe( [unixhost], {} )
|
|
1126
1126
|
end
|
|
1127
1127
|
|
|
@@ -1167,7 +1167,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1167
1167
|
path = machost['pe_dir']
|
|
1168
1168
|
filename = "#{ machost['dist'] }"
|
|
1169
1169
|
extension = '.dmg'
|
|
1170
|
-
expect( subject ).to receive( :on ).with( machost, "cd #{ machost['working_dir'] }; curl -O #{ path }/#{ filename }#{ extension }" ).once
|
|
1170
|
+
expect( subject ).to receive( :on ).with( machost, "cd #{ machost['working_dir'] }; curl -L -O #{ path }/#{ filename }#{ extension }" ).once
|
|
1171
1171
|
subject.fetch_pe( [machost], {} )
|
|
1172
1172
|
end
|
|
1173
1173
|
|
|
@@ -1621,6 +1621,13 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1621
1621
|
subject.do_install([])
|
|
1622
1622
|
end
|
|
1623
1623
|
|
|
1624
|
+
it 'chooses to do a simple monolithic install with preload when appropriate' do
|
|
1625
|
+
expect(subject).to receive(:simple_monolithic_install_with_preload)
|
|
1626
|
+
allow(subject).to receive(:determine_install_type).and_return(:simple_monolithic_install_with_preload)
|
|
1627
|
+
|
|
1628
|
+
subject.do_install([])
|
|
1629
|
+
end
|
|
1630
|
+
|
|
1624
1631
|
it 'can perform a simple installation' do
|
|
1625
1632
|
expect(subject).to receive(:get_mco_setting).and_return({})
|
|
1626
1633
|
allow( subject ).to receive( :verify_network_resources).with(hosts, nil)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: beaker-pe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.11.
|
|
4
|
+
version: 2.11.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppetlabs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-11-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|
|
@@ -76,16 +76,16 @@ dependencies:
|
|
|
76
76
|
name: simplecov
|
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements:
|
|
79
|
-
- -
|
|
79
|
+
- - '='
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
|
-
version:
|
|
81
|
+
version: 0.18.5
|
|
82
82
|
type: :development
|
|
83
83
|
prerelease: false
|
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
|
85
85
|
requirements:
|
|
86
|
-
- -
|
|
86
|
+
- - '='
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version:
|
|
88
|
+
version: 0.18.5
|
|
89
89
|
- !ruby/object:Gem::Dependency
|
|
90
90
|
name: pry
|
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -248,6 +248,7 @@ executables:
|
|
|
248
248
|
extensions: []
|
|
249
249
|
extra_rdoc_files: []
|
|
250
250
|
files:
|
|
251
|
+
- ".github/dependabot.yml"
|
|
251
252
|
- ".gitignore"
|
|
252
253
|
- ".rspec"
|
|
253
254
|
- ".simplecov"
|
|
@@ -306,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
306
307
|
- !ruby/object:Gem::Version
|
|
307
308
|
version: '0'
|
|
308
309
|
requirements: []
|
|
309
|
-
rubygems_version: 3.0.
|
|
310
|
+
rubygems_version: 3.0.8
|
|
310
311
|
signing_key:
|
|
311
312
|
specification_version: 4
|
|
312
313
|
summary: Beaker PE DSL Helpers!
|